aboutsummaryrefslogtreecommitdiff
path: root/tests/test_cmake_build/subdirectory_embed/CMakeLists.txt
diff options
context:
space:
mode:
Diffstat (limited to 'tests/test_cmake_build/subdirectory_embed/CMakeLists.txt')
-rw-r--r--tests/test_cmake_build/subdirectory_embed/CMakeLists.txt14
1 files changed, 8 insertions, 6 deletions
diff --git a/tests/test_cmake_build/subdirectory_embed/CMakeLists.txt b/tests/test_cmake_build/subdirectory_embed/CMakeLists.txt
index dfb9cb8f..f286746b 100644
--- a/tests/test_cmake_build/subdirectory_embed/CMakeLists.txt
+++ b/tests/test_cmake_build/subdirectory_embed/CMakeLists.txt
@@ -1,12 +1,12 @@
-cmake_minimum_required(VERSION 3.4)
+cmake_minimum_required(VERSION 3.5)
-# The `cmake_minimum_required(VERSION 3.4...3.18)` syntax does not work with
+# The `cmake_minimum_required(VERSION 3.5...3.26)` syntax does not work with
# some versions of VS that have a patched CMake 3.11. This forces us to emulate
# the behavior using the following workaround:
-if(${CMAKE_VERSION} VERSION_LESS 3.18)
+if(${CMAKE_VERSION} VERSION_LESS 3.26)
cmake_policy(VERSION ${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION})
else()
- cmake_policy(VERSION 3.18)
+ cmake_policy(VERSION 3.26)
endif()
project(test_subdirectory_embed CXX)
@@ -23,8 +23,10 @@ add_executable(test_subdirectory_embed ../embed.cpp)
target_link_libraries(test_subdirectory_embed PRIVATE pybind11::embed)
set_target_properties(test_subdirectory_embed PROPERTIES OUTPUT_NAME test_cmake_build)
-add_custom_target(check_subdirectory_embed $<TARGET_FILE:test_subdirectory_embed>
- "${PROJECT_SOURCE_DIR}/../test.py")
+add_custom_target(
+ check_subdirectory_embed
+ $<TARGET_FILE:test_subdirectory_embed> "${PROJECT_SOURCE_DIR}/../test.py"
+ DEPENDS test_subdirectory_embed)
# Test custom export group -- PYBIND11_EXPORT_NAME
add_library(test_embed_lib ../embed.cpp)