| 1 |
# Ensure that an include file is provided by the system |
| 2 |
# Add the check about the mandatory status to the check_include_file macro |
| 3 |
# provided by cmake |
| 4 |
|
| 5 |
include (${CMAKE_ROOT}/Modules/CheckIncludeFile.cmake) |
| 6 |
|
| 7 |
macro(ensure_file_include INCLUDE_FILENAME VARIABLE_NAME MANDATORY_STATUS) |
| 8 |
|
| 9 |
#message(WARNING "INCLUDE_FILENAME=${INCLUDE_FILENAME} \n" |
| 10 |
# "VARIABLE_NAME=${VARIABLE_NAME} \n" |
| 11 |
# "MANDATORY_STATUS=${MANDATORY_STATUS}") |
| 12 |
|
| 13 |
CHECK_INCLUDE_FILE(${INCLUDE_FILENAME} ${VARIABLE_NAME}) |
| 14 |
|
| 15 |
#message(WARNING "INCLUDE_FILENAME=${INCLUDE_FILENAME} \n" |
| 16 |
# "VARIABLE_NAME=${VARIABLE_NAME} \n" |
| 17 |
# "VARIABLE_NAME_VALUE=${${VARIABLE_NAME}} \n" |
| 18 |
# "MANDATORY_STATUS=${MANDATORY_STATUS}") |
| 19 |
|
| 20 |
if (NOT ${${VARIABLE_NAME}}) |
| 21 |
if (${MANDATORY_STATUS}) |
| 22 |
message(FATAL_ERROR "The file ${INCLUDE_FILENAME} is mandatory but not found on your system") |
| 23 |
endif() |
| 24 |
endif() |
| 25 |
|
| 26 |
endmacro() |