summaryrefslogtreecommitdiffstats
path: root/CMakeScripts/ConfigChecks.cmake
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-27 16:29:01 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-27 16:29:01 +0000
commit35a96bde514a8897f6f0fcc41c5833bf63df2e2a (patch)
tree657d15a03cc46bd099fc2c6546a7a4ad43815d9f /CMakeScripts/ConfigChecks.cmake
parentInitial commit. (diff)
downloadinkscape-35a96bde514a8897f6f0fcc41c5833bf63df2e2a.tar.xz
inkscape-35a96bde514a8897f6f0fcc41c5833bf63df2e2a.zip
Adding upstream version 1.0.2.upstream/1.0.2upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'CMakeScripts/ConfigChecks.cmake')
-rw-r--r--CMakeScripts/ConfigChecks.cmake26
1 files changed, 26 insertions, 0 deletions
diff --git a/CMakeScripts/ConfigChecks.cmake b/CMakeScripts/ConfigChecks.cmake
new file mode 100644
index 0000000..2a023e8
--- /dev/null
+++ b/CMakeScripts/ConfigChecks.cmake
@@ -0,0 +1,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_INCLUDE_FILES(malloc.h HAVE_MALLOC_H)
+CHECK_INCLUDE_FILES(stdint.h HAVE_STDINT_H)
+CHECK_STRUCT_HAS_MEMBER(fordblks mallinfo malloc.h HAVE_STRUCT_MALLINFO_FORDBLKS)
+CHECK_STRUCT_HAS_MEMBER(fsmblks mallinfo malloc.h HAVE_STRUCT_MALLINFO_FSMBLKS)
+CHECK_STRUCT_HAS_MEMBER(hblkhd mallinfo malloc.h HAVE_STRUCT_MALLINFO_HBLKHD)
+CHECK_STRUCT_HAS_MEMBER(uordblks mallinfo malloc.h HAVE_STRUCT_MALLINFO_UORDBLKS)
+CHECK_STRUCT_HAS_MEMBER(usmblks mallinfo 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)