Skip to content

Commit

Permalink
Revert "Export targets in CMake and add include directories to target…
Browse files Browse the repository at this point in the history
… properties"
  • Loading branch information
erwincoumans authored Sep 11, 2017
1 parent 7fd29ac commit 6f51d81
Show file tree
Hide file tree
Showing 22 changed files with 192 additions and 241 deletions.
16 changes: 6 additions & 10 deletions BulletConfig.cmake.in
Original file line number Diff line number Diff line change
Expand Up @@ -14,16 +14,12 @@
# BULLET_ROOT_DIR - The base directory of Bullet
# BULLET_VERSION_STRING - A human-readable string containing the version

@PACKAGE_INIT@

include("${CMAKE_CURRENT_LIST_DIR}/BulletExport.cmake")

set ( BULLET_FOUND 1 )
set ( BULLET_USE_FILE "${PACKAGE_PREFIX_DIR}/@BULLET_USE_FILE@" )
set ( BULLET_USE_FILE "@BULLET_USE_FILE@" )
set ( BULLET_DEFINITIONS "@BULLET_DEFINITIONS@" )
set ( BULLET_INCLUDE_DIR "${PACKAGE_PREFIX_DIR}/@INCLUDE_INSTALL_DIR@" )
set ( BULLET_INCLUDE_DIRS "${PACKAGE_PREFIX_DIR}/@INCLUDE_INSTALL_DIR@" )
set ( BULLET_INCLUDE_DIR "@INCLUDE_INSTALL_DIR@" )
set ( BULLET_INCLUDE_DIRS "@INCLUDE_INSTALL_DIR@" )
set ( BULLET_LIBRARIES "@BULLET_LIBRARIES@" )
set ( BULLET_LIBRARY_DIRS "${PACKAGE_PREFIX_DIR}/@LIB_DESTINATION@" )
set ( BULLET_ROOT_DIR "${PACKAGE_PREFIX_DIR}" )
set ( BULLET_VERSION_STRING "@BULLET_VERSION@" )
set ( BULLET_LIBRARY_DIRS "@LIB_DESTINATION@" )
set ( BULLET_ROOT_DIR "@CMAKE_INSTALL_PREFIX@" )
set ( BULLET_VERSION_STRING "@BULLET_VERSION@" )
57 changes: 20 additions & 37 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
cmake_minimum_required(VERSION 2.8.11)
cmake_minimum_required(VERSION 2.4.3)
set(CMAKE_ALLOW_LOOSE_LOOP_CONSTRUCTS true)
cmake_policy(SET CMP0017 NEW)
#this line has to appear before 'PROJECT' in order to be able to disable incremental linking
Expand All @@ -15,9 +15,6 @@ IF(COMMAND cmake_policy)
endif(POLICY CMP0042)
ENDIF(COMMAND cmake_policy)

include(CMakePackageConfigHelpers)
include(GNUInstallDirs)

IF (NOT CMAKE_BUILD_TYPE)
# SET(CMAKE_BUILD_TYPE "Debug")
SET(CMAKE_BUILD_TYPE "Release")
Expand Down Expand Up @@ -433,10 +430,11 @@ IF(INSTALL_LIBS)
ENDIF (${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION} GREATER 2.5)
ENDIF(BUILD_EXTRAS)

SET (LIB_DESTINATION "${CMAKE_INSTALL_LIBDIR}" CACHE STRING "Library directory name")
SET (LIB_SUFFIX "" CACHE STRING "Define suffix of directory name (32/64)" )
SET (LIB_DESTINATION "lib${LIB_SUFFIX}" CACHE STRING "Library directory name")
## the following are directories where stuff will be installed to
SET(INCLUDE_INSTALL_DIR "${CMAKE_INSTALL_INCLUDEDIR}/bullet/" CACHE PATH "The subdirectory to the header prefix")
SET(PKGCONFIG_INSTALL_PREFIX "${CMAKE_INSTALL_LIBDIR}/pkgconfig/" CACHE STRING "Base directory for pkgconfig files")
SET(INCLUDE_INSTALL_DIR "include/bullet/" CACHE PATH "The subdirectory to the header prefix")
SET(PKGCONFIG_INSTALL_PREFIX "lib${LIB_SUFFIX}/pkgconfig/" CACHE STRING "Base directory for pkgconfig files")
IF(NOT MSVC)
CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/bullet.pc.cmake ${CMAKE_CURRENT_BINARY_DIR}/bullet.pc @ONLY)
INSTALL(
Expand All @@ -455,34 +453,19 @@ IF (BUILD_UNIT_TESTS)
SUBDIRS(test)
ENDIF()

set (BULLET_CONFIG_CMAKE_PATH ${CMAKE_INSTALL_LIBDIR}/cmake/bullet-${BULLET_VERSION})
list (APPEND BULLET_LIBRARIES Bullet::LinearMath)
list (APPEND BULLET_LIBRARIES Bullet::Bullet3Common)
list (APPEND BULLET_LIBRARIES Bullet::BulletInverseDynamics)
list (APPEND BULLET_LIBRARIES Bullet::BulletCollision)
list (APPEND BULLET_LIBRARIES Bullet::BulletDynamics)
list (APPEND BULLET_LIBRARIES Bullet::BulletSoftBody)
set (BULLET_CONFIG_CMAKE_PATH lib${LIB_SUFFIX}/cmake/bullet )
list (APPEND BULLET_LIBRARIES LinearMath)
list (APPEND BULLET_LIBRARIES Bullet3Common)
list (APPEND BULLET_LIBRARIES BulletInverseDynamics)
list (APPEND BULLET_LIBRARIES BulletCollision)
list (APPEND BULLET_LIBRARIES BulletDynamics)
list (APPEND BULLET_LIBRARIES BulletSoftBody)
set (BULLET_USE_FILE ${BULLET_CONFIG_CMAKE_PATH}/UseBullet.cmake)
configure_package_config_file(
${CMAKE_CURRENT_SOURCE_DIR}/BulletConfig.cmake.in ${CMAKE_CURRENT_BINARY_DIR}/BulletConfig.cmake
INSTALL_DESTINATION ${BULLET_CONFIG_CMAKE_PATH}
)
install(
FILES ${CMAKE_CURRENT_SOURCE_DIR}/UseBullet.cmake ${CMAKE_CURRENT_BINARY_DIR}/BulletConfig.cmake
DESTINATION ${BULLET_CONFIG_CMAKE_PATH}
)
write_basic_package_version_file(
${CMAKE_CURRENT_BINARY_DIR}/BulletConfigVersion.cmake
VERSION ${BULLET_VERSION}
COMPATIBILITY ExactVersion
)
install(
FILES ${CMAKE_CURRENT_BINARY_DIR}/BulletConfigVersion.cmake
DESTINATION ${BULLET_CONFIG_CMAKE_PATH}
)
install(
EXPORT Bullet
DESTINATION ${BULLET_CONFIG_CMAKE_PATH}
NAMESPACE Bullet::
FILE BulletExport.cmake
)
configure_file ( ${CMAKE_CURRENT_SOURCE_DIR}/BulletConfig.cmake.in
${CMAKE_CURRENT_BINARY_DIR}/BulletConfig.cmake
@ONLY ESCAPE_QUOTES
)
install ( FILES ${CMAKE_CURRENT_SOURCE_DIR}/UseBullet.cmake
${CMAKE_CURRENT_BINARY_DIR}/BulletConfig.cmake
DESTINATION ${BULLET_CONFIG_CMAKE_PATH}
)
23 changes: 11 additions & 12 deletions Extras/BulletRobotics/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@

INCLUDE_DIRECTORIES(
${BULLET_PHYSICS_SOURCE_DIR}/src
${BULLET_PHYSICS_SOURCE_DIR}/examples
${BULLET_PHYSICS_SOURCE_DIR}/examples/ThirdPartyLibs
${BULLET_PHYSICS_SOURCE_DIR}/examples/ThirdPartyLibs/enet/include
${BULLET_PHYSICS_SOURCE_DIR}/examples/ThirdPartyLibs/clsocket/src
)

SET(BulletRobotics_SRCS
../../examples/SharedMemory/IKTrajectoryHelper.cpp
../../examples/SharedMemory/IKTrajectoryHelper.h
Expand Down Expand Up @@ -149,15 +158,6 @@ ADD_LIBRARY(BulletRobotics ${BulletRobotics_SRCS})
SET_TARGET_PROPERTIES(BulletRobotics PROPERTIES VERSION ${BULLET_VERSION})
SET_TARGET_PROPERTIES(BulletRobotics PROPERTIES SOVERSION ${BULLET_VERSION})

target_include_directories(BulletRobotics PUBLIC
$<BUILD_INTERFACE:${BULLET_PHYSICS_SOURCE_DIR}/src>
$<BUILD_INTERFACE:${BULLET_PHYSICS_SOURCE_DIR}/examples>
$<BUILD_INTERFACE:${BULLET_PHYSICS_SOURCE_DIR}/examples/ThirdPartyLibs>
$<BUILD_INTERFACE:${BULLET_PHYSICS_SOURCE_DIR}/examples/ThirdPartyLibs/enet/include>
$<BUILD_INTERFACE:${BULLET_PHYSICS_SOURCE_DIR}/examples/ThirdPartyLibs/clsocket/src>
$<INSTALL_INTERFACE:$<INSTALL_PREFIX>/${INCLUDE_INSTALL_DIR}>
)

IF (BUILD_SHARED_LIBS)
TARGET_LINK_LIBRARIES(BulletRobotics BulletInverseDynamicsUtils BulletWorldImporter BulletFileLoader BulletSoftBody BulletDynamics BulletCollision BulletInverseDynamics LinearMath Bullet3Common)
ENDIF (BUILD_SHARED_LIBS)
Expand All @@ -176,9 +176,8 @@ IF (INSTALL_EXTRA_LIBS)
)
INSTALL(TARGETS
BulletRobotics
EXPORT Bullet
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
LIBRARY DESTINATION lib${LIB_SUFFIX}
ARCHIVE DESTINATION lib${LIB_SUFFIX}
)

IF (APPLE AND BUILD_SHARED_LIBS AND FRAMEWORK)
Expand Down
20 changes: 8 additions & 12 deletions Extras/ConvexDecomposition/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
INCLUDE_DIRECTORIES(
${BULLET_PHYSICS_SOURCE_DIR}/Extras/ConvexDecomposition ${BULLET_PHYSICS_SOURCE_DIR}/src
)

SET(ConvexDecomposition_SRCS
bestfitobb.cpp
ConvexBuilder.cpp
Expand Down Expand Up @@ -34,13 +38,6 @@ ADD_LIBRARY(ConvexDecomposition ${ConvexDecomposition_SRCS} ${ConvexDecompositio
SET_TARGET_PROPERTIES(ConvexDecomposition PROPERTIES VERSION ${BULLET_VERSION})
SET_TARGET_PROPERTIES(ConvexDecomposition PROPERTIES SOVERSION ${BULLET_VERSION})

target_include_directories(ConvexDecomposition PUBLIC
$<BUILD_INTERFACE:${BULLET_PHYSICS_SOURCE_DIR}/Extras/ConvexDecomposition>
$<BUILD_INTERFACE:${BULLET_PHYSICS_SOURCE_DIR}/src>
$<INSTALL_INTERFACE:$<INSTALL_PREFIX>/${INCLUDE_INSTALL_DIR}/ConvexDecomposition>
$<INSTALL_INTERFACE:$<INSTALL_PREFIX>/${INCLUDE_INSTALL_DIR}>
)

IF (BUILD_SHARED_LIBS)
TARGET_LINK_LIBRARIES(ConvexDecomposition BulletCollision LinearMath)
ENDIF (BUILD_SHARED_LIBS)
Expand All @@ -50,13 +47,12 @@ IF (INSTALL_EXTRA_LIBS)
#FILES_MATCHING requires CMake 2.6
IF (${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION} GREATER 2.5)
IF (APPLE AND BUILD_SHARED_LIBS AND FRAMEWORK)
INSTALL(TARGETS ConvexDecomposition EXPORT Bullet DESTINATION .)
INSTALL(TARGETS ConvexDecomposition DESTINATION .)
ELSE (APPLE AND BUILD_SHARED_LIBS AND FRAMEWORK)
INSTALL(TARGETS ConvexDecomposition
EXPORT Bullet
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR})
RUNTIME DESTINATION bin
LIBRARY DESTINATION lib${LIB_SUFFIX}
ARCHIVE DESTINATION lib${LIB_SUFFIX})
INSTALL(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
DESTINATION ${INCLUDE_INSTALL_DIR} FILES_MATCHING PATTERN "*.h" PATTERN
".svn" EXCLUDE PATTERN "CMakeFiles" EXCLUDE)
Expand Down
25 changes: 11 additions & 14 deletions Extras/GIMPACTUtils/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,18 +1,16 @@
INCLUDE_DIRECTORIES(
${BULLET_PHYSICS_SOURCE_DIR}/Extras/GIMPACT/include
${BULLET_PHYSICS_SOURCE_DIR}/src
${BULLET_PHYSICS_SOURCE_DIR}/Extras/GIMPACTUtils
${BULLET_PHYSICS_SOURCE_DIR}/Extras/ConvexDecomposition
)

ADD_LIBRARY(GIMPACTUtils
btGImpactConvexDecompositionShape.cpp btGImpactConvexDecompositionShape.h
)
SET_TARGET_PROPERTIES(GIMPACTUtils PROPERTIES VERSION ${BULLET_VERSION})
SET_TARGET_PROPERTIES(GIMPACTUtils PROPERTIES SOVERSION ${BULLET_VERSION})

target_include_directories(GIMPACTUtils PUBLIC
$<BUILD_INTERFACE:${BULLET_PHYSICS_SOURCE_DIR}/Extras/GIMPACT/include>
$<BUILD_INTERFACE:${BULLET_PHYSICS_SOURCE_DIR}/src>
$<BUILD_INTERFACE:${BULLET_PHYSICS_SOURCE_DIR}/Extras/GIMPACTUtils>
$<BUILD_INTERFACE:${BULLET_PHYSICS_SOURCE_DIR}/Extras/ConvexDecomposition>
$<INSTALL_INTERFACE:$<INSTALL_PREFIX>/${INCLUDE_INSTALL_DIR}>
$<INSTALL_INTERFACE:$<INSTALL_PREFIX>/${INCLUDE_INSTALL_DIR}/GIMPACTUtils>
)

IF (BUILD_SHARED_LIBS)
TARGET_LINK_LIBRARIES(GIMPACTUtils ConvexDecomposition BulletCollision)
ENDIF (BUILD_SHARED_LIBS)
Expand All @@ -22,13 +20,12 @@ IF (INSTALL_EXTRA_LIBS)
#FILES_MATCHING requires CMake 2.6
IF (${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION} GREATER 2.5)
IF (APPLE AND BUILD_SHARED_LIBS AND FRAMEWORK)
INSTALL(TARGETS GIMPACTUtils EXPORT Bullet DESTINATION .)
INSTALL(TARGETS GIMPACTUtils DESTINATION .)
ELSE (APPLE AND BUILD_SHARED_LIBS AND FRAMEWORK)
INSTALL(TARGETS GIMPACTUtils
EXPORT Bullet
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR})
RUNTIME DESTINATION bin
LIBRARY DESTINATION lib${LIB_SUFFIX}
ARCHIVE DESTINATION lib${LIB_SUFFIX})
INSTALL(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
DESTINATION ${INCLUDE_INSTALL_DIR} FILES_MATCHING PATTERN "*.h" PATTERN
".svn" EXCLUDE PATTERN "CMakeFiles" EXCLUDE)
Expand Down
18 changes: 8 additions & 10 deletions Extras/HACD/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
INCLUDE_DIRECTORIES(
${BULLET_PHYSICS_SOURCE_DIR}/Extras/HACD
)

SET(HACD_SRCS
hacdGraph.cpp
hacdHACD.cpp
Expand All @@ -21,11 +25,6 @@ ADD_LIBRARY(HACD ${HACD_SRCS} ${HACD_HDRS})
SET_TARGET_PROPERTIES(HACD PROPERTIES VERSION ${BULLET_VERSION})
SET_TARGET_PROPERTIES(HACD PROPERTIES SOVERSION ${BULLET_VERSION})

target_include_directories(HACD PUBLIC
$<BUILD_INTERFACE:${BULLET_PHYSICS_SOURCE_DIR}/Extras/HACD>
$<INSTALL_INTERFACE:$<INSTALL_PREFIX>/${INCLUDE_INSTALL_DIR}/HACD>
)

#IF (BUILD_SHARED_LIBS)
# TARGET_LINK_LIBRARIES(HACD BulletCollision LinearMath)
#ENDIF (BUILD_SHARED_LIBS)
Expand All @@ -35,13 +34,12 @@ IF (INSTALL_EXTRA_LIBS)
#FILES_MATCHING requires CMake 2.6
IF (${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION} GREATER 2.5)
IF (APPLE AND BUILD_SHARED_LIBS AND FRAMEWORK)
INSTALL(TARGETS HACD EXPORT Bullet DESTINATION .)
INSTALL(TARGETS HACD DESTINATION .)
ELSE (APPLE AND BUILD_SHARED_LIBS AND FRAMEWORK)
INSTALL(TARGETS HACD
EXPORT Bullet
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR})
RUNTIME DESTINATION bin
LIBRARY DESTINATION lib${LIB_SUFFIX}
ARCHIVE DESTINATION lib${LIB_SUFFIX})

INSTALL(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
DESTINATION ${INCLUDE_INSTALL_DIR} FILES_MATCHING PATTERN "*.h" PATTERN "*.inl" PATTERN
Expand Down
19 changes: 8 additions & 11 deletions Extras/InverseDynamics/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
INCLUDE_DIRECTORIES(
${BULLET_PHYSICS_SOURCE_DIR}/src
)

ADD_LIBRARY(
BulletInverseDynamicsUtils
CloneTreeCreator.cpp
Expand All @@ -17,12 +21,6 @@ User2InternalIndex.cpp
SET_TARGET_PROPERTIES(BulletInverseDynamicsUtils PROPERTIES VERSION ${BULLET_VERSION})
SET_TARGET_PROPERTIES(BulletInverseDynamicsUtils PROPERTIES SOVERSION ${BULLET_VERSION})

target_include_directories(BulletInverseDynamicsUtils PUBLIC
$<BUILD_INTERFACE:${BULLET_PHYSICS_SOURCE_DIR}/src>
$<INSTALL_INTERFACE:$<INSTALL_PREFIX>/${INCLUDE_INSTALL_DIR}/InverseDynamics>
$<INSTALL_INTERFACE:$<INSTALL_PREFIX>/${INCLUDE_INSTALL_DIR}>
)

IF (BUILD_SHARED_LIBS)
TARGET_LINK_LIBRARIES(BulletInverseDynamicsUtils BulletInverseDynamics BulletDynamics BulletCollision Bullet3Common LinearMath)
ENDIF (BUILD_SHARED_LIBS)
Expand All @@ -32,13 +30,12 @@ IF (INSTALL_EXTRA_LIBS)
#FILES_MATCHING requires CMake 2.6
IF (${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION} GREATER 2.5)
IF (APPLE AND BUILD_SHARED_LIBS AND FRAMEWORK)
INSTALL(TARGETS BulletInverseDynamicsUtils EXPORT Bullet DESTINATION .)
INSTALL(TARGETS BulletInverseDynamicsUtils DESTINATION .)
ELSE (APPLE AND BUILD_SHARED_LIBS AND FRAMEWORK)
INSTALL(TARGETS BulletInverseDynamicsUtils
EXPORT Bullet
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR})
RUNTIME DESTINATION bin
LIBRARY DESTINATION lib${LIB_SUFFIX}
ARCHIVE DESTINATION lib${LIB_SUFFIX})
INSTALL(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
DESTINATION ${INCLUDE_INSTALL_DIR} FILES_MATCHING PATTERN "*.h" PATTERN
".svn" EXCLUDE PATTERN "CMakeFiles" EXCLUDE)
Expand Down
18 changes: 8 additions & 10 deletions Extras/Serialize/BulletFileLoader/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
INCLUDE_DIRECTORIES(
${BULLET_PHYSICS_SOURCE_DIR}/src
)

SET(BulletFileLoader_SRCS
bChunk.cpp
bDNA.cpp
Expand All @@ -16,11 +20,6 @@ btBulletFile.h

ADD_LIBRARY(BulletFileLoader ${BulletFileLoader_SRCS} ${BulletFileLoader_HDRS})

target_include_directories(BulletFileLoader PUBLIC
$<BUILD_INTERFACE:${BULLET_PHYSICS_SOURCE_DIR}/src>
$<INSTALL_INTERFACE:$<INSTALL_PREFIX>/${INCLUDE_INSTALL_DIR}>
)

IF (BUILD_SHARED_LIBS)
TARGET_LINK_LIBRARIES(BulletFileLoader LinearMath)
ENDIF (BUILD_SHARED_LIBS)
Expand All @@ -33,13 +32,12 @@ IF (INSTALL_EXTRA_LIBS)
#FILES_MATCHING requires CMake 2.6
IF (${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION} GREATER 2.5)
IF (APPLE AND BUILD_SHARED_LIBS AND FRAMEWORK)
INSTALL(TARGETS BulletFileLoader EXPORT Bullet DESTINATION .)
INSTALL(TARGETS BulletFileLoader DESTINATION .)
ELSE (APPLE AND BUILD_SHARED_LIBS AND FRAMEWORK)
INSTALL(TARGETS BulletFileLoader
EXPORT Bullet
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR})
RUNTIME DESTINATION bin
LIBRARY DESTINATION lib${LIB_SUFFIX}
ARCHIVE DESTINATION lib${LIB_SUFFIX})
INSTALL(
DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
DESTINATION ${INCLUDE_INSTALL_DIR} FILES_MATCHING PATTERN "*.h" PATTERN
Expand Down
21 changes: 9 additions & 12 deletions Extras/Serialize/BulletWorldImporter/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
INCLUDE_DIRECTORIES(
${BULLET_PHYSICS_SOURCE_DIR}/src
${BULLET_PHYSICS_SOURCE_DIR}/Extras/Serialize/BulletFileLoader
)

ADD_LIBRARY(
BulletWorldImporter
btBulletWorldImporter.cpp
Expand All @@ -9,13 +14,6 @@ btWorldImporter.h
SET_TARGET_PROPERTIES(BulletWorldImporter PROPERTIES VERSION ${BULLET_VERSION})
SET_TARGET_PROPERTIES(BulletWorldImporter PROPERTIES SOVERSION ${BULLET_VERSION})

target_include_directories(BulletWorldImporter PUBLIC
$<BUILD_INTERFACE:${BULLET_PHYSICS_SOURCE_DIR}/src>
$<BUILD_INTERFACE:${BULLET_PHYSICS_SOURCE_DIR}/Extras/Serialize/BulletFileLoader>
$<INSTALL_INTERFACE:$<INSTALL_PREFIX>/${INCLUDE_INSTALL_DIR}>
$<INSTALL_INTERFACE:$<INSTALL_PREFIX>/${INCLUDE_INSTALL_DIR}/BulletFileLoader>
)

IF (BUILD_SHARED_LIBS)
TARGET_LINK_LIBRARIES(BulletWorldImporter BulletDynamics BulletCollision BulletFileLoader LinearMath)
ENDIF (BUILD_SHARED_LIBS)
Expand All @@ -25,13 +23,12 @@ IF (INSTALL_EXTRA_LIBS)
#FILES_MATCHING requires CMake 2.6
IF (${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION} GREATER 2.5)
IF (APPLE AND BUILD_SHARED_LIBS AND FRAMEWORK)
INSTALL(TARGETS BulletWorldImporter EXPORT Bullet DESTINATION .)
INSTALL(TARGETS BulletWorldImporter DESTINATION .)
ELSE (APPLE AND BUILD_SHARED_LIBS AND FRAMEWORK)
INSTALL(TARGETS BulletWorldImporter
EXPORT Bullet
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR})
RUNTIME DESTINATION bin
LIBRARY DESTINATION lib${LIB_SUFFIX}
ARCHIVE DESTINATION lib${LIB_SUFFIX})
INSTALL(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
DESTINATION ${INCLUDE_INSTALL_DIR} FILES_MATCHING PATTERN "*.h" PATTERN
".svn" EXCLUDE PATTERN "CMakeFiles" EXCLUDE)
Expand Down
Loading

0 comments on commit 6f51d81

Please sign in to comment.