Skip to content

Commit

Permalink
FindBullet: separate win32 optimized and debug libraries (#1395)
Browse files Browse the repository at this point in the history
* FindBullet: separate WIN32 debug/optimized libs

* azure: vcpkg install bullet3 ode

* use VCPKG_OPTIONAL_PACKAGES
  • Loading branch information
scpeters authored and jslee02 committed Aug 16, 2019
1 parent 1ea5a66 commit 6b023c2
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
3 changes: 2 additions & 1 deletion .azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,7 @@ jobs:
VCPKG_INSTALL_ROOT: $(Build.SourcesDirectory)\vcpkg
VCPKG_ARCH: 'x64-windows'
VCPKG_PACKAGES: 'assimp boost-system boost-filesystem ccd eigen3 fcl'
VCPKG_OPTIONAL_PACKAGES: 'bullet3 ode'
BUILD_TOOLSET_VERSION: '142'
CMAKE_GENERATOR: 'Visual Studio 16 2019'
steps:
Expand All @@ -151,7 +152,7 @@ jobs:
$(VCPKG_INSTALL_ROOT)\bootstrap-vcpkg.bat
displayName: 'Install vcpkg'
- script: |
$(VCPKG_INSTALL_ROOT)\vcpkg.exe install --recurse --triplet $(VCPKG_ARCH) $(VCPKG_PACKAGES)
$(VCPKG_INSTALL_ROOT)\vcpkg.exe install --recurse --triplet $(VCPKG_ARCH) $(VCPKG_PACKAGES) $(VCPKG_OPTIONAL_PACKAGES)
$(VCPKG_INSTALL_ROOT)\vcpkg.exe integrate install
displayName: 'Install dependencies'
- script: |
Expand Down
12 changes: 11 additions & 1 deletion cmake/DARTFindBullet.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,19 @@
find_package(Bullet COMPONENTS BulletMath BulletCollision MODULE QUIET)

if((BULLET_FOUND OR Bullet_FOUND) AND NOT TARGET Bullet)
if(WIN32 AND "optimized" IN_LIST BULLET_LIBRARIES
AND "debug" IN_LIST BULLET_LIBRARIES)
cmake_parse_arguments(BULLET_INTERFACE_LIBRARIES "" "" "debug;optimized"
${BULLET_LIBRARIES})
set(BULLET_INTERFACE_LIBRARIES
$<$<CONFIG:Debug>:${BULLET_INTERFACE_LIBRARIES_debug}>
$<$<NOT:$<CONFIG:Debug>>:${BULLET_INTERFACE_LIBRARIES_optimized}>)
else()
set(BULLET_INTERFACE_LIBRARIES ${BULLET_LIBRARIES})
endif()
add_library(Bullet INTERFACE IMPORTED)
set_target_properties(Bullet PROPERTIES
INTERFACE_INCLUDE_DIRECTORIES "${BULLET_INCLUDE_DIRS}"
INTERFACE_LINK_LIBRARIES "${BULLET_LIBRARIES}"
INTERFACE_LINK_LIBRARIES "${BULLET_INTERFACE_LIBRARIES}"
)
endif()

0 comments on commit 6b023c2

Please sign in to comment.