Let cmake handle checking for mandatory components

Both find_path() and find_library() accept REQUIRED argument, use it
instead of rolling our own.
This commit is contained in:
Panu Matilainen 2023-04-06 10:45:39 +03:00
parent 5e1addc048
commit c61da285a1
1 changed files with 2 additions and 5 deletions

View File

@ -194,11 +194,8 @@ endif()
if (WITH_IMAEVM)
list(APPEND REQFUNCS lsetxattr)
find_path(IMA_INCLUDE_DIR NAMES imaevm.h)
find_library(IMA_LIBRARY NAMES imaevm)
if (NOT (IMA_INCLUDE_DIR AND IMA_LIBRARY))
message(FATAL_ERROR "imaevm enabled but library not present")
endif()
find_path(IMA_INCLUDE_DIR NAMES imaevm.h REQUIRED)
find_library(IMA_LIBRARY NAMES imaevm REQUIRED)
endif()
find_program(__FIND_DEBUGINFO find-debuginfo)