Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make generated CMake files valid when install paths are absolute #2630

Merged
merged 1 commit into from
Aug 22, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 12 additions & 8 deletions cmake/AWSSDKConfig.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -98,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()


Expand Down
4 changes: 2 additions & 2 deletions toolchains/pkg-config.pc.in
Original file line number Diff line number Diff line change
@@ -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@
Expand Down
Loading