SHA256
1
0
forked from pool/aws-c-auth
aws-c-auth/aca_fix-cmake-modules-path.patch

46 lines
1.6 KiB
Diff

diff -Nru aws-c-auth-0.6.4.orig/CMakeLists.txt aws-c-auth-0.6.4/CMakeLists.txt
--- aws-c-auth-0.6.4.orig/CMakeLists.txt 2021-08-31 21:05:57.000000000 +0000
+++ aws-c-auth-0.6.4/CMakeLists.txt 2021-10-12 12:14:56.438749566 +0000
@@ -14,18 +14,11 @@
file(TO_CMAKE_PATH "${CMAKE_INSTALL_PREFIX}" CMAKE_INSTALL_PREFIX)
endif()
-
-if (UNIX AND NOT APPLE)
- include(GNUInstallDirs)
-elseif(NOT DEFINED CMAKE_INSTALL_LIBDIR)
- set(CMAKE_INSTALL_LIBDIR "lib")
-endif()
-
-# This is required in order to append /lib/cmake to each element in CMAKE_PREFIX_PATH
-set(AWS_MODULE_DIR "/${CMAKE_INSTALL_LIBDIR}/cmake")
-string(REPLACE ";" "${AWS_MODULE_DIR};" AWS_MODULE_PATH "${CMAKE_PREFIX_PATH}${AWS_MODULE_DIR}")
-# Append that generated list to the module search path
-list(APPEND CMAKE_MODULE_PATH ${AWS_MODULE_PATH})
+find_package(aws-c-common REQUIRED)
+set(CMAKE_MODULE_PATH ${aws-c-common_DIR})
+
+list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}/cmake/modules")
+include(GNUInstallDirs)
include(AwsCFlags)
include(AwsCheckHeaders)
@@ -118,7 +111,7 @@
endif()
install(EXPORT "${PROJECT_NAME}-targets"
- DESTINATION "${LIBRARY_DIRECTORY}/${PROJECT_NAME}/cmake/${TARGET_DIR}/"
+ DESTINATION "${LIB_INSTALL_DIR}/cmake/${CMAKE_PROJECT_NAME}/${TARGET_DIR}/"
NAMESPACE AWS::
COMPONENT Development)
@@ -127,7 +120,7 @@
@ONLY)
install(FILES "${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}-config.cmake"
- DESTINATION "${LIBRARY_DIRECTORY}/${PROJECT_NAME}/cmake/"
+ DESTINATION "${LIB_INSTALL_DIR}/cmake/${CMAKE_PROJECT_NAME}"
COMPONENT Development)
include(CTest)