Skip to content

Commit e905148

Browse files
authored
Suppress needlessly alarming messages (#628)
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.
1 parent 05cfc38 commit e905148

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

CMakeLists.txt

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,13 @@ include(CTest)
2121
include(GNUInstallDirs)
2222
include(SwiftSupport)
2323

24-
find_package(dispatch CONFIG)
25-
find_package(Foundation CONFIG)
26-
find_package(XCTest CONFIG)
24+
if(NOT APPLE)
25+
find_package(dispatch CONFIG)
26+
find_package(Foundation CONFIG)
27+
if(BUILD_TESTING)
28+
find_package(XCTest CONFIG)
29+
endif()
30+
endif()
2731

2832
add_subdirectory(Sources)
2933
if(BUILD_EXAMPLES)

0 commit comments

Comments
 (0)