Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion build_js.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ mkdir -p build_js
cd build_js

cmake ../src \
-DCORRADE_RC_EXECUTABLE=../build_corrade-rc/deps/corrade/src/Corrade/Utility/corrade-rc \
-DCORRADE_RC_EXECUTABLE=../build_corrade-rc/RelWithDebInfo/bin/corrade-rc \

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems unrelated and assumes the build-type of corrade-rc.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

With 2019.10 magnum is by default putting all binaries and libraries into a single location to make it easier to load dynamic plugins from the build dir (and also avoid DLL hell for Windows users). So this is a direct result of that. I could override that with CMAKE_RUNTIME_OUTPUT_LOCATION for the CI script if desired.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Interesting, so binaries are no longer being built in the usual location of CMAKE_CURRENT_BINARY_DIR?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not, unless you set one of the CMAKE_{RUNTIME,LIBRARY,ARCHIVE}_OUTPUT_LOCATION, in which case that setting is preserved. This also affects only Magnum used as a subproject, in case of a system-wide installed Magnum it's assumed PATH is set up properly and plugins are in expected locations, so there's less reasons to mess with this. Docs for reference.

This makes the workflow easier for majority of users and so it's enabled by default. Habitat builds everything including plugins as static, so there it doesn't make much difference (although once I got used to binaries being all in one place, I have to admit it's much more convenient). If you wish to preserve the original behavior, I can override this.

@msbaines msbaines Nov 5, 2019

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I thought Release was the default build. Maybe set CMAKE_BUILD_TYPE explicitly above when corrade-rc is built. That way, we aren't relying on a default.

@mosra mosra Nov 5, 2019

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

RelWithDebInfo is set as default here in CMakeLists.txt and here as the opposite of Debug in setup.py. It was done like this before my time so I don't know the reasons behind, but I'd say it's a pretty strong default :)

(AFAIK, CMake's default build type is an empty string, so neither Debug, Release, nor RelWithDebInfo.)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah.

-DBUILD_GUI_VIEWERS=ON \
-DBUILD_PYTHON_BINDINGS=OFF \
-DBUILD_ASSIMP_SUPPORT=OFF \
Expand Down
1 change: 1 addition & 0 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ option(BUILD_WITH_BULLET "Build Habitat-Sim with Bullet physics enabled -- Requi
option(BUILD_TEST "Build test binaries" OFF)
option(USE_SYSTEM_ASSIMP "Use system Assimp instead of a bundled submodule" OFF)
option(USE_SYSTEM_EIGEN "Use system Eigen instead of a bundled submodule" OFF)
option(USE_SYSTEM_GLFW "Use system GLFW instead of a bundled submodule" OFF)
option(USE_SYSTEM_MAGNUM "Use system Magnum instead of a bundled submodule" OFF)
option(USE_SYSTEM_PYBIND11 "Use system Pybind11 instead of a bundled submodule" OFF)
option(USE_SYSTEM_RAPIDJSON "Use system RapidJSON instead of a bundled submodule" OFF)
Expand Down
34 changes: 22 additions & 12 deletions src/cmake/FindAssimp.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -42,12 +42,20 @@
find_path(ASSIMP_INCLUDE_DIR NAMES assimp/anim.h HINTS include)

if(WIN32 AND MSVC)
if(MSVC12)
set(ASSIMP_MSVC_VERSION "vc120")
elseif(MSVC14)
set(ASSIMP_MSVC_VERSION "vc140")
# Adapted from https://github.com/assimp/assimp/blob/799fd74714f9ffac29004c6b5a674b3402524094/CMakeLists.txt#L645-L655
# with versions below MSVC 2015 (14.0 / 1900) removed, and the discouraged
# use of MSVCxy replaced with MSVC_VERSION. See also
# https://en.wikipedia.org/wiki/Microsoft_Visual_C%2B%2B#Internal_version_numbering
if(MSVC_TOOLSET_VERSION) # available only since CMake 3.12
set(ASSIMP_MSVC_VERSION vc${MSVC_TOOLSET_VERSION})
elseif(MSVC_VERSION VERSION_LESS 1910)
set(ASSIMP_MSVC_VERSION vc140)
elseif(MSVC_VERSION VERSION_LESS 1920)
set(ASSIMP_MSVC_VERSION vc141)
elseif(MSVC_VERSION VERSION_LESS 1930)
set(ASSIMP_MSVC_VERSION vc142)
else()
message(SEND_ERROR "Unsupported MSVC version.")
message(FATAL_ERROR "Unsupported MSVC version")
endif()

if(CMAKE_SIZEOF_VOID_P EQUAL 8)
Expand All @@ -58,18 +66,20 @@ if(WIN32 AND MSVC)

find_library(ASSIMP_LIBRARY_RELEASE assimp-${ASSIMP_MSVC_VERSION}-mt.lib PATHS ${ASSIMP_LIBRARY_DIR})
find_library(ASSIMP_LIBRARY_DEBUG assimp-${ASSIMP_MSVC_VERSION}-mtd.lib PATHS ${ASSIMP_LIBRARY_DIR})

# Static build of Assimp (built with Vcpkg) depends on IrrXML, find that
# one as well. If not found, simply don't link to it --- it might be a
# dynamic build, or a static build using system IrrXML. Related issue:
# https://github.com/Microsoft/vcpkg/issues/5012
find_library(ASSIMP_IRRXML_LIBRARY_RELEASE IrrXML.lib)
find_library(ASSIMP_IRRXML_LIBRARY_DEBUG IrrXMLd.lib)
else()
find_library(ASSIMP_LIBRARY_RELEASE assimp)
find_library(ASSIMP_LIBRARY_DEBUG assimpd)
endif()

# Static build of Assimp (built with Vcpkg, any system) depends on IrrXML, find
# that one as well. If not found, simply don't link to it --- it might be a
# dynamic build (on Windows it's a *.lib either way), or a static build using
# system IrrXML. Related issue: https://github.com/Microsoft/vcpkg/issues/5012
if(ASSIMP_LIBRARY_DEBUG MATCHES "${CMAKE_STATIC_LIBRARY_SUFFIX}$" OR ASSIMP_LIBRARY_RELEASE MATCHES "${CMAKE_STATIC_LIBRARY_SUFFIX}$")
find_library(ASSIMP_IRRXML_LIBRARY_RELEASE IrrXML)
find_library(ASSIMP_IRRXML_LIBRARY_DEBUG IrrXMLd)
endif()

include(SelectLibraryConfigurations)
select_library_configurations(ASSIMP)

Expand Down
11 changes: 6 additions & 5 deletions src/cmake/FindCorrade.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -475,11 +475,7 @@ foreach(_component ${Corrade_FIND_COMPONENTS})

# PluginManager library
elseif(_component STREQUAL PluginManager)
# At least static build needs this
if(CORRADE_TARGET_UNIX)
set_property(TARGET Corrade::${_component} APPEND PROPERTY
INTERFACE_LINK_LIBRARIES ${CMAKE_DL_LIBS})
endif()
# -ldl is handled by Utility now

# TestSuite library has some additional files
elseif(_component STREQUAL TestSuite)
Expand Down Expand Up @@ -514,6 +510,11 @@ foreach(_component ${Corrade_FIND_COMPONENTS})
set_property(TARGET Corrade::${_component} APPEND PROPERTY
COMPATIBLE_INTERFACE_NUMBER_MAX CORRADE_CXX_STANDARD)

# Directory::libraryLocation() needs this
if(CORRADE_TARGET_UNIX)
set_property(TARGET Corrade::${_component} APPEND PROPERTY
INTERFACE_LINK_LIBRARIES ${CMAKE_DL_LIBS})
endif()
# AndroidLogStreamBuffer class needs to be linked to log library
if(CORRADE_TARGET_ANDROID)
set_property(TARGET Corrade::${_component} APPEND PROPERTY
Expand Down
43 changes: 40 additions & 3 deletions src/cmake/FindGLFW.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
# for internal usage:
#
# GLFW_LIBRARY - GLFW library
# GLFW_DLL_DEBUG - GLFW debug DLL on Windows, if found
# GLFW_DLL_RELEASE - GLFW release DLL on Windows, if found
# GLFW_INCLUDE_DIR - Root include dir
#

Expand Down Expand Up @@ -61,11 +63,46 @@ if(TARGET glfw)
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args("GLFW" DEFAULT_MSG
_GLFW_INTERFACE_INCLUDE_DIRECTORIES)

if(CORRADE_TARGET_WINDOWS)
# .dll is in LOCATION, .lib is in IMPLIB. Yay, useful!
get_target_property(GLFW_DLL_DEBUG glfw IMPORTED_LOCATION_DEBUG)
get_target_property(GLFW_DLL_RELEASE glfw IMPORTED_LOCATION_RELEASE)
endif()

return()
endif()

# In case no config file was found, try manually finding the library.
find_library(GLFW_LIBRARY NAMES glfw glfw3)
if(CORRADE_TARGET_WINDOWS)
if(MSVC)
if(MSVC_VERSION VERSION_LESS 1910)
set(_GLFW_LIBRARY_PATH_SUFFIX lib-vc2015)
elseif(MSVC_VERSION VERSION_LESS 1920)
set(_GLFW_LIBRARY_PATH_SUFFIX lib-vc2017)
elseif(MSVC_VERSION VERSION_LESS 1930)
set(_GLFW_LIBRARY_PATH_SUFFIX lib-vc2019)
else()
message(FATAL_ERROR "Unsupported MSVC version")
endif()
elseif(MINGW)
set(_GLFW_LIBRARY_PATH_SUFFIX lib-mingw-w64)
else()
message(FATAL_ERROR "Unsupported compiler")
endif()
endif()

# In case no config file was found, try manually finding the library. Prefer
# the glfw3dll as it's a dynamic library.
find_library(GLFW_LIBRARY
NAMES glfw glfw3dll glfw3
PATH_SUFFIXES ${_GLFW_LIBRARY_PATH_SUFFIX})

if(CORRADE_TARGET_WINDOWS AND GLFW_LIBRARY MATCHES "glfw3dll.(lib|a)$")
# TODO: debug?
find_file(GLFW_DLL_RELEASE
NAMES glfw3.dll
PATH_SUFFIXES ${_GLFW_LIBRARY_PATH_SUFFIX})
endif()

# Include dir
find_path(GLFW_INCLUDE_DIR
Expand All @@ -81,7 +118,7 @@ if(NOT TARGET GLFW::GLFW)

# Work around BUGGY framework support on macOS
# https://cmake.org/Bug/view.php?id=14105
if(CORRADE_TARGET_APPLE AND ${GLFW_LIBRARY} MATCHES "\\.framework$")
if(CORRADE_TARGET_APPLE AND GLFW_LIBRARY MATCHES "\\.framework$")
set_property(TARGET GLFW::GLFW PROPERTY IMPORTED_LOCATION ${GLFW_LIBRARY}/GLFW)
else()
set_property(TARGET GLFW::GLFW PROPERTY IMPORTED_LOCATION ${GLFW_LIBRARY})
Expand Down
46 changes: 22 additions & 24 deletions src/cmake/FindMagnum.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -805,9 +805,6 @@ foreach(_component ${Magnum_FIND_COMPONENTS})

# GL library
elseif(_component STREQUAL GL)
set_property(TARGET Magnum::${_component} APPEND PROPERTY
INTERFACE_INCLUDE_DIRECTORIES ${MAGNUM_INCLUDE_DIR}/MagnumExternal/OpenGL)

if(NOT MAGNUM_TARGET_GLES OR MAGNUM_TARGET_DESKTOP_GLES)
# If the GLVND library (CMake 3.11+) was found, link to the
# imported target. Otherwise (and also on all systems except
Expand Down Expand Up @@ -1011,15 +1008,15 @@ if(_MAGNUM_WINDOWLESSAPPLICATION_ALIAS AND NOT TARGET Magnum::WindowlessApplicat
add_library(Magnum::WindowlessApplication ALIAS ${_MAGNUM_WINDOWLESSAPPLICATION_ALIASED_TARGET})
else()
add_library(Magnum::WindowlessApplication UNKNOWN IMPORTED)
get_target_property(_MAGNUM_WINDOWLESSAPPLICATION_IMPORTED_CONFIGURATIONS ${_MAGNUM_WINDOWLESSAPPLICATION_ALIAS} IMPORTED_CONFIGURATIONS)
foreach(property IMPORTED_CONFIGURATIONS INTERFACE_INCLUDE_DIRECTORIES INTERFACE_COMPILE_DEFINITIONS INTERFACE_COMPILE_OPTIONS INTERFACE_LINK_LIBRARIES)
get_target_property(_MAGNUM_WINDOWLESSAPPLICATION_${property} ${_MAGNUM_WINDOWLESSAPPLICATION_ALIAS} ${property})
if(_MAGNUM_WINDOWLESSAPPLICATION_${property})
set_target_properties(Magnum::WindowlessApplication PROPERTIES
${property} "${_MAGNUM_WINDOWLESSAPPLICATION_${property}}")
endif()
endforeach()
get_target_property(_MAGNUM_WINDOWLESSAPPLICATION_IMPORTED_LOCATION_RELEASE ${_MAGNUM_WINDOWLESSAPPLICATION_ALIAS} IMPORTED_LOCATION_RELEASE)
get_target_property(_MAGNUM_WINDOWLESSAPPLICATION_IMPORTED_LOCATION_DEBUG ${_MAGNUM_WINDOWLESSAPPLICATION_ALIAS} IMPORTED_LOCATION_DEBUG)
set_target_properties(Magnum::WindowlessApplication PROPERTIES
INTERFACE_INCLUDE_DIRECTORIES $<TARGET_PROPERTY:${_MAGNUM_WINDOWLESSAPPLICATION_ALIAS},INTERFACE_INCLUDE_DIRECTORIES>
INTERFACE_COMPILE_DEFINITIONS $<TARGET_PROPERTY:${_MAGNUM_WINDOWLESSAPPLICATION_ALIAS},INTERFACE_COMPILE_DEFINITIONS>
INTERFACE_COMPILE_OPTIONS $<TARGET_PROPERTY:${_MAGNUM_WINDOWLESSAPPLICATION_ALIAS},INTERFACE_COMPILE_OPTIONS>
INTERFACE_LINK_LIBRARIES $<TARGET_PROPERTY:${_MAGNUM_WINDOWLESSAPPLICATION_ALIAS},INTERFACE_LINK_LIBRARIES>
IMPORTED_CONFIGURATIONS "${_MAGNUM_WINDOWLESSAPPLICATION_IMPORTED_CONFIGURATIONS}")
if(_MAGNUM_WINDOWLESSAPPLICATION_IMPORTED_LOCATION_RELEASE)
set_target_properties(Magnum::WindowlessApplication PROPERTIES
IMPORTED_LOCATION_RELEASE ${_MAGNUM_WINDOWLESSAPPLICATION_IMPORTED_LOCATION_RELEASE})
Expand All @@ -1038,15 +1035,16 @@ if(_MAGNUM_APPLICATION_ALIAS AND NOT TARGET Magnum::Application)
add_library(Magnum::Application ALIAS ${_MAGNUM_APPLICATION_ALIASED_TARGET})
else()
add_library(Magnum::Application UNKNOWN IMPORTED)
get_target_property(_MAGNUM_APPLICATION_IMPORTED_CONFIGURATIONS ${_MAGNUM_APPLICATION_ALIAS} IMPORTED_CONFIGURATIONS)
foreach(property IMPORTED_CONFIGURATIONS INTERFACE_INCLUDE_DIRECTORIES INTERFACE_COMPILE_DEFINITIONS INTERFACE_COMPILE_OPTIONS INTERFACE_LINK_LIBRARIES)
get_target_property(_MAGNUM_APPLICATION_${property}
${_MAGNUM_APPLICATION_ALIAS} ${property})
if(_MAGNUM_APPLICATION_${property})
set_target_properties(Magnum::Application PROPERTIES ${property}
"${_MAGNUM_APPLICATION_${property}}")
endif()
endforeach()
get_target_property(_MAGNUM_APPLICATION_IMPORTED_LOCATION_RELEASE ${_MAGNUM_APPLICATION_ALIAS} IMPORTED_LOCATION_RELEASE)
get_target_property(_MAGNUM_APPLICATION_IMPORTED_LOCATION_DEBUG ${_MAGNUM_APPLICATION_ALIAS} IMPORTED_LOCATION_DEBUG)
set_target_properties(Magnum::Application PROPERTIES
INTERFACE_INCLUDE_DIRECTORIES $<TARGET_PROPERTY:${_MAGNUM_APPLICATION_ALIAS},INTERFACE_INCLUDE_DIRECTORIES>
INTERFACE_COMPILE_DEFINITIONS $<TARGET_PROPERTY:${_MAGNUM_APPLICATION_ALIAS},INTERFACE_COMPILE_DEFINITIONS>
INTERFACE_COMPILE_OPTIONS $<TARGET_PROPERTY:${_MAGNUM_APPLICATION_ALIAS},INTERFACE_COMPILE_OPTIONS>
INTERFACE_LINK_LIBRARIES $<TARGET_PROPERTY:${_MAGNUM_APPLICATION_ALIAS},INTERFACE_LINK_LIBRARIES>
IMPORTED_CONFIGURATIONS "${_MAGNUM_APPLICATION_IMPORTED_CONFIGURATIONS}")
if(_MAGNUM_APPLICATION_IMPORTED_LOCATION_RELEASE)
set_target_properties(Magnum::Application PROPERTIES
IMPORTED_LOCATION_RELEASE ${_MAGNUM_APPLICATION_IMPORTED_LOCATION_RELEASE})
Expand All @@ -1065,15 +1063,15 @@ if(_MAGNUM_GLCONTEXT_ALIAS AND NOT TARGET Magnum::GLContext)
add_library(Magnum::GLContext ALIAS ${_MAGNUM_GLCONTEXT_ALIASED_TARGET})
else()
add_library(Magnum::GLContext UNKNOWN IMPORTED)
get_target_property(_MAGNUM_GLCONTEXT_IMPORTED_CONFIGURATIONS ${_MAGNUM_GLCONTEXT_ALIAS} IMPORTED_CONFIGURATIONS)
foreach(property IMPORTED_CONFIGURATIONS INTERFACE_INCLUDE_DIRECTORIES INTERFACE_COMPILE_DEFINITIONS INTERFACE_COMPILE_OPTIONS INTERFACE_LINK_LIBRARIES)
get_target_property(_MAGNUM_GLCONTEXT_${property} ${_MAGNUM_GLCONTEXT_ALIAS} ${property})
if(_MAGNUM_GLCONTEXT_${property})
set_target_properties(Magnum::GLContext PROPERTIES ${property}
"${_MAGNUM_GLCONTEXT_${property}}")
endif()
endforeach()
get_target_property(_MAGNUM_GLCONTEXT_IMPORTED_LOCATION_RELEASE ${_MAGNUM_GLCONTEXT_ALIAS} IMPORTED_LOCATION_RELEASE)
get_target_property(_MAGNUM_GLCONTEXT_IMPORTED_LOCATION_DEBUG ${_MAGNUM_GLCONTEXT_ALIAS} IMPORTED_LOCATION_DEBUG)
set_target_properties(Magnum::GLContext PROPERTIES
INTERFACE_INCLUDE_DIRECTORIES $<TARGET_PROPERTY:${_MAGNUM_GLCONTEXT_ALIAS},INTERFACE_INCLUDE_DIRECTORIES>
INTERFACE_COMPILE_DEFINITIONS $<TARGET_PROPERTY:${_MAGNUM_GLCONTEXT_ALIAS},INTERFACE_COMPILE_DEFINITIONS>
INTERFACE_COMPILE_OPTIONS $<TARGET_PROPERTY:${_MAGNUM_GLCONTEXT_ALIAS},INTERFACE_COMPILE_OPTIONS>
INTERFACE_LINK_LIBRARIES $<TARGET_PROPERTY:${_MAGNUM_GLCONTEXT_ALIAS},INTERFACE_LINK_LIBRARIES>
IMPORTED_CONFIGURATIONS "${_MAGNUM_GLCONTEXT_IMPORTED_CONFIGURATIONS}")
if(_MAGNUM_GLCONTEXT_IMPORTED_LOCATION_RELEASE)
set_target_properties(Magnum::GLContext PROPERTIES
IMPORTED_LOCATION_RELEASE ${_MAGNUM_GLCONTEXT_IMPORTED_LOCATION_RELEASE})
Expand Down
51 changes: 37 additions & 14 deletions src/cmake/FindMagnumIntegration.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -172,21 +172,44 @@ foreach(_component ${MagnumIntegration_FIND_COMPONENTS})

# Bullet integration library
if(_component STREQUAL Bullet)
find_package(Bullet)
set_property(TARGET MagnumIntegration::${_component} APPEND PROPERTY
INTERFACE_INCLUDE_DIRECTORIES ${BULLET_INCLUDE_DIRS})
# Need to handle special cases where both debug and release
# libraries are available (in form of debug;A;optimized;B in
# BULLET_LIBRARIES), thus appending them one by one
foreach(lib BULLET_DYNAMICS_LIBRARY BULLET_COLLISION_LIBRARY BULLET_MATH_LIBRARY BULLET_SOFTBODY_LIBRARY)
if(${lib}_DEBUG)
set_property(TARGET MagnumIntegration::${_component} APPEND PROPERTY
INTERFACE_LINK_LIBRARIES "$<$<NOT:$<CONFIG:Debug>>:${${lib}}>;$<$<CONFIG:Debug>:${${lib}_DEBUG}>")
else()
set_property(TARGET MagnumIntegration::${_component} APPEND PROPERTY
INTERFACE_LINK_LIBRARIES ${${lib}})
# On Emscripten, Bullet could be taken from ports. If that's the
# case, propagate proper compiler flag.
if(CORRADE_TARGET_EMSCRIPTEN)
find_file(_MAGNUMINTEGRATION_${_COMPONENT}_CONFIGURE_FILE configure.h
HINTS ${MAGNUMINTEGRATION_INCLUDE_DIR}/Magnum/${_component}Integration)
file(READ ${_MAGNUMINTEGRATION_${_COMPONENT}_CONFIGURE_FILE} _magnum${_component}IntegrationConfigure)
string(FIND "${_magnum${_component}IntegrationConfigure}" "#define MAGNUM_USE_EMSCRIPTEN_PORTS_BULLET" _magnum${_component}Integration_USE_EMSCRIPTEN_PORTS_BULLET)
if(NOT _magnum${_component}Integration_USE_EMSCRIPTEN_PORTS_BULLET EQUAL -1)
set(MAGNUM_USE_EMSCRIPTEN_PORTS_BULLET 1)
endif()
endforeach()
endif()

if(MAGNUM_USE_EMSCRIPTEN_PORTS_BULLET)
if(CMAKE_VERSION VERSION_LESS 3.13)
message(FATAL_ERROR "BulletIntegration was compiled against emscripten-ports version but linking to it requires CMake 3.13 at least")
endif()
set_property(TARGET MagnumIntegration::${_component} APPEND PROPERTY
INTERFACE_COMPILE_OPTIONS "SHELL:-s USE_BULLET=1")
set_property(TARGET MagnumIntegration::${_component} APPEND PROPERTY
INTERFACE_LINK_OPTIONS "SHELL:-s USE_BULLET=1")
else()
find_package(Bullet)

set_property(TARGET MagnumIntegration::${_component} APPEND PROPERTY
INTERFACE_INCLUDE_DIRECTORIES ${BULLET_INCLUDE_DIRS})
# Need to handle special cases where both debug and release
# libraries are available (in form of debug;A;optimized;B in
# BULLET_LIBRARIES), thus appending them one by one
foreach(lib BULLET_DYNAMICS_LIBRARY BULLET_COLLISION_LIBRARY BULLET_MATH_LIBRARY BULLET_SOFTBODY_LIBRARY)
if(${lib}_DEBUG)
set_property(TARGET MagnumIntegration::${_component} APPEND PROPERTY
INTERFACE_LINK_LIBRARIES "$<$<NOT:$<CONFIG:Debug>>:${${lib}}>;$<$<CONFIG:Debug>:${${lib}_DEBUG}>")
else()
set_property(TARGET MagnumIntegration::${_component} APPEND PROPERTY
INTERFACE_LINK_LIBRARIES ${${lib}})
endif()
endforeach()
endif()

set(_MAGNUMINTEGRATION_${_COMPONENT}_INCLUDE_PATH_NAMES MotionState.h)

Expand Down
Loading