depot/third_party/nixpkgs/pkgs/development/libraries/aws-sdk-cpp/cmake-dirs.patch
Default email 66604c92c1 Project import generated by Copybara.
GitOrigin-RevId: 32b8ed738096bafb4cdb7f70347a0f63f9f40151
2020-05-15 23:57:56 +02:00

75 lines
3.6 KiB
Diff

diff --git a/cmake/AWSSDKConfig.cmake b/cmake/AWSSDKConfig.cmake
index e87252123e..5457bd5910 100644
--- a/cmake/AWSSDKConfig.cmake
+++ b/cmake/AWSSDKConfig.cmake
@@ -82,6 +82,7 @@ if (AWSSDK_ROOT_DIR)
)
else()
find_file(AWSSDK_CORE_HEADER_FILE Aws.h
+ "/${AWSSDK_INSTALL_INCLUDEDIR}/aws/core"
"/usr/${AWSSDK_INSTALL_INCLUDEDIR}/aws/core"
"/usr/local/${AWSSDK_INSTALL_INCLUDEDIR}/aws/core"
"C:/Progra~1/AWSSDK/${AWSSDK_INSTALL_INCLUDEDIR}/aws/core"
@@ -97,14 +98,18 @@ if (NOT AWSSDK_CORE_HEADER_FILE)
message(FATAL_ERROR "AWS SDK for C++ is missing, please install it first")
endif()
-# based on core header file path, inspects the actual AWSSDK_ROOT_DIR
-get_filename_component(AWSSDK_ROOT_DIR "${AWSSDK_CORE_HEADER_FILE}" PATH)
-get_filename_component(AWSSDK_ROOT_DIR "${AWSSDK_ROOT_DIR}" PATH)
-get_filename_component(AWSSDK_ROOT_DIR "${AWSSDK_ROOT_DIR}" PATH)
-get_filename_component(AWSSDK_ROOT_DIR "${AWSSDK_ROOT_DIR}" PATH)
-
-if (NOT AWSSDK_ROOT_DIR)
- message(FATAL_ERROR "AWSSDK_ROOT_DIR is not set or can't be calculated from the path of core header file")
+if (IS_ABSOLUTE ${AWSSDK_INSTALL_LIBDIR})
+ set(AWSSDK_ROOT_DIR "")
+else()
+ # based on core header file path, inspects the actual AWSSDK_ROOT_DIR
+ get_filename_component(AWSSDK_ROOT_DIR "${AWSSDK_CORE_HEADER_FILE}" PATH)
+ get_filename_component(AWSSDK_ROOT_DIR "${AWSSDK_ROOT_DIR}" PATH)
+ get_filename_component(AWSSDK_ROOT_DIR "${AWSSDK_ROOT_DIR}" PATH)
+ get_filename_component(AWSSDK_ROOT_DIR "${AWSSDK_ROOT_DIR}" PATH)
+
+ if (NOT AWSSDK_ROOT_DIR)
+ message(FATAL_ERROR "AWSSDK_ROOT_DIR is not set or can't be calculated from the path of core header file")
+ endif()
endif()
diff --git a/cmake/utilities.cmake b/cmake/utilities.cmake
index 283a14a138..646aea1da3 100644
--- a/cmake/utilities.cmake
+++ b/cmake/utilities.cmake
@@ -43,7 +43,8 @@ macro(setup_install)
EXPORT "${PROJECT_NAME}-targets"
ARCHIVE DESTINATION ${ARCHIVE_DIRECTORY}
LIBRARY DESTINATION ${LIBRARY_DIRECTORY}
- RUNTIME DESTINATION ${BINARY_DIRECTORY} )
+ RUNTIME DESTINATION ${BINARY_DIRECTORY}
+ INCLUDES DESTINATION ${INCLUDE_DIRECTORY} )
if (BUILD_SHARED_LIBS)
install(
@@ -57,7 +58,8 @@ macro(setup_install)
install (TARGETS ${PROJECT_NAME}
ARCHIVE DESTINATION ${ARCHIVE_DIRECTORY}/${SDK_INSTALL_BINARY_PREFIX}/${PLATFORM_INSTALL_QUALIFIER}/\${CMAKE_INSTALL_CONFIG_NAME}
LIBRARY DESTINATION ${LIBRARY_DIRECTORY}/${SDK_INSTALL_BINARY_PREFIX}/${PLATFORM_INSTALL_QUALIFIER}/\${CMAKE_INSTALL_CONFIG_NAME}
- RUNTIME DESTINATION ${BINARY_DIRECTORY}/${SDK_INSTALL_BINARY_PREFIX}/${PLATFORM_INSTALL_QUALIFIER}/\${CMAKE_INSTALL_CONFIG_NAME})
+ RUNTIME DESTINATION ${BINARY_DIRECTORY}/${SDK_INSTALL_BINARY_PREFIX}/${PLATFORM_INSTALL_QUALIFIER}/\${CMAKE_INSTALL_CONFIG_NAME}
+ INCLUDES DESTINATION ${INCLUDE_DIRECTORY}/${SDK_INSTALL_BINARY_PREFIX}/${PLATFORM_INSTALL_QUALIFIER}/\${CMAKE_INSTALL_CONFIG_NAME})
endif()
endif()
endmacro()
diff --git a/toolchains/pkg-config.pc.in b/toolchains/pkg-config.pc.in
index 9b519d2772..a61069225c 100644
--- a/toolchains/pkg-config.pc.in
+++ b/toolchains/pkg-config.pc.in
@@ -1,5 +1,5 @@
-includedir=@CMAKE_INSTALL_PREFIX@/@INCLUDE_DIRECTORY@
-libdir=@CMAKE_INSTALL_PREFIX@/@LIBRARY_DIRECTORY@
+includedir=@INCLUDE_DIRECTORY@
+libdir=@LIBRARY_DIRECTORY@
Name: @PROJECT_NAME@
Description: @PROJECT_DESCRIPTION@