3
在的CMakeLists.txt,我想檢查bzlib.h存在:如何在包含文件不存在時優雅地失敗CMake?
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()
你應該可以解決'if',將其改爲'如果(不是HAVE_BZLIB_H )'。 – Zhen