From e3190537b378ef2fbaf36cb9392f8f61911703ba Mon Sep 17 00:00:00 2001 From: Igor Abdrakhimov Date: Thu, 30 Jan 2025 10:36:07 -0800 Subject: [PATCH] Cmake modules (#598) --- CMakeLists.txt | 23 +++++------------------ 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(+), 28 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 8c23e5db..dbda8fa9 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,21 +14,7 @@ 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() - -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}) +include(GNUInstallDirs) set(CMAKE_INSTALL_PREFIX "${CMAKE_CURRENT_SOURCE_DIR}/dist") @@ -76,12 +62,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 274a1d21..b513db4b 160000 --- a/crt/aws-c-auth +++ b/crt/aws-c-auth @@ -1 +1 @@ -Subproject commit 274a1d21330731cc51bb742794adc70ada5f4380 +Subproject commit b513db4bf82429a1134fecbd6d12e5fda45255a6 diff --git a/crt/aws-c-cal b/crt/aws-c-cal index fbbe2612..7299c6ab 160000 --- a/crt/aws-c-cal +++ b/crt/aws-c-cal @@ -1 +1 @@ -Subproject commit fbbe2612a3385d1ded02a52d20ad7fd2da4501f4 +Subproject commit 7299c6ab9244595b140d604475cdd6c6921be8ae diff --git a/crt/aws-c-common b/crt/aws-c-common index 5e6c0818..0e7637fa 160000 --- a/crt/aws-c-common +++ b/crt/aws-c-common @@ -1 +1 @@ -Subproject commit 5e6c08186fa5d8c7679acf95b86ada4119ca23b8 +Subproject commit 0e7637fa852a472bd4c37fc07a325a09c942a5fc diff --git a/crt/aws-c-compression b/crt/aws-c-compression index c6c1191e..f951ab2b 160000 --- a/crt/aws-c-compression +++ b/crt/aws-c-compression @@ -1 +1 @@ -Subproject commit c6c1191e525e5aa6ead9e1afc392e35d3b50331e +Subproject commit f951ab2b819fc6993b6e5e6cfef64b1a1554bfc8 diff --git a/crt/aws-c-event-stream b/crt/aws-c-event-stream index d2dcc934..9422ef78 160000 --- a/crt/aws-c-event-stream +++ b/crt/aws-c-event-stream @@ -1 +1 @@ -Subproject commit d2dcc9344dae24de320866045d85166d8a91a0d1 +Subproject commit 9422ef78aac566414d1bebb1a5431a4c53a7547c diff --git a/crt/aws-c-http b/crt/aws-c-http index fc3eded2..590c7b59 160000 --- a/crt/aws-c-http +++ b/crt/aws-c-http @@ -1 +1 @@ -Subproject commit fc3eded2465c37d07fd9cc15e9b5b011224c9c9a +Subproject commit 590c7b597f87e5edc080b8b77418690c30319832 diff --git a/crt/aws-c-io b/crt/aws-c-io index fcb38c80..3041dabf 160000 --- a/crt/aws-c-io +++ b/crt/aws-c-io @@ -1 +1 @@ -Subproject commit fcb38c804364dd627c335da752a99a125a88f6e9 +Subproject commit 3041dabfc13fe9bc9a0467e15aa1d5a09c7fc06f diff --git a/crt/aws-c-mqtt b/crt/aws-c-mqtt index 9c093c40..83247bde 160000 --- a/crt/aws-c-mqtt +++ b/crt/aws-c-mqtt @@ -1 +1 @@ -Subproject commit 9c093c4039478c04c7e55a1825c391dd4742fd61 +Subproject commit 83247bde8268905018327891fcf0147f3e438a80 diff --git a/crt/aws-c-sdkutils b/crt/aws-c-sdkutils index 1ae8664f..ba6a28fa 160000 --- a/crt/aws-c-sdkutils +++ b/crt/aws-c-sdkutils @@ -1 +1 @@ -Subproject commit 1ae8664f90cb5ab5e23b161a31e021c6d3a28e72 +Subproject commit ba6a28fab7ed5d7f1b3b1d12eb672088be093824 diff --git a/crt/aws-checksums b/crt/aws-checksums index 3e4101b9..fb8bd0b8 160000 --- a/crt/aws-checksums +++ b/crt/aws-checksums @@ -1 +1 @@ -Subproject commit 3e4101b9f85a2c090774d27ae2131fca1082f522 +Subproject commit fb8bd0b8cff00c8c24a35d601fce1b4c611df6da