Cmake build: Creating a define for a header file found

need now only changes in the list of header files in ConfigureChecks.cmake.
This commit is contained in:
Kornel Benko 2013-02-12 19:01:16 +01:00
parent 63eaefc740
commit 0ea6654228
4 changed files with 35 additions and 31 deletions

View 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) configure_file(${LYX_CMAKE_DIR}/configCompiler.h.msvc ${TOP_BINARY_DIR}/configCompiler.h)
else() else()
include(${LYX_CMAKE_DIR}/ConfigureChecks.cmake) 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) configure_file(${LYX_CMAKE_DIR}/configCompiler.h.cmake ${TOP_BINARY_DIR}/configCompiler.h)
endif() endif()

View File

@ -17,29 +17,26 @@ include(TestBigEndian)
test_big_endian(WORDS_BIGENDIAN) 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(istream HAVE_ISTREAM)
#check_include_file_cxx(ostream HAVE_OSTREAM) #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(sstream HAVE_SSTREAM)
#check_include_file_cxx(ios HAVE_IOS)
#check_include_file_cxx(locale HAVE_LOCALE) #check_include_file_cxx(locale HAVE_LOCALE)
check_include_files(limits.h HAVE_LIMITS_H) # defines will be written to configIncludes.h
check_include_files(locale.h HAVE_LOCALE_H) set(Include_Defines)
check_include_files(stdlib.h HAVE_STDLIB_H) foreach(_h_file aspell.h aspell/aspell.h limits.h locale.h
check_include_files(sys/stat.h HAVE_SYS_STAT_H) stdlib.h sys/stat.h sys/time.h sys/types.h sys/utime.h
check_include_files(sys/time.h HAVE_SYS_TIME_H) sys/socket.h unistd.h inttypes.h utime.h string.h argz.h)
check_include_files(sys/types.h HAVE_SYS_TYPES_H) string(REGEX REPLACE "[/\\.]" "_" _hf ${_h_file})
check_include_files(sys/utime.h HAVE_SYS_UTIME_H) string(TOUPPER ${_hf} _HF)
check_include_files(sys/socket.h HAVE_SYS_SOCKET_H) check_include_files(${_h_file} HAVE_${_HF})
check_include_files(unistd.h HAVE_UNISTD_H) set(Include_Defines "${Include_Defines}#cmakedefine HAVE_${_HF} 1\n")
check_include_files(inttypes.h HAVE_INTTYPES_H) endforeach()
check_include_files(utime.h HAVE_UTIME_H) configure_file(${LYX_CMAKE_DIR}/configIncludes.cmake ${TOP_BINARY_DIR}/configIncludes.h.cmake)
check_include_files(string.h HAVE_STRING_H) configure_file(${TOP_BINARY_DIR}/configIncludes.h.cmake ${TOP_BINARY_DIR}/configIncludes.h)
check_include_files(argz.h HAVE_ARGZ_H)
set(_function_file ${TOP_BINARY_DIR}/configFunctions.h.cmake) # defines will be written to configFunctions.h
set(Function_Defines) set(Function_Defines)
foreach(_f alloca __argz_count __argz_next __argz_stringify foreach(_f alloca __argz_count __argz_next __argz_stringify
chmod close _close dcgettext fcntl fork __fsetlocking 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}) check_function_exists(${_f} HAVE_${_UF})
set(Function_Defines "${Function_Defines}#cmakedefine HAVE_${_UF} 1\n") set(Function_Defines "${Function_Defines}#cmakedefine HAVE_${_UF} 1\n")
endforeach() 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(alloca "malloc.h" HAVE_SYMBOL_ALLOCA)
check_symbol_exists(asprintf "stdio.h" HAVE_ASPRINTF) check_symbol_exists(asprintf "stdio.h" HAVE_ASPRINTF)

View File

@ -13,23 +13,13 @@
#define _CONFIG_COMPILER_H #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_ISTREAM 1
#cmakedefine HAVE_OSTREAM 1 #cmakedefine HAVE_OSTREAM 1
#cmakedefine HAVE_IOS 1 #cmakedefine HAVE_IOS 1
#cmakedefine HAVE_LOCALE 1 #cmakedefine HAVE_LOCALE 1
#include "configIncludes.h"
#include "configFunctions.h" #include "configFunctions.h"
#cmakedefine HAVE_STD_COUNT 1 #cmakedefine HAVE_STD_COUNT 1

View File

@ -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