-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
109 lines (81 loc) · 4.03 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
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
#=============================================================================
# CMake configuration file for Chrono-Projects
#
#=============================================================================
cmake_minimum_required(VERSION 3.10)
project(ChronoProjects)
# Set location of additional CMAKE modules
#set(CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake)
# Set location of executable
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/bin)
#-----------------------------------------------------------------------------
# Enable CTest
#-----------------------------------------------------------------------------
enable_testing()
include(CTest)
#-----------------------------------------------------------------------------
# Use dependent options
#-----------------------------------------------------------------------------
include(CMakeDependentOption)
#-----------------------------------------------------------------------------
# Always use full RPATH (differentiating between the build and install trees)
#-----------------------------------------------------------------------------
# use, i.e. don't skip the full RPATH for the build tree
set(CMAKE_SKIP_BUILD_RPATH FALSE)
# when building, don't use the install RPATH already
# (but later on when installing)
set(CMAKE_BUILD_WITH_INSTALL_RPATH FALSE)
set(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/lib")
# add the automatically determined parts of the RPATH
# which point to directories outside the build tree to the install RPATH
set(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)
# the RPATH to be used when installing, but only if it's not a system directory
list(FIND CMAKE_PLATFORM_IMPLICIT_LINK_DIRECTORIES "${CMAKE_INSTALL_PREFIX}/lib" isSystemDir)
if("${isSystemDir}" STREQUAL "-1")
set(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/lib")
endif()
#-----------------------------------------------------------------------------
#if(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
# set(CH_LINKERFLAG_EXE "${CH_LINKERFLAG_EXE} -framework IOKit -framework Cocoa -framework OpenGL")
#endif()
#-----------------------------------------------------------------------------
# Fix for VS 2017 15.8 and newer to handle alignment specification with Eigen
#-----------------------------------------------------------------------------
if(${CMAKE_SYSTEM_NAME} MATCHES "Windows")
if(MSVC AND ${MSVC_VERSION} GREATER_EQUAL 1915)
add_definitions( "-D_ENABLE_EXTENDED_ALIGNED_STORAGE" )
endif()
endif()
#-----------------------------------------------------------------------------
# Disable some warnings
#-----------------------------------------------------------------------------
if(${CMAKE_SYSTEM_NAME} MATCHES "Windows")
if(MSVC)
add_definitions( "-D_CRT_SECURE_NO_DEPRECATE" ) # avoids deprecation warnings
add_definitions( "-D_SCL_SECURE_NO_DEPRECATE" ) # avoids deprecation warnings
add_definitions( "-DNOMINMAX" ) # do not use MSVC's min/max macros
add_definitions( "-MP" ) # perform parallel builds
endif(MSVC)
endif()
#-----------------------------------------------------------------------------
# Invoke CMake in subdirectories
#-----------------------------------------------------------------------------
if(NOT Chrono_DIR)
set(Chrono_DIR "" CACHE PATH "The directory containing a CMake configuration file for Chrono.")
return()
endif()
# Options for configuring/building individual sets of programs
option(ENABLE_CONFIG_TESTS "Build the programs for checking Chrono configuration" ON)
# Keep track of all DLLs. Each submodule should append to this list.
list(APPEND ALL_DLL_NAMES "")
list(APPEND ALL_DEPENDENCY_DLLS "")
# Propagate configuration to submodules.
# if(ENABLE_CONFIG_TESTS)
# message(STATUS "\n==== Chrono configuration programs ====")
# add_subdirectory(configuration_tests)
# endif()
add_subdirectory(projects)
# ------------------------------------------------------------------------------
# Set path to Chrono data directory
# ------------------------------------------------------------------------------
SET(CHRONO_DATA_DIR "${CHRONO_DATA_DIR}")