-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathCMakeLists.txt
executable file
·137 lines (112 loc) · 3.78 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
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
# ========================================================
# ===================== CMake Settings ===================
# ========================================================
cmake_minimum_required(VERSION 3.3)
include(ExternalProject)
include(GNUInstallDirs)
include(ProcessorCount)
ProcessorCount(NUM_CPUS)
if(NUM_CPUS EQUAL 0)
set(NUM_CPUS 1)
endif()
# ========================================================
# ===================== User Settings ====================
# ========================================================
project(mrg-cpp)
# ---------------------- App name -----------------------
set(APP_NAME mrg_axon_model)
# --------------------- Source Files ---------------------
set(${APP_NAME}_SOURCE_FILES
src/MRG_main.cpp
src/MRG_init.cpp
src/MRG_ode.cpp
src/ofApp.cpp
src/utils/utils.cpp
)
# ========================================================
# ===============================================================
# ==================== External Dependencies ====================
# ===============================================================
find_package(PkgConfig)
pkg_check_modules(GLIB REQUIRED glib-2.0)
pkg_check_modules(GSTREAMER REQUIRED gstreamer-1.0)
pkg_check_modules(GSTREAMER_APP REQUIRED gstreamer-app-1.0)
pkg_check_modules(GSTREAMER_VIDEO REQUIRED gstreamer-video-1.0)
pkg_check_modules(CAIRO REQUIRED cairo)
add_definitions(-DBOOST_ERROR_CODE_HEADER_ONLY)
ExternalProject_Add(armadillo
URL "${CMAKE_SOURCE_DIR}/external_libs/armadillo-9.200.5.tar.bz2"
CONFIGURE_COMMAND ""
BUILD_COMMAND ""
INSTALL_COMMAND ${CMAKE_COMMAND} -E copy_directory <SOURCE_DIR>
"${CMAKE_BINARY_DIR}/${CMAKE_INSTALL_INCLUDEDIR}"
)
ExternalProject_Add(sundials
URL "${CMAKE_SOURCE_DIR}/external_libs/sundials-4.0.2.tar.gz"
CMAKE_ARGS "-DCMAKE_INSTALL_PREFIX=${CMAKE_BINARY_DIR}"
)
ExternalProject_Add(openframeworks
URL "${CMAKE_SOURCE_DIR}/external_libs/of_v0.11.2_linux64gcc6_release"
CONFIGURE_COMMAND ""
BUILD_COMMAND <SOURCE_DIR>/scripts/linux/compileOF.sh -j${NUM_CPUS}
BUILD_IN_SOURCE 1
INSTALL_COMMAND ${CMAKE_COMMAND}
-DSRC_PREFIX=<SOURCE_DIR>
-DDST_PREFIX=${CMAKE_BINARY_DIR}
-P ${CMAKE_SOURCE_DIR}/external_libs/install_openframeworks.cmake
)
link_directories("${CMAKE_BINARY_DIR}/${CMAKE_INSTALL_LIBDIR}")
# ===============================================================
# =======================================================
# ==================== Build Project ====================
# =======================================================
add_executable(${APP_NAME}
${${APP_NAME}_SOURCE_FILES}
)
target_include_directories(${APP_NAME} BEFORE
PRIVATE "${CMAKE_BINARY_DIR}/${CMAKE_INSTALL_INCLUDEDIR}"
${GLIB_INCLUDE_DIRS}
${GSTREAMER_INCLUDE_DIRS}
${CAIRO_INCLUDE_DIRS}
)
target_link_libraries(${APP_NAME}
libsundials_cvode.a
libsundials_sunlinsoldense.a
libsundials_sunmatrixdense.a
libsundials_nvecserial.a
libopenFrameworks.a
GLEW
GLU
GL
glut
glfw
openal
sndfile
kiss
tess2
PocoUtil
PocoFoundation
fontconfig
freetype
freeimage
X11
${GSTREAMER_LIBRARIES}
${GSTREAMER_APP_LIBRARIES}
${GSTREAMER_VIDEO_LIBRARIES}
${CAIRO_LIBRARIES}
${GLIB_LIBRARIES}
uriparser
curl
boost_filesystem
boost_system
pthread
)
add_dependencies(${APP_NAME} armadillo sundials openframeworks)
set_target_properties(${APP_NAME}
PROPERTIES
ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/lib"
LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/lib"
RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/bin"
)
file(COPY reference/activateF.txt DESTINATION bin/)
# =======================================================