]> git.lyx.org Git - features.git/commitdiff
Cmake build: Creating a define for a header file found
authorKornel Benko <kornel@lyx.org>
Tue, 12 Feb 2013 18:01:16 +0000 (19:01 +0100)
committerKornel Benko <kornel@lyx.org>
Tue, 12 Feb 2013 18:01:16 +0000 (19:01 +0100)
need now only changes in the list of header files in ConfigureChecks.cmake.

CMakeLists.txt
development/cmake/ConfigureChecks.cmake
development/cmake/configCompiler.h.cmake
development/cmake/configIncludes.cmake [new file with mode: 0644]

index 68c7d0323c922be4c4b4ed8d0fef7c7ea4d56051..abf9ce0e206bbb3196510265332b8f9ef9db6b7c 100644 (file)
@@ -696,8 +696,6 @@ if(MSVC AND NOT LYX_CONFIGURE_CHECKS)
        configure_file(${LYX_CMAKE_DIR}/configCompiler.h.msvc ${TOP_BINARY_DIR}/configCompiler.h)
 else()
        include(${LYX_CMAKE_DIR}/ConfigureChecks.cmake)
-       configure_file(${LYX_CMAKE_DIR}/configFunctions.cmake ${TOP_BINARY_DIR}/configFunctions.h.cmake)
-       configure_file(${TOP_BINARY_DIR}/configFunctions.h.cmake ${TOP_BINARY_DIR}/configFunctions.h)
        configure_file(${LYX_CMAKE_DIR}/configCompiler.h.cmake ${TOP_BINARY_DIR}/configCompiler.h)
 endif()
 
index a18b1b77ab11f9df2fb5b7311b90c7b897442d5a..b6b0b1476bd81dd57b3559dca319df24663e9c01 100644 (file)
@@ -17,29 +17,26 @@ include(TestBigEndian)
 
 test_big_endian(WORDS_BIGENDIAN)
 
-check_include_file_cxx(aspell.h HAVE_ASPELL_H)
-check_include_file_cxx(aspell/aspell.h HAVE_ASPELL_ASPELL_H)
 #check_include_file_cxx(istream HAVE_ISTREAM)
 #check_include_file_cxx(ostream HAVE_OSTREAM)
-#check_include_file_cxx(ios HAVE_IOS)
 #check_include_file_cxx(sstream HAVE_SSTREAM)
+#check_include_file_cxx(ios HAVE_IOS)
 #check_include_file_cxx(locale HAVE_LOCALE)
 
-check_include_files(limits.h HAVE_LIMITS_H)
-check_include_files(locale.h HAVE_LOCALE_H)
-check_include_files(stdlib.h HAVE_STDLIB_H)
-check_include_files(sys/stat.h HAVE_SYS_STAT_H)
-check_include_files(sys/time.h HAVE_SYS_TIME_H)
-check_include_files(sys/types.h HAVE_SYS_TYPES_H)
-check_include_files(sys/utime.h HAVE_SYS_UTIME_H)
-check_include_files(sys/socket.h HAVE_SYS_SOCKET_H)
-check_include_files(unistd.h HAVE_UNISTD_H)
-check_include_files(inttypes.h HAVE_INTTYPES_H)
-check_include_files(utime.h HAVE_UTIME_H)
-check_include_files(string.h HAVE_STRING_H)
-check_include_files(argz.h HAVE_ARGZ_H)
+# defines will be written to configIncludes.h
+set(Include_Defines)
+foreach(_h_file aspell.h aspell/aspell.h limits.h locale.h
+       stdlib.h sys/stat.h sys/time.h sys/types.h sys/utime.h
+       sys/socket.h unistd.h inttypes.h utime.h string.h argz.h)
+       string(REGEX REPLACE "[/\\.]" "_" _hf ${_h_file})
+       string(TOUPPER ${_hf} _HF)
+       check_include_files(${_h_file} HAVE_${_HF})
+       set(Include_Defines "${Include_Defines}#cmakedefine HAVE_${_HF} 1\n")
+endforeach()
+configure_file(${LYX_CMAKE_DIR}/configIncludes.cmake ${TOP_BINARY_DIR}/configIncludes.h.cmake)
+configure_file(${TOP_BINARY_DIR}/configIncludes.h.cmake ${TOP_BINARY_DIR}/configIncludes.h)
 
-set(_function_file ${TOP_BINARY_DIR}/configFunctions.h.cmake)
+# defines will be written to configFunctions.h
 set(Function_Defines)
 foreach(_f alloca __argz_count __argz_next __argz_stringify
        chmod close _close dcgettext fcntl fork __fsetlocking
@@ -50,6 +47,8 @@ foreach(_f alloca __argz_count __argz_next __argz_stringify
   check_function_exists(${_f} HAVE_${_UF})
   set(Function_Defines "${Function_Defines}#cmakedefine HAVE_${_UF} 1\n")
 endforeach()
+configure_file(${LYX_CMAKE_DIR}/configFunctions.cmake ${TOP_BINARY_DIR}/configFunctions.h.cmake)
+configure_file(${TOP_BINARY_DIR}/configFunctions.h.cmake ${TOP_BINARY_DIR}/configFunctions.h)
 
 check_symbol_exists(alloca "malloc.h" HAVE_SYMBOL_ALLOCA)
 check_symbol_exists(asprintf "stdio.h" HAVE_ASPRINTF)
index 65e08a01f51b251e4d7d6171f474f3830d65a355..e833a036e1333ffc2d7e17401eb139be734fff58 100644 (file)
 #define _CONFIG_COMPILER_H
 
 
-#cmakedefine HAVE_LIMITS_H 1
-#cmakedefine HAVE_LOCALE_H 1
-#cmakedefine HAVE_STDLIB_H 1
-#cmakedefine HAVE_SYS_STAT_H 1
-#cmakedefine HAVE_SYS_TIME_H 1
-#cmakedefine HAVE_SYS_TYPES_H 1
-#cmakedefine HAVE_SYS_UTIME_H 1
-#cmakedefine HAVE_SYS_SOCKET_H 1
-#cmakedefine HAVE_UNISTD_H 1
-#cmakedefine HAVE_INTTYPES_H 1
-#cmakedefine HAVE_UTIME_H 1
-#cmakedefine HAVE_STRING_H 1
 #cmakedefine HAVE_ISTREAM 1
 #cmakedefine HAVE_OSTREAM 1
 #cmakedefine HAVE_IOS 1
 #cmakedefine HAVE_LOCALE 1
 
+#include "configIncludes.h"
+
 #include "configFunctions.h"
 
 #cmakedefine HAVE_STD_COUNT 1
diff --git a/development/cmake/configIncludes.cmake b/development/cmake/configIncludes.cmake
new file mode 100644 (file)
index 0000000..fb9135b
--- /dev/null
@@ -0,0 +1,17 @@
+/*
+ * \file configIncludes.h
+ * This file is part of LyX, the document processor.
+ * Licence details can be found in the file COPYING.
+ *
+ * This is the compilation configuration file for LyX.
+ * It was generated by cmake.
+ * You might want to change some of the defaults if something goes wrong
+ * during the compilation.
+ */
+
+#ifndef _CONFIG_INCLUDES_H
+#define _CONFIG_INCLUDES_H
+
+${Include_Defines}
+
+#endif