From 82c778501452d96612265c565d54ce47d4547b43 Mon Sep 17 00:00:00 2001 From: Dave Abrahams Date: Wed, 3 Apr 2024 13:35:48 -0700 Subject: [PATCH 1/2] Suppress needlessly alarming messages These packages are not marked `REQUIRED` and when this project is used as a dependency of another CMake project they don't need to be findable when this CMakeLists.txt is read. They may in fact be found later in the configuration process, so the messages when they actually _are_ needed, so the messages ``` -- Could NOT find dispatch (missing: dispatch_DIR) -- Could NOT find Foundation (missing: Foundation_DIR) -- Could NOT find XCTest (missing: XCTest_DIR) ``` are needlessly alarming. --- CMakeLists.txt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 12b618f38..936bb40b8 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -21,9 +21,9 @@ include(CTest) include(GNUInstallDirs) include(SwiftSupport) -find_package(dispatch CONFIG) -find_package(Foundation CONFIG) -find_package(XCTest CONFIG) +find_package(dispatch QUIET CONFIG) +find_package(Foundation QUIET CONFIG) +find_package(XCTest QUIET CONFIG) add_subdirectory(Sources) if(BUILD_EXAMPLES) From cc27d1ec002305513ebdd3bcca8e4030e61532d5 Mon Sep 17 00:00:00 2001 From: Dave Abrahams Date: Fri, 27 Sep 2024 11:54:05 -0700 Subject: [PATCH 2/2] Take @compnerd's suggestion Co-authored-by: Saleem Abdulrasool --- CMakeLists.txt | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 936bb40b8..2f2604202 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -21,9 +21,13 @@ include(CTest) include(GNUInstallDirs) include(SwiftSupport) -find_package(dispatch QUIET CONFIG) -find_package(Foundation QUIET CONFIG) -find_package(XCTest QUIET CONFIG) +if(NOT APPLE) + find_package(dispatch CONFIG) + find_package(Foundation CONFIG) + if(BUILD_TESTING) + find_package(XCTest CONFIG) + endif() +endif() add_subdirectory(Sources) if(BUILD_EXAMPLES)