-
Notifications
You must be signed in to change notification settings - Fork 1
/
CMakeLists.txt
60 lines (37 loc) · 1.1 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
project( ESN )
cmake_minimum_required(VERSION 3.3)
# Options
option(ESN_USE_SYSTEM_EIGEN "ESN library uses system Eigen library" OFF)
option(ESN_USE_SYSTEM_GTEST "ESN library uses system GTest library" OFF)
# CMake configuration
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/bin")
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/lib")
list(APPEND CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake")
# External projects
if(NOT ESN_USE_SYSTEM_EIGEN)
include(Eigen)
endif()
if(NOT ESN_USE_SYSTEM_GTEST)
include(GTest)
endif()
# Find dependencies
find_package(Eigen3)
# Source files
file(GLOB SRC_FILES source/*.cpp)
# Includes
include_directories(include)
include_directories(source)
# Flags
if (UNIX)
add_compile_options(-std=c++11)
endif()
# Target
add_library(esn SHARED ${SRC_FILES})
# Linking
target_link_libraries(esn ${EIGEN3_LIBRARY})
# Install
install(TARGETS esn DESTINATION lib)
# Subdirectoris
add_subdirectory(python)
add_subdirectory(samples)
add_subdirectory(tests)