File: EnsureFileInclude.cmake

package info (click to toggle)
openjpeg2 2.5.3-2
  • links: PTS, VCS
  • area: main
  • in suites: sid, trixie
  • size: 10,556 kB
  • sloc: ansic: 150,768; cpp: 7,019; java: 1,996; sh: 615; python: 198; makefile: 69
file content (26 lines) | stat: -rw-r--r-- 928 bytes parent folder | download | duplicates (13)
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()