File: EnsureFileInclude.cmake

package info (click to toggle)
gdcm 3.0.21-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 26,880 kB
  • sloc: cpp: 203,477; ansic: 78,582; xml: 48,129; python: 3,459; cs: 2,308; java: 1,629; lex: 1,290; sh: 334; php: 128; makefile: 117
file content (26 lines) | stat: -rw-r--r-- 928 bytes parent folder | download | duplicates (15)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
# Ensure that an include file is provided by the system
# Add the check about the mandatory status to the check_include_file macro
# 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()

endmacro()