Skip to content

Commit

Permalink
More helpful error message when NASM not found
Browse files Browse the repository at this point in the history
  • Loading branch information
marcelm committed Aug 31, 2024
1 parent 5e34582 commit d236185
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -74,14 +74,21 @@ add_library(salib STATIC ${SOURCES}
if(ISAL STREQUAL "system")
pkg_check_modules(ISAL IMPORTED_TARGET GLOBAL libisal>=2.30.0)
if (NOT ISAL_FOUND)
message(FATAL_ERROR "libisal (ISA-L) could not be found. Either install "
"the library using your package manager or add '-DISAL=download' to "
message(FATAL_ERROR "libisal (ISA-L) could not be found. You have two options:\n"
"- Install the library using your package manager (try 'sudo apt install "
"libisal-dev' or 'brew install isa-l')\n"
"- or add '-DISAL=download' to "
"the CMake options in order to download ISA-L at build time."
)
endif()
add_library(ISAL ALIAS PkgConfig::ISAL)
elseif(ISAL STREQUAL "download")
find_program(NASM_program NAMES nasm REQUIRED)
find_program(NASM NAMES nasm)
if (NOT NASM_FOUND)
message(FATAL_ERROR "NASM is required to build ISA-L. Try 'sudo apt "
"install nasm' or 'brew install nasm'"
)
endif()
set(ISAL_ROOT ${CMAKE_BINARY_DIR}/ISAL)
ExternalProject_Add(
isal_external
Expand Down

0 comments on commit d236185

Please sign in to comment.