-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
40 lines (27 loc) · 1.16 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
cmake_minimum_required(VERSION 2.8)
project(neck-simulator)
set(CMAKE_CXX_STANDARD 11)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/files/phi.m_exp.csv ${CMAKE_CURRENT_BINARY_DIR} COPYONLY)
add_subdirectory(${PROJECT_SOURCE_DIR}/lib/CiA402Device/)
add_subdirectory(${PROJECT_SOURCE_DIR}/lib/fcontrol/)
add_subdirectory(${PROJECT_SOURCE_DIR}/lib/i-plot/)
#add_subdirectory(${PROJECT_SOURCE_DIR}/lib/sensor-integration/)
INCLUDE_DIRECTORIES(${SUBDIR_INCLUDE_DIRECTORIES})
aux_source_directory(main SRC_LIST)
aux_source_directory(utils SRC_LIST)
#add_subdirectory(lib)
#add all executables in foreach
#SUBDIR_LINK_NAMES got from:
#set(SUBDIR_LINK_NAMES ${SUBDIR_LINK_NAMES} ${PROJECT_NAME} PARENT_SCOPE)
#in subprojects
foreach( sourcefile ${SRC_LIST} )
#Used a simple string replace, to cut off .cpp.
string( REGEX REPLACE "[A-z]+[/]" "" name ${sourcefile} )
string( REPLACE ".cpp" "" name ${name} )
#add executable
add_executable( ${name} ${sourcefile} )
message ("Including executable: " ${name})
#link with libs
target_link_libraries( ${name} ${SUBDIR_LINK_NAMES} )
endforeach( sourcefile ${SRC_LIST} )