-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathCMakeLists.txt
More file actions
27 lines (22 loc) · 795 Bytes
/
CMakeLists.txt
File metadata and controls
27 lines (22 loc) · 795 Bytes
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
cmake_minimum_required (VERSION 3.14)
project (PyLogHook)
option(USE_BOOST "test with boost instead of pybind11" ON)
find_package(Python 3 REQUIRED COMPONENTS Development)
if (USE_BOOST)
find_package(Boost REQUIRED COMPONENTS python)
set(SRC "tests/boost_test.cpp")
else()
find_package(Python 3 REQUIRED COMPONENTS Development Interpreter)
find_package(pybind11 REQUIRED)
set(SRC "tests/pybind11_test.cpp")
endif()
include(CTest)
enable_testing()
add_executable(tests tests/main.cpp ${SRC})
if (USE_BOOST)
target_include_directories(tests PRIVATE ${Boost_INCLUDE_DIRS} )
target_link_libraries(tests PRIVATE ${Boost_LIBRARIES} Python::Python)
else()
target_link_libraries(tests PRIVATE pybind11::pybind11 Python::Python)
endif()
add_test(NAME tests COMMAND tests)