fix Cmake build files (CMakeList.txt) so it works with Cmake 2.4 again (only INSTALL feature requires Cmake 2.6)

This commit is contained in:
erwin.coumans 2008-11-05 02:34:01 +00:00
parent 8e0ee0ad74
commit f964c2f644
5 changed files with 25 additions and 9 deletions

View File

@ -180,10 +180,15 @@ SET(LibBulletCollision_HDRS
#ADD_LIBRARY(LibBulletCollision SHARED ${LibBulletCollision_SRCS} ${LibBulletCollision_HDRS})
#TARGET_LINK_LIBRARIES(LibBulletCollision LibLinearMath)
ADD_LIBRARY(LibBulletCollision ${LibBulletCollision_SRCS} ${LibBulletCollision_HDRS})
INSTALL(TARGETS LibBulletCollision DESTINATION lib)
INSTALL(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} DESTINATION include FILES_MATCHING PATTERN "*.h")
#INSTALL of other files requires CMake 2.6
IF (${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION} GREATER 2.6)
#INSTALL_TARGETS(DESTINATION LibBulletCollision)
#INSTALL(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} DESTINATION include ${LibBulletCollision_HDRS})
ENDIF (${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION} GREATER 2.6)

View File

@ -44,6 +44,7 @@ SET(LibBulletDynamics_HDRS
ADD_LIBRARY(LibBulletDynamics ${LibBulletDynamics_SRCS} ${LibBulletDynamics_HDRS})
INSTALL(TARGETS LibBulletDynamics DESTINATION lib)
INSTALL(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} DESTINATION include FILES_MATCHING PATTERN "*.h")
IF (${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION} GREATER 2.6)
#INSTALL(TARGETS LibBulletDynamics DESTINATION lib)
#INSTALL(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} DESTINATION include FILES_MATCHING PATTERN "*.h")
ENDIF (${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION} GREATER 2.6)

View File

@ -24,9 +24,11 @@ SET(LibBulletSoftBody_HDRS
)
#ADD_LIBRARY(LibBulletSoftBody SHARED ${LibBulletSoftBody_SRCS} ${LibBulletSoftBody_HDRS})
ADD_LIBRARY(LibBulletSoftBody ${LibBulletSoftBody_SRCS} ${LibBulletSoftBody_HDRS})
INSTALL(TARGETS LibBulletSoftBody DESTINATION lib)
INSTALL(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} DESTINATION include FILES_MATCHING PATTERN "*.h")
IF (${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION} GREATER 2.6)
INSTALL(TARGETS LibBulletSoftBody DESTINATION lib)
INSTALL(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} DESTINATION include ${LibBulletSoftBody_HDRS})
ENDIF (${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION} GREATER 2.6)

View File

@ -4,4 +4,8 @@ else (CMAKE_SIZEOF_VOID_P MATCHES "8")
SUBDIRS( BulletMultiThreaded BulletSoftBody BulletCollision BulletDynamics LinearMath )
endif (CMAKE_SIZEOF_VOID_P MATCHES "8")
INSTALL(FILES btBulletCollisionCommon.h btBulletDynamicsCommon.h Bullet-C-Api.h DESTINATION include)
#INSTALL of other files requires CMake 2.6^M
IF (${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION} GREATER 2.6)
INSTALL(FILES btBulletCollisionCommon.h btBulletDynamicsCommon.h Bullet-C-Api.h DESTINATION include)
ENDIF (${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION} GREATER 2.6)

View File

@ -38,5 +38,9 @@ SET(LibLinearMath_HDRS
# ADD_LIBRARY(LibLinearMath SHARED ${LibLinearMath_SRCS} ${LibLinearMath_HDRS})
ADD_LIBRARY(LibLinearMath ${LibLinearMath_SRCS} ${LibLinearMath_HDRS})
#FILES_MATCHING requires CMake 2.6
IF (${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION} GREATER 2.6)
INSTALL(TARGETS LibLinearMath DESTINATION lib)
INSTALL(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} DESTINATION include FILES_MATCHING PATTERN "*.h")
ENDIF (${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION} GREATER 2.6)