Skip to content

Commit 52b9abd

Browse files
committed
find_program and find_library can now use REQUIRED
1 parent c2ceca8 commit 52b9abd

File tree

1 file changed

+3
-12
lines changed

1 file changed

+3
-12
lines changed

CMakeLists.txt

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -216,13 +216,7 @@ endif()
216216

217217
# find a required executable dependency
218218
function(find_exec_dependency var)
219-
# REQUIRED option was not added until 3.18
220-
find_program(${var} NAMES ${ARGN})
221-
if (${var})
222-
message(STATUS "Found ${var}: ${${var}}")
223-
else()
224-
message(FATAL_ERROR "Required program ${var} not found.")
225-
endif()
219+
find_program(${var} NAMES ${ARGN} REQUIRED)
226220
endfunction()
227221

228222
# from coreutils, so should always be available, and if
@@ -447,11 +441,8 @@ set(COMMON_LIBRARIES
447441

448442
if (DEP_AI)
449443
if (APPLE)
450-
find_library(METAL Metal) # REQUIRED was not added until CMake 3.18
451-
if (NOT METAL)
452-
message(FATAL_ERROR "Could not find Metal Framework")
453-
endif()
454-
find_library(ACCELERATE Accelerate) # REQUIRED was not added until CMake 3.18
444+
find_library(METAL Metal REQUIRED)
445+
find_library(ACCELERATE Accelerate REQUIRED)
455446
if (NOT ACCELERATE)
456447
message(FATAL_ERROR "Could not find Accelerate Framework")
457448
endif()

0 commit comments

Comments
 (0)