From 6b023c2994294d6eb1b95e2242e39ba7e9f02427 Mon Sep 17 00:00:00 2001 From: Steven Peters Date: Fri, 16 Aug 2019 11:05:33 -0700 Subject: [PATCH] FindBullet: separate win32 optimized and debug libraries (#1395) * FindBullet: separate WIN32 debug/optimized libs * azure: vcpkg install bullet3 ode * use VCPKG_OPTIONAL_PACKAGES --- .azure-pipelines.yml | 3 ++- cmake/DARTFindBullet.cmake | 12 +++++++++++- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/.azure-pipelines.yml b/.azure-pipelines.yml index cdf8ddd6c4f14..303eb180c7361 100644 --- a/.azure-pipelines.yml +++ b/.azure-pipelines.yml @@ -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: @@ -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: | diff --git a/cmake/DARTFindBullet.cmake b/cmake/DARTFindBullet.cmake index e3946cf3b13f4..b99c32a3df9c9 100644 --- a/cmake/DARTFindBullet.cmake +++ b/cmake/DARTFindBullet.cmake @@ -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 + $<$:${BULLET_INTERFACE_LIBRARIES_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()