rbdl / CMakeLists.txt

PROJECT (RBDL)

CMAKE_MINIMUM_REQUIRED(VERSION 2.6)

LIST( APPEND CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/CMake )

FIND_PACKAGE (GINAC REQUIRED)

INCLUDE_DIRECTORIES ( 
	${CMAKE_CURRENT_BINARY_DIR}/include/rbdl
	src/
	include/rbdl
	${GINAC_INCLUDE_DIR}
)

SET_TARGET_PROPERTIES ( ${PROJECT_EXECUTABLES} PROPERTIES
		LINKER_LANGUAGE CXX
	)

# Perform the proper linking
SET (CMAKE_SKIP_BUILD_RPATH FALSE)
SET (CMAKE_BUILD_WITH_INSTALL_RPATH FALSE)
SET (CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/lib")
SET (CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)

# Options
OPTION (BUILD_STATIC "Build the statically linked library" OFF)
OPTION (BUILD_GUI "Build the (rudimentary) graphical user interface" OFF)
OPTION (BUILD_TESTS "Build the test executables" OFF)
OPTION (RBDL_ENABLE_LOGGING "Enable logging (warning: major impact on performance!)" OFF)
OPTION (RBDL_USE_SIMPLE_MATH "Use slow math instead of the fast Eigen3 library (faster compilation)" OFF)
OPTION (RBDL_USE_GINAC "Use GiNaC to use symbolic computation (horribly
slow!)" OFF)

SET ( RBDL_SOURCES 
	src/mathutils.cc
	src/Logging.cc
	src/Body.cc
	src/Joint.cc
	src/Model.cc
	src/Kinematics.cc
	src/Dynamics.cc
	)

ADD_LIBRARY ( rbdl SHARED ${RBDL_SOURCES} )

TARGET_LINK_LIBRARIES ( rbdl
     ${GINAC_LIBRARIES}
)

IF (BUILD_STATIC)
  ADD_LIBRARY ( rbdl-static STATIC ${RBDL_SOURCES} )
  SET_TARGET_PROPERTIES ( rbdl-static PROPERTIES PREFIX "lib")
  SET_TARGET_PROPERTIES ( rbdl-static PROPERTIES OUTPUT_NAME "rbdl")

	INSTALL (TARGETS rbdl-static
	  LIBRARY DESTINATION lib
  	ARCHIVE DESTINATION lib
	)
ENDIF (BUILD_STATIC)

IF (BUILD_TESTS)
  ADD_SUBDIRECTORY ( tests )
ENDIF (BUILD_TESTS)

IF (BUILD_GUI)
  ADD_SUBDIRECTORY ( gui )
ENDIF (BUILD_GUI)

# Installing
INSTALL (TARGETS rbdl
	LIBRARY DESTINATION lib
	ARCHIVE DESTINATION lib
	)

CONFIGURE_FILE (
	"${CMAKE_CURRENT_SOURCE_DIR}/src/rbdlconfig.h.cmake" 
	"${CMAKE_CURRENT_BINARY_DIR}/include/rbdl/rbdlconfig.h"
	)

FILE ( GLOB headers 
	"${CMAKE_CURRENT_SOURCE_DIR}/src/*.h"
	"${CMAKE_CURRENT_BINARY_DIR}/include/rbdl/rbdlconfig.h"
	)

INSTALL ( FILES ${headers} DESTINATION include/rbdl )

IF (NOT RBDL_USE_SIMPLE_MATH)
	INSTALL ( DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/src/Eigen"
		DESTINATION include/rbdl
	)
ENDIF (NOT RBDL_USE_SIMPLE_MATH)
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.