-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
49 lines (37 loc) · 1.31 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
CMAKE_MINIMUM_REQUIRED(VERSION 3.3)
PROJECT(euklid)
# OPTIONS
OPTION(BUILD_PYTHON_BINDINGS "create python bindings" ON)
OPTION(WALL "Treat all warnings as errors" ON)
OPTION(USE_SUBMODULE_LIBS "Use libs from submodules" ON)
set(CMAKE_SOURCE_DIR ${CMAKE_SOURCE_DIR}/src)
set (CMAKE_CXX_STANDARD 20)
SET(CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake)
SET(CMAKE_CXX_FLAGS_RELEASE "-O3")
if(${USE_SUBMODULE_LIBS} AND EXISTS ${PROJECT_SOURCE_DIR}/lib/pybind11/CMakeLists.txt)
add_subdirectory(${PROJECT_SOURCE_DIR}/lib/pybind11)
else()
find_package(pybind11 REQUIRED)
endif()
set(PYBIND11_CPP_STANDARD -std=c++14)
if(${USE_SUBMODULE_LIBS} AND EXISTS ${PROJECT_SOURCE_DIR}/lib/eigen/CMakeLists.txt)
add_subdirectory(${PROJECT_SOURCE_DIR}/lib/eigen)
else()
find_package (Eigen3 3.4 REQUIRED NO_MODULE)
endif()
find_package(OpenMP)
if (WALL)
message("Treating all warnings as errors")
if (MSVC)
# warning level 4 and all warnings as errors
# add_compile_options(/W4 /WX)
else()
# lots of warnings and all warnings as errors
# TODO: add -Wall ()
add_compile_options(-Wall -Wextra -pedantic -Werror)
if(UNIX AND NOT APPLE)
add_compile_options(-Wno-deprecated-enum-enum-conversion)
endif()
endif()
endif()
ADD_SUBDIRECTORY("src" "euklid")