-
Notifications
You must be signed in to change notification settings - Fork 9
/
CMakeLists.txt
48 lines (35 loc) · 1.17 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
if(HAS_PARENT)
set(SYMBOLIC_TOPLEVEL_PROJECT OFF)
else()
set(SYMBOLIC_TOPLEVEL_PROJECT ON)
endif()
## set the minimu, version so that some features of cmake can be used
set(REQUIRED_CMAKE_VERSION "3.14.0")
if(SYMBOLIC_TOPLEVEL_PROJECT)
cmake_minimum_required(VERSION ${REQUIRED_CMAKE_VERSION})
else()
# Don't use cmake_minimum_required here to avoid implicitly overriding parent policies
if(${CMAKE_VERSION} VERSION_LESS ${REQUIRED_CMAKE_VERSION})
message(FATAL_ERROR "CMake required version to build SYMBOLIC_LIB is ${REQUIRED_CMAKE_VERSION}")
endif()
endif()
PROJECT(Symbolic C CXX)
## include eigen
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_CURRENT_SOURCE_DIR}/cmake)
include(eigen)
if (APPLE)
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR})
else()
if (UNIX)
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
else()
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR})
endif()
endif()
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR})
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
set(CMAKE_CACHEFILE_DIR ${CMAKE_BINARY_DIR}/build)
add_subdirectory(src)
if(SYMBOLIC_TOPLEVEL_PROJECT)
add_subdirectory(examples)
endif()