-
Notifications
You must be signed in to change notification settings - Fork 13
/
CMakeLists.txt
74 lines (55 loc) · 1.76 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
cmake_minimum_required(VERSION 3.12)
Project(UnicornTK)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS ON)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall")
set(CMAKE_BUILD_TYPE "Release")
option(UTK_LOG "Enable utk logging" ON)
# Disabled by default, better to install it with
# pybind provided extension
option(UTK_PYTHON "Enable build of pyutk (see setup.py)" OFF)
option(UTK_BUILD_EXE "Enable building of utk's executables" ON)
set(UTK_EXE_PREFIX "" CACHE STRING "Prefix for UTK exe (eg. utk_). No spaces nor slash allowed!")
# OpenMP option
option(UTK_USE_OPENMP "Enable USE of OpenMp" ON)
# FFTW option
option(UTK_USE_FFTW "Enable use of FFTW" ON)
# CGal option
option(UTK_USE_CGAL "Enable projects depending on CGAL. " OFF )
# Finding libraries
set (CMAKE_MODULE_PATH "${CMAKE_MODULE_PATH};${CMAKE_CURRENT_SOURCE_DIR}/cmake")
include(spdlog)
include(cli11)
include(stb)
include(externals)
if (UTK_LOG)
add_definitions(-DUTK_LOG)
endif()
if (UTK_USE_OPENMP)
include(openmp)
add_definitions(-DUTK_USE_OPENMP)
endif()
if (UTK_USE_FFTW)
include(fftw REQUIRED)
if (FFTW_FOUND)
add_definitions(-DUTK_USE_FFTW)
include_directories(${FFTW_INCLUDE_DIRS})
else()
message("FFTW not found. UTK compiled without.")
endif()
endif()
if (UTK_USE_CGAL)
include(cgal)
find_package(SuiteSparse REQUIRED)
endif()
set(UTK_DATA_PATH "${PROJECT_SOURCE_DIR}/data")
set(UTK_EXTERNALS_FOLDER "${PROJECT_SOURCE_DIR}/externals/")
set(UTK_INCLUDE_DIR "${PROJECT_SOURCE_DIR}/include/")
add_definitions(-DUTK_DATA_PATH=\"${UTK_DATA_PATH}\")
add_definitions(-D_USE_MATH_DEFINES) # Windows... Oh dear Windows...
### UTK COMPILATION ###
IF (UTK_PYTHON)
include(pybind11)
ENDIF()
add_subdirectory(src)