2013-03-13 16:21:20 +01:00
|
|
|
# Ensure that an include file is provided by the system
|
2016-05-02 16:03:16 +02:00
|
|
|
# Add the check about the mandatory status to the check_include_file macro
|
2013-03-13 16:21:20 +01:00
|
|
|
# provided by cmake
|
|
|
|
|
|
|
|
include (${CMAKE_ROOT}/Modules/CheckIncludeFile.cmake)
|
|
|
|
|
|
|
|
macro(ensure_file_include INCLUDE_FILENAME VARIABLE_NAME MANDATORY_STATUS)
|
|
|
|
|
|
|
|
#message(WARNING "INCLUDE_FILENAME=${INCLUDE_FILENAME} \n"
|
|
|
|
# "VARIABLE_NAME=${VARIABLE_NAME} \n"
|
|
|
|
# "MANDATORY_STATUS=${MANDATORY_STATUS}")
|
|
|
|
|
|
|
|
CHECK_INCLUDE_FILE(${INCLUDE_FILENAME} ${VARIABLE_NAME})
|
|
|
|
|
|
|
|
#message(WARNING "INCLUDE_FILENAME=${INCLUDE_FILENAME} \n"
|
|
|
|
# "VARIABLE_NAME=${VARIABLE_NAME} \n"
|
|
|
|
# "VARIABLE_NAME_VALUE=${${VARIABLE_NAME}} \n"
|
|
|
|
# "MANDATORY_STATUS=${MANDATORY_STATUS}")
|
|
|
|
|
|
|
|
if (NOT ${${VARIABLE_NAME}})
|
|
|
|
if (${MANDATORY_STATUS})
|
|
|
|
message(FATAL_ERROR "The file ${INCLUDE_FILENAME} is mandatory but not found on your system")
|
|
|
|
endif()
|
|
|
|
endif()
|
|
|
|
|
2016-05-02 16:03:16 +02:00
|
|
|
endmacro()
|