-
Notifications
You must be signed in to change notification settings - Fork 1
/
CMakeLists.txt
67 lines (49 loc) · 2.43 KB
/
CMakeLists.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
Project(OpenSimPlugin)
cmake_minimum_required(VERSION 2.6)
SET(UKIT PLUGIN)
FILE(GLOB SOURCE_FILES *.cpp)
FILE(GLOB INCLUDE_FILES *.h)
SET(EXPORT_MACRO OSIM${UKIT}_EXPORTS)
SET(OPENSIM_INSTALL_DIR $ENV{OPENSIM_HOME}
CACHE PATH "Top-level directory of OpenSim install")
SET(PLUGIN_NAME "osimPlugin" CACHE STRING "Name of shared library to create")
# To add Debug feature add ";Debug" after Release on the line below
SET(CMAKE_CONFIGURATION_TYPES "RelWithDebInfo;Release;Debug"
CACHE STRING "Semicolon separated list of supported configuration types, only supports Debug, Release, MinSizeRel, and RelWithDebInfo, anything else will be ignored." FORCE )
# Location of headers
SET(SIMTK_HEADERS_DIR ${OPENSIM_INSTALL_DIR}/sdk/include/SimTK/include)
SET(OPENSIM_HEADERS_DIR ${OPENSIM_INSTALL_DIR}/sdk/include)
INCLUDE_DIRECTORIES(${SIMTK_HEADERS_DIR} ${OPENSIM_HEADERS_DIR})
# Libraries and dlls
SET(OPENSIM_LIBS_DIR ${OPENSIM_INSTALL_DIR}/sdk/lib ${OPENSIM_INSTALL_DIR}/lib)
SET(OPENSIM_DLLS_DIR ${OPENSIM_INSTALL_DIR}/bin)
LINK_DIRECTORIES(${OPENSIM_LIBS_DIR} ${OPENSIM_DLLS_DIR})
# Namespace
SET(NameSpace "OpenSim_" CACHE STRING "Prefix for simtk lib names, includes trailing '_'. Leave empty to use stock SimTK libraries.")
MARK_AS_ADVANCED(NameSpace)
SET(SIMTK_COMMON_LIB debug ${NameSpace}SimTKcommon_d optimized ${NameSpace}SimTKcommon)
SET(SIMTK_MATH_LIB debug ${NameSpace}SimTKmath_d optimized ${NameSpace}SimTKmath)
SET(SIMTK_SIMBODY_LIB debug ${NameSpace}SimTKsimbody_d optimized ${NameSpace}SimTKsimbody)
SET(SIMTK_ALL_LIBS ${SIMTK_COMMON_LIB}
${SIMTK_MATH_LIB}
${SIMTK_SIMBODY_LIB})
LINK_LIBRARIES(
debug osimSimulation_d optimized osimSimulation
debug osimActuators_d optimized osimActuators
debug osimCommon_d optimized osimCommon
debug osimAnalyses_d optimized osimAnalyses
debug osimTools_d optimized osimTools
${SIMTK_ALL_LIBS}
)
ADD_LIBRARY(${PLUGIN_NAME} SHARED ${SOURCE_FILES} ${INCLUDE_FILES})
MARK_AS_ADVANCED(EXECUTABLE_OUTPUT_PATH)
MARK_AS_ADVANCED(LIBRARY_OUTPUT_PATH)
IF(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
SET(CMAKE_INSTALL_PREFIX ${OPENSIM_INSTALL_DIR} CACHE PATH
"Install path prefix." FORCE)
ENDIF()
SET_TARGET_PROPERTIES(
${PLUGIN_NAME} PROPERTIES
DEFINE_SYMBOL ${EXPORT_MACRO}
PROJECT_LABEL "Libraries - ${PLUGIN_NAME}")
INSTALL_TARGETS(/plugins RUNTIME_DIRECTORY /plugins ${PLUGIN_NAME})