aboutsummaryrefslogtreecommitdiffstats
path: root/3rdparty/pybind11/tests/test_cmake_build/subdirectory_embed/CMakeLists.txt
diff options
context:
space:
mode:
authorMiodrag Milanovic <mmicko@gmail.com>2021-01-02 10:15:39 +0100
committerMiodrag Milanovic <mmicko@gmail.com>2021-01-02 10:15:39 +0100
commite76cdab6dd77bad411e6ac9372ee527aff89ef17 (patch)
treee9868f05cf455336d75f33b1312d71034f8fb334 /3rdparty/pybind11/tests/test_cmake_build/subdirectory_embed/CMakeLists.txt
parentc6cdf30501dcb2da01361229dd66a05dad73a132 (diff)
downloadnextpnr-e76cdab6dd77bad411e6ac9372ee527aff89ef17.tar.gz
nextpnr-e76cdab6dd77bad411e6ac9372ee527aff89ef17.tar.bz2
nextpnr-e76cdab6dd77bad411e6ac9372ee527aff89ef17.zip
Update pybind11 to version 2.6.1
Diffstat (limited to '3rdparty/pybind11/tests/test_cmake_build/subdirectory_embed/CMakeLists.txt')
-rw-r--r--3rdparty/pybind11/tests/test_cmake_build/subdirectory_embed/CMakeLists.txt38
1 files changed, 26 insertions, 12 deletions
diff --git a/3rdparty/pybind11/tests/test_cmake_build/subdirectory_embed/CMakeLists.txt b/3rdparty/pybind11/tests/test_cmake_build/subdirectory_embed/CMakeLists.txt
index 88ba60dd..c7df0cf7 100644
--- a/3rdparty/pybind11/tests/test_cmake_build/subdirectory_embed/CMakeLists.txt
+++ b/3rdparty/pybind11/tests/test_cmake_build/subdirectory_embed/CMakeLists.txt
@@ -1,25 +1,39 @@
-cmake_minimum_required(VERSION 3.0)
+cmake_minimum_required(VERSION 3.4)
+
+# The `cmake_minimum_required(VERSION 3.4...3.18)` 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)
+ cmake_policy(VERSION ${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION})
+else()
+ cmake_policy(VERSION 3.18)
+endif()
+
project(test_subdirectory_embed CXX)
-set(PYBIND11_INSTALL ON CACHE BOOL "")
+set(PYBIND11_INSTALL
+ ON
+ CACHE BOOL "")
set(PYBIND11_EXPORT_NAME test_export)
add_subdirectory(${PYBIND11_PROJECT_DIR} pybind11)
# Test basic target functionality
-add_executable(test_cmake_build ../embed.cpp)
-target_link_libraries(test_cmake_build PRIVATE pybind11::embed)
+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 $<TARGET_FILE:test_cmake_build> ${PROJECT_SOURCE_DIR}/../test.py)
+add_custom_target(check_subdirectory_embed $<TARGET_FILE:test_subdirectory_embed>
+ ${PROJECT_SOURCE_DIR}/../test.py)
# Test custom export group -- PYBIND11_EXPORT_NAME
add_library(test_embed_lib ../embed.cpp)
target_link_libraries(test_embed_lib PRIVATE pybind11::embed)
-install(TARGETS test_embed_lib
- EXPORT test_export
- ARCHIVE DESTINATION bin
- LIBRARY DESTINATION lib
- RUNTIME DESTINATION lib)
-install(EXPORT test_export
- DESTINATION lib/cmake/test_export/test_export-Targets.cmake)
+install(
+ TARGETS test_embed_lib
+ EXPORT test_export
+ ARCHIVE DESTINATION bin
+ LIBRARY DESTINATION lib
+ RUNTIME DESTINATION lib)
+install(EXPORT test_export DESTINATION lib/cmake/test_export/test_export-Targets.cmake)