-
Notifications
You must be signed in to change notification settings - Fork 12
/
Copy pathCMakeLists.txt
75 lines (61 loc) · 2.24 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
68
69
70
71
72
73
74
75
cmake_minimum_required(VERSION 3.10.0)
project(scone)
# To create a folder hierarchy within Visual Studio.
set_property(GLOBAL PROPERTY USE_FOLDERS ON)
# compilation database for completion on Linux
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
# Find dependencies.
# ------------------
set(CMAKE_MODULE_PATH "${CMAKE_MODULE_PATH}" "${CMAKE_SOURCE_DIR}/CMakeModules")
option(SCONE_OPENSIM_3 "Support OpenSim 3.3" ON)
option(SCONE_OPENSIM_4 "Support OpenSim 4.0 - EXPERIMENTAL" OFF)
option(SCONE_LUA "Support for lua scripting" OFF)
option(SCONE_HYFYDY "Support Hyfydy - EXPERIMENTAL" OFF)
option(SCONE_ENABLE_PROFILER "Enable SCONE profiler" ON)
option(SCONE_SCONESTUDIO_REQUIRED "Require that sconestudio is built" OFF)
option(SCONE_SCONESTUDIO "Build sconestudio" ON)
option(SCONE_EXPERIMENTAL_FEATURES "Enable experimental features" OFF)
# Find TCLAP
find_path( TCLAP_DIR NAMES "tclap/CmdLine.h" PATHS "${CMAKE_SOURCE_DIR}/contrib/tclap-1.2.1/include" )
# Various settings
# ----------------
# Place build products (libraries, executables) in root
# binary (build) directory. Otherwise, they get scattered around
# the build directory and so the dll's aren't next to the executables.
#get_filename_component(CONFIG_NAME "${CMAKE_BINARY_DIR}" NAME)
#set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${CMAKE_SOURCE_DIR}/bin/${CONFIG_NAME}")
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/bin")
# Silence CMake warning on OSX.
set(CMAKE_MACOSX_RPATH ON)
# Build lua if SCONE_LUA is set
if (SCONE_LUA)
add_subdirectory(contrib/lua-5.3.5)
endif()
#
# Add submodules
#
add_subdirectory(submodules/xo)
add_subdirectory(submodules/spot)
#
# Add targets
#
add_subdirectory(src/sconelib)
add_subdirectory(src/sconecmd)
add_subdirectory(src/sconeunittests)
if (SCONE_SCONESTUDIO)
find_package(Qt5 COMPONENTS Widgets OpenGL PrintSupport REQUIRED)
add_subdirectory(submodules/vis)
add_subdirectory(src/sconestudio)
endif()
if (SCONE_HYFYDY)
find_path( SCONE_HYFYDY_DIR "sconehfd/sconehfd/ModelHfd.h" HINTS "../sconehfd" )
add_subdirectory("${SCONE_HYFYDY_DIR}" "${CMAKE_BINARY_DIR}/sconehfd")
endif()
#
# Add tests
#
enable_testing()
if (XO_TEST_ENABLED)
add_test( xo_test "${EXECUTABLE_OUTPUT_PATH}/xo_test")
endif()
add_test( scone_unit_tests "${EXECUTABLE_OUTPUT_PATH}/sconeunittests")