-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
41 lines (32 loc) · 1.32 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
# Install SFMT lib first (https://github.com/heavywatal/sfmt-class)
# brew install heavywatal/tap/sfmt-class
# brew install boost
# brew install boost-python3
cmake_minimum_required(VERSION 3.17)
project(mtt_icm)
set(CMAKE_VERBOSE_MAKEFILE ON)
set(CMAKE_CXX_STANDARD 20)
if(NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE Release)
endif()
set(CMAKE_CXX_FLAGS "-Wall -Wextra")
set(CMAKE_CXX_FLAGS_DEBUG "-g")
set(CMAKE_CXX_FLAGS_RELEASE "-O3")
find_package (Python3 COMPONENTS Interpreter Development NumPy)
find_package(sfmt)
set(PYTHON_VERSION "${Python3_VERSION_MAJOR}${Python3_VERSION_MINOR}")
find_package(Boost 1.85.0 COMPONENTS "python${PYTHON_VERSION}" "numpy${PYTHON_VERSION}" REQUIRED)
# Python library, will produce a icm.so file
add_library(icm MODULE src/python-bridge.cpp
src/icm.cpp include/mtt-icm/icm.hpp
src/monte-carlo-icm.cpp include/mtt-icm/monte-carlo-icm.hpp
src/math.cpp src/math.hpp)
target_include_directories(icm PRIVATE ${Python3_INCLUDE_DIRS})
target_include_directories(icm PRIVATE ${Boost_INCLUDE_DIRS})
target_include_directories(icm PRIVATE "${mtt_icm_SOURCE_DIR}/include")
target_link_libraries(icm ${Python3_LIBRARIES})
target_link_libraries(icm ${Boost_PYTHON_LIBRARY})
target_link_libraries(icm ${Boost_LIBRARIES})
target_link_libraries(icm wtl::sfmt)
#### Tests
add_subdirectory(test)