##// END OF EJS Templates
Added option to disable PB11 wrappers...
jeandet -
r46:65c558a3025b
parent child
Show More
@@ -4,6 +4,7 project(SciQLOPCore CXX)
4 OPTION (CPPCHECK "Analyzes the source code with cppcheck" OFF)
4 OPTION (CPPCHECK "Analyzes the source code with cppcheck" OFF)
5 OPTION (CLANG_TIDY "Analyzes the source code with Clang Tidy" OFF)
5 OPTION (CLANG_TIDY "Analyzes the source code with Clang Tidy" OFF)
6 OPTION (IWYU "Analyzes the source code with Include What You Use" OFF)
6 OPTION (IWYU "Analyzes the source code with Include What You Use" OFF)
7 OPTION (PyWrappers "Enables Python 3 wrappers" ON)
7
8
8 OPTION (Catalog "builds catalog API" ON)
9 OPTION (Catalog "builds catalog API" ON)
9
10
@@ -20,14 +21,16 set(CMAKE_INCLUDE_CURRENT_DIR ON)
20
21
21 find_package(Qt5 COMPONENTS Core Widgets Concurrent Network PrintSupport Svg Test REQUIRED)
22 find_package(Qt5 COMPONENTS Core Widgets Concurrent Network PrintSupport Svg Test REQUIRED)
22
23
23 find_package(pybind11 CONFIG QUIET)
24 if(PyWrappers)
24 if (NOT pybind11_FOUND)
25 find_package(pybind11 CONFIG QUIET)
25 if(NOT EXISTS ${CMAKE_CURRENT_LIST_DIR}/external/pybind11/CMakeLists.txt)
26 if (NOT pybind11_FOUND)
26 message("Init submodule pybind11")
27 if(NOT EXISTS ${CMAKE_CURRENT_LIST_DIR}/external/pybind11/CMakeLists.txt)
27 execute_process(COMMAND git submodule init external/pybind11 WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR})
28 message("Init submodule pybind11")
28 execute_process(COMMAND git submodule update external/pybind11 WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR})
29 execute_process(COMMAND git submodule init external/pybind11 WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR})
30 execute_process(COMMAND git submodule update external/pybind11 WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR})
31 endif()
32 add_subdirectory(external/pybind11)
29 endif()
33 endif()
30 add_subdirectory(external/pybind11)
31 endif()
34 endif()
32
35
33 find_package(libcatalogs CONFIG QUIET)
36 find_package(libcatalogs CONFIG QUIET)
@@ -168,18 +171,20 if(Catalog)
168 endif()
171 endif()
169
172
170
173
171 pybind11_add_module(sciqlopqt src/pybind11_wrappers/QtWrappers.cpp)
174 if(PyWrappers)
172 target_link_libraries(sciqlopqt PUBLIC Qt5::Core)
175 pybind11_add_module(sciqlopqt src/pybind11_wrappers/QtWrappers.cpp)
176 target_link_libraries(sciqlopqt PUBLIC Qt5::Core)
173
177
174 pybind11_add_module(pysciqlopcore src/pybind11_wrappers/CoreWrappers.cpp)
178 pybind11_add_module(pysciqlopcore src/pybind11_wrappers/CoreWrappers.cpp)
175 target_link_libraries(pysciqlopcore PUBLIC sciqlopcore)
179 target_link_libraries(pysciqlopcore PUBLIC sciqlopcore)
176
180
177 add_library(pysciqlop src/pybind11_wrappers/pywrappers_common.h)
181 add_library(pysciqlop src/pybind11_wrappers/pywrappers_common.h)
178 target_link_libraries(pysciqlop PUBLIC Qt5::Core)
182 target_link_libraries(pysciqlop PUBLIC Qt5::Core)
179 target_include_directories(pysciqlop PUBLIC
183 target_include_directories(pysciqlop PUBLIC
180 $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/src/pybind11_wrappers/>
184 $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/src/pybind11_wrappers/>
181 $<INSTALL_INTERFACE:include/SciQLOP/py_wrappers>
185 $<INSTALL_INTERFACE:include/SciQLOP/py_wrappers>
182 )
186 )
187 endif()
183
188
184 SET_PROPERTY(GLOBAL PROPERTY CORE_PYTHON_PATH ${CMAKE_CURRENT_BINARY_DIR})
189 SET_PROPERTY(GLOBAL PROPERTY CORE_PYTHON_PATH ${CMAKE_CURRENT_BINARY_DIR})
185
190
General Comments 0
You need to be logged in to leave comments. Login now