-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
41 lines (27 loc) · 1.36 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
cmake_minimum_required(VERSION 3.15)
project(PythonSharedMemory)
set( CMAKE_CXX_STANDARD 17 )
set( CMAKE_CXX_FLAGS " -pthread -O2 " )
set( CMAKE_POSITION_INDEPENDENT_CODE ON )
set( CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake )
find_package( Python3 COMPONENTS Interpreter Development NumPy REQUIRED )
message( STATUS "Python: " ${Python3_EXECUTABLE} )
message( STATUS " " ${Python3_INCLUDE_DIRS} )
message( STATUS " " ${Python3_LIBRARIES} )
message( STATUS " " ${Python3_NumPy_INCLUDE_DIRS} )
include_directories( ${Python3_INCLUDE_DIRS} ${Python3_NumPy_INCLUDE_DIRS} )
set( Boost_USE_STATIC_LIBS OFF )
set( Boost_USE_MULTITHREADED ON )
find_package( Boost COMPONENTS python3 numpy3 thread system REQUIRED )
message( STATUS "Boost: " ${Boost_INCLUDE_DIR} )
message( STATUS " " ${Boost_LIBRARY_DIRS} )
message( STATUS " " ${Boost_LIBRARIES} )
include_directories( ${Boost_INCLUDE_DIR} )
add_definitions( ${Boost_DEFINITIONS} )
add_library( shared_store SHARED sources/module.cpp)
target_link_libraries( shared_store ${Boost_LIBRARIES} ${Python3_LIBRARIES} librt.so )
target_include_directories( shared_store PRIVATE ${Python3_INCLUDE_DIRS} )
set_target_properties( shared_store PROPERTIES PREFIX "" )
set_target_properties( shared_store PROPERTIES SUFFIX ".so" )
add_executable( exe sources/main.cpp)
target_link_libraries( exe shared_store )