-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
108 lines (97 loc) · 3.79 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
# Cypress_example -- Example on how to use cypress as external project
# Copyright (C) 2019 Christoph Ostrau
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
# CMake version and project metadata
cmake_minimum_required(VERSION 3.0)
project(BS2CYPRESS LANGUAGES CXX)
# Add the local "cmake" directory to the search path
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_SOURCE_DIR}/cmake)
# Enable C++14 support
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++17 -fPIC")
# Enable all warnings on MSVC and GCC/Clang/Intel
if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "MSVC")
if(CMAKE_CXX_FLAGS MATCHES "/W[0-4]")
string(REGEX REPLACE "/W[0-4]" "/W4" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
else()
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /W4")
endif()
elseif(("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU") OR
("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang") OR
("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Intel"))
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -pedantic")
endif()
# Set a default build type
if(NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE "Release" CACHE STRING "Choose the type of build, options are: Debug Release RelWithDebInfo MinSizeRel." FORCE)
endif()
find_package(PythonLibs 2.7 REQUIRED )
# Include the Cypress library
include(cypress_external)
include_directories(${CMAKE_SOURCE_DIR}/backend)
# Boost
#find_package(Boost REQUIRED serialization system filesystem mpi python27)
# Setup all includes, we use current github version for includes, which might break at some point -> BS do not deploy headers yet
execute_process(COMMAND "../setup_includes.sh"
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
)
set(BS_INCLUDE_PATH ${CMAKE_BINARY_DIR}/bs_includes)
include_directories(
PUBLIC
${CMAKE_SOURCE_DIR}
${Boost_INCLUDE_DIRS}
${PYTHON_INCLUDE_DIR}
${BS_INCLUDE_PATH}/euter/include
${BS_INCLUDE_PATH}/lib-boost-patches
${BS_INCLUDE_PATH}/marocco
${BS_INCLUDE_PATH}/pywrap/src
${BS_INCLUDE_PATH}/halbe
${BS_INCLUDE_PATH}/halco/include
${BS_INCLUDE_PATH}/ztl
${BS_INCLUDE_PATH}/rant
${BS_INCLUDE_PATH}/redman/include
${BS_INCLUDE_PATH}/sthal
${BS_INCLUDE_PATH}/pyublas/pyublas/include
${BS_INCLUDE_PATH}/calibtic/include
${BS_INCLUDE_PATH}/hicann-system/units/communication/source
${BS_INCLUDE_PATH}/hwdb
)
# Set in BS Software, if not set, link will not work
add_compile_options(-DBOOST_VARIANT_DO_NOT_USE_VARIADIC_TEMPLATES -DBOOST_MPL_LIMIT_LIST_SIZE=30 -DBOOST_MPL_CFG_NO_PREPROCESSED_HEADERS -DBOOST_DYNAMIC_BITSET_DONT_USE_FRIENDS)
# Manually set library path, because it is not included in LIBRARY_PATH environment variable
link_directories("/wang/environment/software/container/meta-nmpm-software/current/lib")
# Compile the actual executable
add_library(BS2CYPRESS SHARED
backend/brainscales
)
add_dependencies(BS2CYPRESS cypress_ext)
target_link_libraries(BS2CYPRESS PUBLIC
euter
marocco
halco_hicann_v2
halco_common
euter
marocco_runtime
marocco_parameters
marocco_coordinates
marocco_results
pymarocco_cpp
sthal
halbe_container
log4cxx.so.10
#${Boost_LIBRARIES}
${PYTHON_LIBRARIES}
)
enable_testing()
add_subdirectory(test)