From 197c8c54aade9d5aa05f53a867a39dff91af2c64 Mon Sep 17 00:00:00 2001 From: Michael Graeb Date: Fri, 20 Dec 2024 14:42:00 -0800 Subject: [PATCH] Various CMake improvements --- CMakeLists.txt | 29 +++++------------------------ crt/aws-c-auth | 2 +- crt/aws-c-cal | 2 +- crt/aws-c-common | 2 +- crt/aws-c-compression | 2 +- crt/aws-c-event-stream | 2 +- crt/aws-c-http | 2 +- crt/aws-c-io | 2 +- crt/aws-c-mqtt | 2 +- crt/aws-c-s3 | 2 +- crt/aws-c-sdkutils | 2 +- crt/aws-checksums | 2 +- 12 files changed, 16 insertions(+), 35 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 11e0c451f..22dc91a1c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,26 +1,10 @@ -cmake_minimum_required(VERSION 3.9) +cmake_minimum_required(VERSION 3.9...3.31) project(aws-crt-jni C) option(BUILD_DEPS "Builds aws common runtime dependencies as part of build" ON) option(CRT_FIPS "Whether to build aws-lc with FIPS compliance" OFF) -if (POLICY CMP0077) - cmake_policy(SET CMP0077 NEW) # Enable options to get their values from normal variables -endif() - -if (DEFINED CMAKE_PREFIX_PATH) - file(TO_CMAKE_PATH "${CMAKE_PREFIX_PATH}" CMAKE_PREFIX_PATH) -endif() - -if (DEFINED CMAKE_INSTALL_PREFIX) - 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() +include(GNUInstallDirs) if (${CMAKE_INSTALL_LIBDIR} STREQUAL "lib64") set(FIND_LIBRARY_USE_LIB64_PATHS true) @@ -32,12 +16,6 @@ endif() message(STATUS "CMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}") -# 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}) - # Local CMake scripts list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}/cmake") @@ -111,6 +89,9 @@ if (BUILD_DEPS) add_subdirectory(crt/aws-c-event-stream) add_subdirectory(crt/aws-c-s3) else() + # this is required so we can use aws-c-common's CMake modules + find_package(aws-c-common REQUIRED) + include(AwsFindPackage) include(AwsCFlags) set(IN_SOURCE_BUILD OFF) diff --git a/crt/aws-c-auth b/crt/aws-c-auth index 3982bd75f..649141bd0 160000 --- a/crt/aws-c-auth +++ b/crt/aws-c-auth @@ -1 +1 @@ -Subproject commit 3982bd75fea74efd8f9b462b27fedd4599db4f53 +Subproject commit 649141bd0707d10e96e97b064f6c0e29cf1da06e diff --git a/crt/aws-c-cal b/crt/aws-c-cal index fbbe2612a..d298e9fff 160000 --- a/crt/aws-c-cal +++ b/crt/aws-c-cal @@ -1 +1 @@ -Subproject commit fbbe2612a3385d1ded02a52d20ad7fd2da4501f4 +Subproject commit d298e9fffe78c4ded49ead7aded40aebd632c466 diff --git a/crt/aws-c-common b/crt/aws-c-common index 7a6f5df20..2b3320d43 160000 --- a/crt/aws-c-common +++ b/crt/aws-c-common @@ -1 +1 @@ -Subproject commit 7a6f5df201cb4b1910932ea3221de83edaa39880 +Subproject commit 2b3320d43bd21286d7a2467096a66cd70df6160c diff --git a/crt/aws-c-compression b/crt/aws-c-compression index c6c1191e5..08325948d 160000 --- a/crt/aws-c-compression +++ b/crt/aws-c-compression @@ -1 +1 @@ -Subproject commit c6c1191e525e5aa6ead9e1afc392e35d3b50331e +Subproject commit 08325948dc473192a65abadc684d2a4e4219d5ef diff --git a/crt/aws-c-event-stream b/crt/aws-c-event-stream index d2dcc9344..67e37f5f7 160000 --- a/crt/aws-c-event-stream +++ b/crt/aws-c-event-stream @@ -1 +1 @@ -Subproject commit d2dcc9344dae24de320866045d85166d8a91a0d1 +Subproject commit 67e37f5f78a8052fb226aced94a927167c268439 diff --git a/crt/aws-c-http b/crt/aws-c-http index fc3eded24..f1a200863 160000 --- a/crt/aws-c-http +++ b/crt/aws-c-http @@ -1 +1 @@ -Subproject commit fc3eded2465c37d07fd9cc15e9b5b011224c9c9a +Subproject commit f1a2008634229fe344e42fa27881aa8520ccd60e diff --git a/crt/aws-c-io b/crt/aws-c-io index fcb38c804..42df65be5 160000 --- a/crt/aws-c-io +++ b/crt/aws-c-io @@ -1 +1 @@ -Subproject commit fcb38c804364dd627c335da752a99a125a88f6e9 +Subproject commit 42df65be533b481ac0d5b372793034c5f501ba41 diff --git a/crt/aws-c-mqtt b/crt/aws-c-mqtt index 627c3334e..2cbd0a5c3 160000 --- a/crt/aws-c-mqtt +++ b/crt/aws-c-mqtt @@ -1 +1 @@ -Subproject commit 627c3334e52021aa8d5772b6ca076884610f3219 +Subproject commit 2cbd0a5c3487ec26c661b0053e5fd5bf4d71d04e diff --git a/crt/aws-c-s3 b/crt/aws-c-s3 index 33b8cd07c..bbbe267fe 160000 --- a/crt/aws-c-s3 +++ b/crt/aws-c-s3 @@ -1 +1 @@ -Subproject commit 33b8cd07c53068e1408f85ae956c44c9753df0f3 +Subproject commit bbbe267fe9e988e5c48646e066e25ccfef01890b diff --git a/crt/aws-c-sdkutils b/crt/aws-c-sdkutils index ce09f7976..29b0143f1 160000 --- a/crt/aws-c-sdkutils +++ b/crt/aws-c-sdkutils @@ -1 +1 @@ -Subproject commit ce09f79768653dbdc810fc14cad8685dd90acba1 +Subproject commit 29b0143f10fb2e616ee681ea28376fbee1532d3a diff --git a/crt/aws-checksums b/crt/aws-checksums index 3e4101b9f..727970ae9 160000 --- a/crt/aws-checksums +++ b/crt/aws-checksums @@ -1 +1 @@ -Subproject commit 3e4101b9f85a2c090774d27ae2131fca1082f522 +Subproject commit 727970ae9d62470e3f1b250764e9e873f3e3cd12