1+ cmake_minimum_required (VERSION 3.4...3.18 )
2+ project (pyopenpgl)
3+ set (CMAKE_CXX_STANDARD 14)
4+
5+ set (CMAKE_MODULE_PATH
6+ ${CMAKE_MODULE_PATH}
7+ ${CMAKE_CURRENT_SOURCE_DIR} /cmake
8+ )
9+
10+ set (PYOPENPGL_OPTIONS -msse2 -msse4.1 -O3 -Wall -ffp-model=precise -Wformat -Wformat-security -fvisibility=hidden -fvisibility-inlines-hidden -fno-strict-aliasing -fno-tree-vectorize)
11+
12+ add_subdirectory (../ext/pybind11 build )
13+
14+ pybind11_add_module (pyopenpgl
15+ python.cpp
16+ )
17+
18+ set_source_files_properties (python.cpp PROPERTIES COMPILE_FLAGS ${PYOPENPGL_OPTIONS} )
19+
20+ #target_include_directories(libguiding PUBLIC include)
21+ target_include_directories (pyopenpgl PRIVATE ${CMAKE_INSTALL_PREFIX} /include )
22+
23+ message (STATUS "openpgl_DIR = ${openpgl_DIR} " )
24+
25+
26+
27+ if (NOT ${OPENPGL_TBB_ROOT} STREQUAL "" )
28+ set (TBB_FIND_PACKAGE_OPTION "NO_DEFAULT_PATH" )
29+ set (TBB_ROOT ${OPENPGL_TBB_ROOT} )
30+ list (APPEND CMAKE_PREFIX_PATH ${OPENPGL_TBB_ROOT} )
31+ endif ()
32+
33+ #find_package(TBB REQUIRED)
34+ #find_package(openpgl REQUIRED)
35+
36+ message (STATUS "TBB_INCLUDE_DIRS = ${TBB_INCLUDE_DIRS} " )
37+ message (STATUS "TBB_FOUND = ${TBB_FOUND} " )
38+
39+ target_link_libraries (pyopenpgl PRIVATE openpgl )
40+ target_link_libraries (pyopenpgl PRIVATE TBB::tbb )
41+
42+ set (PYOPENPGL_RPATH
43+ "$ORIGIN:$ORIGIN/.." )
44+
45+ set_target_properties (pyopenpgl PROPERTIES
46+ PREFIX ""
47+ INSTALL_RPATH ${PYOPENPGL_RPATH}
48+ )
49+
50+ install (TARGETS pyopenpgl DESTINATION lib/python)
51+
52+
53+ pybind11_add_module (pyopenpgldebug
54+ pyopenpgldebug.cpp
55+ )
56+
57+ set_source_files_properties (pyopenpgldebug.cpp PROPERTIES COMPILE_FLAGS ${PYOPENPGL_OPTIONS} )
58+ #target_include_directories(libguiding PUBLIC include)
59+
60+ message (STATUS "TEST=${CMAKE_CURRENT_SOURCE_DIR} /../../" )
61+
62+ target_include_directories (pyopenpgldebug PRIVATE ${CMAKE_INSTALL_PREFIX} /include )
63+ target_include_directories (pyopenpgldebug PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} /../../ )
64+ target_include_directories (pyopenpgldebug PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} /../../third-party )
65+
66+ target_link_libraries (pyopenpgldebug PRIVATE openpgl )
67+ target_link_libraries (pyopenpgldebug PRIVATE TBB::tbb )
68+
69+ set (PYOPENPGLDEBUG_RPATH
70+ "$ORIGIN:$ORIGIN/.." )
71+
72+ set_target_properties (pyopenpgldebug PROPERTIES
73+ PREFIX ""
74+ INSTALL_RPATH ${PYOPENPGLDEBUG_RPATH}
75+ )
76+
77+ install (TARGETS pyopenpgldebug DESTINATION lib/python)
0 commit comments