aboutsummaryrefslogtreecommitdiffstats
path: root/3rdparty/pybind11/tools/FindCatch.cmake
diff options
context:
space:
mode:
authorMiodrag Milanović <mmicko@gmail.com>2021-01-02 11:16:49 +0100
committerGitHub <noreply@github.com>2021-01-02 11:16:49 +0100
commit9b9628047c01a970cfe20f83f2b7129ed109440d (patch)
tree1db418e9a889dc6fbe6199c5259aac9bd8cbb32f /3rdparty/pybind11/tools/FindCatch.cmake
parentc6cdf30501dcb2da01361229dd66a05dad73a132 (diff)
parent61b07bc9a664d6a88b85aae99f9756d7569688a9 (diff)
downloadnextpnr-9b9628047c01a970cfe20f83f2b7129ed109440d.tar.gz
nextpnr-9b9628047c01a970cfe20f83f2b7129ed109440d.tar.bz2
nextpnr-9b9628047c01a970cfe20f83f2b7129ed109440d.zip
Merge pull request #549 from YosysHQ/update
Update pybind11 version and fix for future python versions
Diffstat (limited to '3rdparty/pybind11/tools/FindCatch.cmake')
-rw-r--r--3rdparty/pybind11/tools/FindCatch.cmake21
1 files changed, 17 insertions, 4 deletions
diff --git a/3rdparty/pybind11/tools/FindCatch.cmake b/3rdparty/pybind11/tools/FindCatch.cmake
index 9d490c5a..4d6bffcf 100644
--- a/3rdparty/pybind11/tools/FindCatch.cmake
+++ b/3rdparty/pybind11/tools/FindCatch.cmake
@@ -19,9 +19,14 @@ endif()
# Extract the version number from catch.hpp
function(_get_catch_version)
- file(STRINGS "${CATCH_INCLUDE_DIR}/catch.hpp" version_line REGEX "Catch v.*" LIMIT_COUNT 1)
+ file(
+ STRINGS "${CATCH_INCLUDE_DIR}/catch.hpp" version_line
+ REGEX "Catch v.*"
+ LIMIT_COUNT 1)
if(version_line MATCHES "Catch v([0-9]+)\\.([0-9]+)\\.([0-9]+)")
- set(CATCH_VERSION "${CMAKE_MATCH_1}.${CMAKE_MATCH_2}.${CMAKE_MATCH_3}" PARENT_SCOPE)
+ set(CATCH_VERSION
+ "${CMAKE_MATCH_1}.${CMAKE_MATCH_2}.${CMAKE_MATCH_3}"
+ PARENT_SCOPE)
endif()
endfunction()
@@ -34,11 +39,16 @@ function(_download_catch version destination_dir)
if(error)
message(FATAL_ERROR "Could not download ${url}")
endif()
- set(CATCH_INCLUDE_DIR "${destination_dir}" CACHE INTERNAL "")
+ set(CATCH_INCLUDE_DIR
+ "${destination_dir}"
+ CACHE INTERNAL "")
endfunction()
# Look for catch locally
-find_path(CATCH_INCLUDE_DIR NAMES catch.hpp PATH_SUFFIXES catch)
+find_path(
+ CATCH_INCLUDE_DIR
+ NAMES catch.hpp
+ PATH_SUFFIXES catch2)
if(CATCH_INCLUDE_DIR)
_get_catch_version()
endif()
@@ -54,4 +64,7 @@ if(NOT CATCH_VERSION OR CATCH_VERSION VERSION_LESS ${Catch_FIND_VERSION})
endif()
endif()
+add_library(Catch2::Catch2 IMPORTED INTERFACE)
+set_property(TARGET Catch2::Catch2 PROPERTY INTERFACE_INCLUDE_DIRECTORIES "${CATCH_INCLUDE_DIR}")
+
set(CATCH_FOUND TRUE)