pybind11/tests/pure_cpp/CMakeLists.txt
Ralf W. Grosse-Kunstleve 4a08160a1f Revert "Updating Catch version to latest, in hopes of resolving the GHA download issue affecting all MSVC builds."
This reverts commit f4e1112dc434d0505cecad6259113f0621ecba70.

It didn't help.
2021-06-30 07:04:31 -07:00

21 lines
734 B
CMake

find_package(Catch 2.13.2)
if(CATCH_FOUND)
message(STATUS "Building pure C++ tests (not depending on Python) using Catch v${CATCH_VERSION}")
else()
message(STATUS "Catch not detected. Interpreter tests will be skipped. Install Catch headers"
" manually or use `cmake -DDOWNLOAD_CATCH=ON` to fetch them automatically.")
return()
endif()
add_executable(smart_holder_poc_test smart_holder_poc_test.cpp)
pybind11_enable_warnings(smart_holder_poc_test)
target_link_libraries(smart_holder_poc_test PRIVATE pybind11::headers Catch2::Catch2)
add_custom_target(
test_pure_cpp
COMMAND "$<TARGET_FILE:smart_holder_poc_test>"
WORKING_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}")
add_dependencies(check test_pure_cpp)