forked from jrl-umi3218/tvm
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
115 lines (95 loc) · 3.13 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
110
111
112
113
114
115
cmake_minimum_required(VERSION 3.1.3)
set(PROJECT_NAME TVM)
set(PROJECT_DESCRIPTION "...")
set(PROJECT_URL "https://github.com/jrl-umi3218/tvm")
set(PROJECT_DEBUG_POSTFIX "_d")
set(PROJECT_VERSION 0.8.0)
set(PROJECT_USE_CMAKE_EXPORT TRUE)
set(CMAKE_CXX_STANDARD 17)
include(cmake/base.cmake)
include(cmake/msvc-specific.cmake)
# Disable -Werror on Unix for now.
set(CXX_DISABLE_WERROR True)
set(DOXYGEN_USE_MATHJAX "YES")
set(DOXYGEN_DISTRIBUTE_GROUP_DOC YES)
project(TVM CXX)
if(NOT WIN32)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -Wno-sign-conversion -pedantic")
else()
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -D_ENABLE_EXTENDED_ALIGNED_STORAGE -D_SILENCE_CXX17_NEGATORS_DEPRECATION_WARNING")
endif()
set(USING_SOLVER FALSE)
set(SOLVER_FLAGS "")
set(SOLVER_LIBS "")
# If we were given coverage options, we will only pass them to the core
# library.
set(GENERATE_COVERAGE FALSE CACHE BOOL "Generate coverage data")
if("${CMAKE_CXX_FLAGS}" MATCHES "--coverage")
set(GENERATE_COVERAGE TRUE CACHE BOOL "Generate coverage data" FORCE)
string(REPLACE "--coverage" "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
string(REPLACE "--coverage" "" CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS}")
string(REPLACE "--coverage" "" CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS}")
endif()
#############################
# - External dependencies - #
#############################
#############
# - Eigen - #
#############
add_project_dependency(Eigen3 REQUIRED)
###################
# - eigen-lssol - #
###################
option(TVM_WITH_LSSOL "Build with LSSOL support" OFF)
if(${TVM_WITH_LSSOL})
add_project_dependency(eigen-lssol REQUIRED)
list(APPEND SOLVER_FLAGS "-DTVM_USE_LSSOL")
list(APPEND SOLVER_LIBS eigen-lssol::eigen-lssol)
set(USING_SOLVER TRUE)
endif()
###################
# - eigen-qld - #
###################
option(TVM_WITH_QLD "Build with QLD support" ON)
if(${TVM_WITH_QLD})
add_project_dependency(eigen-qld REQUIRED)
list(APPEND SOLVER_FLAGS "-DTVM_USE_QLD")
list(APPEND SOLVER_LIBS eigen-qld::eigen-qld)
set(USING_SOLVER TRUE)
endif()
###################
# - eigen-qld - #
###################
option(TVM_WITH_QUADPROG "Build with Quadprog support" OFF)
if(${TVM_WITH_QUADPROG})
add_project_dependency(eigen-quadprog REQUIRED)
list(APPEND SOLVER_FLAGS "-DTVM_USE_QUADPROG")
list(APPEND SOLVER_LIBS eigen-quadprog::eigen-quadprog)
set(USING_SOLVER TRUE)
endif()
#############
# - RBDyn - #
#############
add_project_dependency(RBDyn REQUIRED)
################
# - sch-core - #
################
add_project_dependency(sch-core REQUIRED)
#####################
# - mc_rbdyn_urdf - #
#####################
add_project_dependency(mc_rbdyn_urdf REQUIRED)
#########################
if(NOT USING_SOLVER)
message( FATAL_ERROR "You need to select at least one solver" )
endif()
# For MSVC, set local environment variable to enable finding the built dll
# of the main library when launching ctest with RUN_TESTS
if(MSVC)
set(CMAKE_MSVCIDE_RUN_PATH "\$(SolutionDir)/src/\$(Configuration);${CMAKE_INSTALL_PREFIX}/bin")
endif(MSVC)
add_subdirectory(3rd-party)
add_subdirectory(src)
if(${BUILD_TESTING})
add_subdirectory(tests)
endif()