-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathCMakeLists.txt
58 lines (47 loc) · 1.6 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
project(BrainClustering)
cmake_minimum_required(VERSION 2.8.3)
set(BOOST_REQUESTED_VERSION 1.71)
list(APPEND CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake)
if (NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE "Release")
endif ()
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
# Compiler flags -Winline \ -Wno-error=inline \
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} \
-fopenmp \
-Wall \
-Wextra \
-Wpedantic \
-fdiagnostics-color=auto")
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} \
-O3 \
-funroll-loops \
-march=native")
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} \
-O0 \
-ggdb")
FIND_PACKAGE(PythonInterp 3.8)
FIND_PACKAGE(PythonLibs 3 REQUIRED)
if (PYTHONINTERP_FOUND)
if (UNIX AND NOT APPLE)
FIND_PACKAGE(Boost COMPONENTS python numpy serialization)
else ()
FIND_PACKAGE(Boost COMPONENTS python${PYTHON_VERSION_MAJOR}${PYTHON_VERSION_MINOR} numpy serialization)
endif ()
else ()
message("Python not found")
endif ()
message(STATUS "BUILD TYPE: ${CMAKE_BUILD_TYPE}")
message(STATUS "PYTHON_LIBRARIES = ${PYTHON_LIBRARIES}")
message(STATUS "PYTHON_EXECUTABLE = ${PYTHON_EXECUTABLE}")
message(STATUS "PYTHON_INCLUDE_DIRS = ${PYTHON_INCLUDE_DIRS}")
message(STATUS "Boost_LIBRARIES = ${Boost_LIBRARIES}")
INCLUDE_DIRECTORIES(${Boost_INCLUDE_DIRS} ${PYTHON_INCLUDE_DIRS})
LINK_LIBRARIES(
${Boost_LIBRARIES}
${PYTHON_LIBRARIES}) # Deprecated but so convenient!
include_directories(util)
add_custom_target(main ALL)
ADD_SUBDIRECTORY(cluster)
ADD_SUBDIRECTORY(map)