From df51efe703d79a8f6db52d4a35d3bbc8d3330050 Mon Sep 17 00:00:00 2001 From: Michael Graeb Date: Fri, 20 Dec 2024 14:49:48 -0800 Subject: [PATCH] CMake improvements --- CMakeLists.txt | 19 +++++-------------- 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-sdkutils | 2 +- crt/aws-checksums | 2 +- 11 files changed, 15 insertions(+), 24 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 8c23e5db..0a25edb3 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.9) +cmake_minimum_required(VERSION 3.9...3.31) project(aws-crt-nodejs C) option(BUILD_DEPS "Builds aws common runtime dependencies as part of build, only do this if you don't want to control your dependency chain." ON) @@ -14,22 +14,12 @@ if (NOT CMAKE_BUILD_TYPE) set(CMAKE_BUILD_TYPE RelWithDebInfo) 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) 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}) - set(CMAKE_INSTALL_PREFIX "${CMAKE_CURRENT_SOURCE_DIR}/dist") if (BUILD_DEPS) @@ -76,12 +66,13 @@ if (BUILD_DEPS) set(BUILD_TESTING ${BUILD_TESTING_PREV}) else() + # this is required so we can use aws-c-common's CMake modules + find_package(aws-c-common REQUIRED) + include(AwsFindPackage) set(IN_SOURCE_BUILD OFF) endif() -list(APPEND CMAKE_MODULE_PATH "${CMAKE_PREFIX_PATH}/${CMAKE_INSTALL_LIBDIR}/cmake") - include(AwsCFlags) include(AwsSharedLibSetup) include(AwsSanitizers) diff --git a/crt/aws-c-auth b/crt/aws-c-auth index 3982bd75..649141bd 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 656762ae..d298e9ff 160000 --- a/crt/aws-c-cal +++ b/crt/aws-c-cal @@ -1 +1 @@ -Subproject commit 656762aefbee2bc8f509cb23cd107abff20a72bb +Subproject commit d298e9fffe78c4ded49ead7aded40aebd632c466 diff --git a/crt/aws-c-common b/crt/aws-c-common index 63187b97..2b3320d4 160000 --- a/crt/aws-c-common +++ b/crt/aws-c-common @@ -1 +1 @@ -Subproject commit 63187b976a482309e23296c5f967fc19c4131746 +Subproject commit 2b3320d43bd21286d7a2467096a66cd70df6160c diff --git a/crt/aws-c-compression b/crt/aws-c-compression index c6c1191e..08325948 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 d2dcc934..67e37f5f 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 fc3eded2..f1a20086 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 fcb38c80..42df65be 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 627c3334..2cbd0a5c 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-sdkutils b/crt/aws-c-sdkutils index 0818f28e..29b0143f 160000 --- a/crt/aws-c-sdkutils +++ b/crt/aws-c-sdkutils @@ -1 +1 @@ -Subproject commit 0818f28ee436b892f09fbe8e3a6ae37ff40e9436 +Subproject commit 29b0143f10fb2e616ee681ea28376fbee1532d3a diff --git a/crt/aws-checksums b/crt/aws-checksums index 0d2f5521..727970ae 160000 --- a/crt/aws-checksums +++ b/crt/aws-checksums @@ -1 +1 @@ -Subproject commit 0d2f5521f61215f38f791d106ae304402208112d +Subproject commit 727970ae9d62470e3f1b250764e9e873f3e3cd12