|
| 1 | +diff --git a/src/build-data/botan-config.cmake.in b/src/build-data/botan-config.cmake.in |
| 2 | +index 8d14c4e..46e2cbc 100644 |
| 3 | +--- a/src/build-data/botan-config.cmake.in |
| 4 | ++++ b/src/build-data/botan-config.cmake.in |
| 5 | +@@ -65,21 +65,29 @@ if(DEFINED ${CMAKE_FIND_PACKAGE_NAME}_FOUND AND NOT ${${CMAKE_FIND_PACKAGE_NAME} |
| 6 | + return() |
| 7 | + endif() |
| 8 | + |
| 9 | +-# botan-config.cmake lives in "${_Botan_PREFIX}/lib/cmake/Botan-X": traverse up to $_Botan_PREFIX |
| 10 | ++# botan-config.cmake lives in "${_Botan_PREFIX}/share/botan": traverse up to $_Botan_PREFIX |
| 11 | + set(_Botan_PREFIX "${CMAKE_CURRENT_LIST_DIR}") |
| 12 | + get_filename_component(_Botan_PREFIX "${_Botan_PREFIX}" DIRECTORY) |
| 13 | + get_filename_component(_Botan_PREFIX "${_Botan_PREFIX}" DIRECTORY) |
| 14 | +-get_filename_component(_Botan_PREFIX "${_Botan_PREFIX}" DIRECTORY) |
| 15 | + |
| 16 | + %{if build_static_lib} |
| 17 | + if(NOT TARGET Botan::Botan-static) |
| 18 | + add_library(Botan::Botan-static STATIC IMPORTED) |
| 19 | + set_target_properties(Botan::Botan-static |
| 20 | + PROPERTIES |
| 21 | +- IMPORTED_LOCATION "${_Botan_PREFIX}/lib/%{static_lib_name}" |
| 22 | +- INTERFACE_INCLUDE_DIRECTORIES "${_Botan_PREFIX}/include/botan-%{version_major}" |
| 23 | ++ INTERFACE_INCLUDE_DIRECTORIES "${_Botan_PREFIX}/include" |
| 24 | + IMPORTED_LINK_INTERFACE_LANGUAGES "CXX" |
| 25 | + INTERFACE_LINK_OPTIONS "SHELL:%{cxx_abi_flags}") |
| 26 | ++ if(EXISTS "${_Botan_PREFIX}/debug/lib/%{static_lib_name}") |
| 27 | ++ set_property(TARGET Botan::Botan-static APPEND PROPERTY IMPORTED_CONFIGURATIONS DEBUG) |
| 28 | ++ set_target_properties(Botan::Botan-static PROPERTIES |
| 29 | ++ IMPORTED_LOCATION_DEBUG "${_Botan_PREFIX}/debug/lib/%{static_lib_name}" |
| 30 | ++ ) |
| 31 | ++ endif() |
| 32 | ++ set_property(TARGET Botan::Botan-static APPEND PROPERTY IMPORTED_CONFIGURATIONS RELEASE) |
| 33 | ++ set_target_properties(Botan::Botan-static PROPERTIES |
| 34 | ++ IMPORTED_LOCATION_RELEASE "${_Botan_PREFIX}/lib/%{static_lib_name}" |
| 35 | ++ ) |
| 36 | + endif() |
| 37 | + %{endif} |
| 38 | + |
| 39 | +@@ -100,10 +108,20 @@ if(NOT TARGET Botan::Botan) |
| 40 | + add_library(Botan::Botan SHARED IMPORTED) |
| 41 | + set_target_properties(Botan::Botan |
| 42 | + PROPERTIES |
| 43 | +- IMPORTED_LOCATION "${_Botan_shared_lib}" |
| 44 | +- IMPORTED_IMPLIB "${_Botan_implib}" |
| 45 | +- INTERFACE_INCLUDE_DIRECTORIES "${_Botan_PREFIX}/include/botan-%{version_major}" |
| 46 | ++ INTERFACE_INCLUDE_DIRECTORIES "${_Botan_PREFIX}/include" |
| 47 | + INTERFACE_LINK_OPTIONS "SHELL:%{cxx_abi_flags}") |
| 48 | ++ if(EXISTS "${_Botan_PREFIX}/debug/lib/%{implib_name}") |
| 49 | ++ set_property(TARGET Botan::Botan APPEND PROPERTY IMPORTED_CONFIGURATIONS DEBUG) |
| 50 | ++ set_target_properties(Botan::Botan PROPERTIES |
| 51 | ++ IMPORTED_IMPLIB_DEBUG "${_Botan_PREFIX}/debug/lib/%{implib_name}" |
| 52 | ++ IMPORTED_LOCATION_DEBUG "${_Botan_PREFIX}/debug/bin/%{shared_lib_name}" |
| 53 | ++ ) |
| 54 | ++ endif() |
| 55 | ++ set_property(TARGET Botan::Botan APPEND PROPERTY IMPORTED_CONFIGURATIONS RELEASE) |
| 56 | ++ set_target_properties(Botan::Botan PROPERTIES |
| 57 | ++ IMPORTED_IMPLIB_RELEASE "${_Botan_PREFIX}/lib/%{implib_name}" |
| 58 | ++ IMPORTED_LOCATION_RELEASE "${_Botan_PREFIX}/bin/%{shared_lib_name}" |
| 59 | ++ ) |
| 60 | + set_property(TARGET Botan::Botan APPEND PROPERTY IMPORTED_CONFIGURATIONS NOCONFIG) |
| 61 | + set_target_properties(Botan::Botan |
| 62 | + PROPERTIES |
0 commit comments