File: ConfigChecks.cmake

package info (click to toggle)
inkscape 1.4.2-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 402,900 kB
  • sloc: cpp: 547,256; python: 72,677; ansic: 63,355; javascript: 3,864; xml: 2,345; sh: 1,667; makefile: 824; perl: 614
file content (26 lines) | stat: -rw-r--r-- 1,320 bytes parent folder | download | duplicates (2)
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
include(${CMAKE_CURRENT_LIST_DIR}/ConfigPaths.cmake)

# Set all HAVE_XXX variables, to correctly set all defines in config.h
include(CheckIncludeFiles)
include(CheckIncludeFileCXX)
include(CheckFunctionExists)
include(CheckStructHasMember)
include(CheckCXXSymbolExists)

set(CMAKE_REQUIRED_LIBRARIES ${CMAKE_REQUIRED_LIBRARIES} ${INKSCAPE_LIBS})
set(CMAKE_REQUIRED_INCLUDES ${CMAKE_REQUIRED_INCLUDES} ${INKSCAPE_INCS_SYS})

CHECK_INCLUDE_FILES(ieeefp.h HAVE_IEEEFP_H)
CHECK_FUNCTION_EXISTS(mallinfo HAVE_MALLINFO)
CHECK_FUNCTION_EXISTS(mallinfo2 HAVE_MALLINFO2)
CHECK_INCLUDE_FILES(malloc.h HAVE_MALLOC_H)
CHECK_STRUCT_HAS_MEMBER("struct mallinfo" fordblks malloc.h HAVE_STRUCT_MALLINFO_FORDBLKS )
CHECK_STRUCT_HAS_MEMBER("struct mallinfo" fsmblks  malloc.h HAVE_STRUCT_MALLINFO_FSMBLKS  )
CHECK_STRUCT_HAS_MEMBER("struct mallinfo" hblkhd   malloc.h HAVE_STRUCT_MALLINFO_HBLKHD   )
CHECK_STRUCT_HAS_MEMBER("struct mallinfo" uordblks malloc.h HAVE_STRUCT_MALLINFO_UORDBLKS )
CHECK_STRUCT_HAS_MEMBER("struct mallinfo" usmblks  malloc.h HAVE_STRUCT_MALLINFO_USMBLKS  )
CHECK_CXX_SYMBOL_EXISTS(sincos math.h HAVE_SINCOS)  # 2geom define

# Create the configuration files config.h in the binary root dir
configure_file(${CMAKE_SOURCE_DIR}/config.h.cmake ${CMAKE_BINARY_DIR}/include/config.h)
add_definitions(-DHAVE_CONFIG_H)