How to flatten CMake gracefully when include file doesn't exist?

In CMakeLists.txt, I would like to check if bzlib.h exists:

include(CheckIncludeFiles)
check_include_file(bzlib.h HAVE_BZLIB_H)
if(NOT HAVE_BZLIB_H)
    # How can I exit cmake with an error message if bzlib.h does not exists?
endif()

      

+3


source to share


1 answer


It's pretty easy: message( FATAL_ERROR "Your message" )



+7


source







All Articles