From 0edd3bf6e0c1fa8d12cc6f2207dacd57c002b7dc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Peter=20K=C3=BCmmel?= Date: Fri, 30 Mar 2007 20:29:23 +0000 Subject: [PATCH] cmake: some cleanup only git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@17653 a592a061-630c-0410-9148-cb99ea01b6c8 --- .../boost/libs/filesystem/CMakeLists.txt | 6 ++--- .../cmake/boost/libs/iostreams/CMakeLists.txt | 6 ++--- .../cmake/boost/libs/signals/CMakeLists.txt | 6 ++--- development/cmake/modules/LyXMacros.cmake | 27 +++++++------------ development/cmake/src/CMakeLists.txt | 7 ++--- .../cmake/src/frontends/CMakeLists.txt | 6 ++--- .../src/frontends/controllers/CMakeLists.txt | 6 ++--- .../cmake/src/frontends/qt4/CMakeLists.txt | 9 +++---- development/cmake/src/graphics/CMakeLists.txt | 6 ++--- development/cmake/src/insets/CMakeLists.txt | 6 ++--- development/cmake/src/mathed/CMakeLists.txt | 6 ++--- development/cmake/src/support/CMakeLists.txt | 6 ++--- 12 files changed, 33 insertions(+), 64 deletions(-) diff --git a/development/cmake/boost/libs/filesystem/CMakeLists.txt b/development/cmake/boost/libs/filesystem/CMakeLists.txt index 7b34271b71..4a7ed857ef 100644 --- a/development/cmake/boost/libs/filesystem/CMakeLists.txt +++ b/development/cmake/boost/libs/filesystem/CMakeLists.txt @@ -19,9 +19,7 @@ if(NOT MERGE_FILES) add_library(boost_filesystem STATIC ${boost_filesystem_sources}) else(NOT MERGE_FILES) add_definitions(-D_WIN32_WINNT=0x500) - lyx_merge_files(allinone boost_filesystem_sources) - add_library(boost_filesystem STATIC - ${CMAKE_CURRENT_BINARY_DIR}/allinone_const.C - ${CMAKE_CURRENT_BINARY_DIR}/allinone_touched.C) + lyx_const_touched_files(_allinone const_touched_files boost_filesystem_sources) + add_library(boost_filesystem STATIC ${const_touched_files}) endif(NOT MERGE_FILES) diff --git a/development/cmake/boost/libs/iostreams/CMakeLists.txt b/development/cmake/boost/libs/iostreams/CMakeLists.txt index ebce005c90..dcd9732890 100644 --- a/development/cmake/boost/libs/iostreams/CMakeLists.txt +++ b/development/cmake/boost/libs/iostreams/CMakeLists.txt @@ -19,10 +19,8 @@ include_directories(${ZLIB_INCLUDE_DIR}) if(NOT MERGE_FILES) add_library(boost_iostreams STATIC ${boost_iostreams_sources}) else(NOT MERGE_FILES) - lyx_merge_files(allinone boost_iostreams_sources) - add_library(boost_iostreams STATIC - ${CMAKE_CURRENT_BINARY_DIR}/allinone_const.C - ${CMAKE_CURRENT_BINARY_DIR}/allinone_touched.C) + lyx_const_touched_files(_allinone const_touched_files boost_iostreams_sources) + add_library(boost_iostreams STATIC ${const_touched_files}) endif(NOT MERGE_FILES) diff --git a/development/cmake/boost/libs/signals/CMakeLists.txt b/development/cmake/boost/libs/signals/CMakeLists.txt index e7a13e5619..f5266d580b 100644 --- a/development/cmake/boost/libs/signals/CMakeLists.txt +++ b/development/cmake/boost/libs/signals/CMakeLists.txt @@ -19,9 +19,7 @@ lyx_add_path(boost_signals_sources ${TOP_SRC_DIR}/boost/libs/signals/src) if(NOT MERGE_FILES) add_library(boost_signals STATIC ${boost_signals_sources}) else(NOT MERGE_FILES) - lyx_merge_files(allinone boost_signals_sources) - add_library(boost_signals STATIC - ${CMAKE_CURRENT_BINARY_DIR}/allinone_const.C - ${CMAKE_CURRENT_BINARY_DIR}/allinone_touched.C) + lyx_const_touched_files(_allinone const_touched_files boost_signals_sources) + add_library(boost_signals STATIC ${const_touched_files}) endif(NOT MERGE_FILES) diff --git a/development/cmake/modules/LyXMacros.cmake b/development/cmake/modules/LyXMacros.cmake index cfc7f7e8ad..25f986059d 100644 --- a/development/cmake/modules/LyXMacros.cmake +++ b/development/cmake/modules/LyXMacros.cmake @@ -126,16 +126,9 @@ MACRO (LYX_AUTOMOC) endmacro (LYX_AUTOMOC) -# For all C++ sources a big source file which includes all the files -# is created. -# This is not done for the C sources, they are just gathered in a separate list -# because they are usually not written by KDE and as such not intended to be -# compiled all-in-one. -macro (LYX_CREATE_FINAL_FILES _filenameCPP _filesExcludedFromFinalFile ) - set(${_filesExcludedFromFinalFile}) - - set(_file_const ${CMAKE_CURRENT_BINARY_DIR}/${_filenameCPP}_const.C) - set(_file_touched ${CMAKE_CURRENT_BINARY_DIR}/${_filenameCPP}_touched.C) +macro(lyx_const_touched_files _allinone_name _new_list _list) + set(_file_const ${CMAKE_CURRENT_BINARY_DIR}/${_allinone_name}_const.C) + set(_file_touched ${CMAKE_CURRENT_BINARY_DIR}/${_allinone_name}_touched.C) file(WRITE ${_file_const} "//autogenerated file\n") file(WRITE ${_file_touched} "//autogenerated file\n") @@ -145,19 +138,21 @@ macro (LYX_CREATE_FINAL_FILES _filenameCPP _filesExcludedFromFinalFile ) file(APPEND ${_file_touched} "#define DONT_INCLUDE_CONST_FILES\n") file(APPEND ${_file_touched} "#include \"${_file_const}\"\n\n\n") - foreach (_current_FILE ${ARGN}) + set(${_new_list} ${_file_const} ${_file_touched}) + + foreach (_current_FILE ${${_list}}) get_filename_component(_abs_FILE ${_current_FILE} ABSOLUTE) # don't include any generated files in the final-file # because then cmake will not know the dependencies get_source_file_property(_isGenerated ${_abs_FILE} GENERATED) if (_isGenerated) - list(APPEND ${_filesExcludedFromFinalFile} ${_abs_FILE}) + list(APPEND ${_new_list} ${_abs_FILE}) else (_isGenerated) # don't include c-files in the final-file, because they usually come # from a 3rd party and as such are not intended to be compiled all-in-one string(REGEX MATCH ".+\\.c$" _isCFile ${_abs_FILE}) if (_isCFile) - list(APPEND ${_filesExcludedFromFinalFile} ${_abs_FILE}) + list(APPEND ${_new_list} ${_abs_FILE}) else (_isCFile) GET_FILENAME_COMPONENT(_file_name ${_abs_FILE} NAME_WE) @@ -176,10 +171,6 @@ macro (LYX_CREATE_FINAL_FILES _filenameCPP _filesExcludedFromFinalFile ) endif (_isCFile) endif (_isGenerated) endforeach (_current_FILE) -endmacro (LYX_CREATE_FINAL_FILES) +endmacro(lyx_const_touched_files) -macro(lyx_merge_files _filename _list) - LYX_CREATE_FINAL_FILES(${_filename} _nix_nothing ${${_list}}) -endmacro(lyx_merge_files _list _filename) - diff --git a/development/cmake/src/CMakeLists.txt b/development/cmake/src/CMakeLists.txt index bffaeef559..94f424a43b 100644 --- a/development/cmake/src/CMakeLists.txt +++ b/development/cmake/src/CMakeLists.txt @@ -43,11 +43,8 @@ lyx_add_msvc_pch(lyx) if(NOT MERGE_FILES) set(lyx_sources ${lyx_sources} ${CMAKE_CURRENT_BINARY_DIR}/version.C) else(NOT MERGE_FILES) - lyx_merge_files(allinone lyx_sources) - set(lyx_sources - ${CMAKE_CURRENT_BINARY_DIR}/allinone_const.C - ${CMAKE_CURRENT_BINARY_DIR}/allinone_touched.C - ${CMAKE_CURRENT_BINARY_DIR}/version.C + lyx_const_touched_files(_allinone const_touched_files lyx_sources) + set(lyx_sources ${const_touched_files} ${CMAKE_CURRENT_BINARY_DIR}/version.C ) endif(NOT MERGE_FILES) diff --git a/development/cmake/src/frontends/CMakeLists.txt b/development/cmake/src/frontends/CMakeLists.txt index 3072627d36..b1b1773f73 100644 --- a/development/cmake/src/frontends/CMakeLists.txt +++ b/development/cmake/src/frontends/CMakeLists.txt @@ -21,10 +21,8 @@ lyx_add_msvc_pch(frontends) if(NOT MERGE_FILES) add_library(frontends ${library_type} ${frontends_sources} ${frontends_headers}) else(NOT MERGE_FILES) - lyx_merge_files(allinone frontends_sources) - add_library(frontends ${library_type} - ${CMAKE_CURRENT_BINARY_DIR}/allinone_const.C - ${CMAKE_CURRENT_BINARY_DIR}/allinone_touched.C) + lyx_const_touched_files(_allinone const_touched_files frontends_sources) + add_library(frontends ${library_type} ${const_touched_files}) endif(NOT MERGE_FILES) project_source_group("${GROUP_CODE}" frontends_sources frontends_headers) diff --git a/development/cmake/src/frontends/controllers/CMakeLists.txt b/development/cmake/src/frontends/controllers/CMakeLists.txt index 09272911ee..5fea7ac305 100644 --- a/development/cmake/src/frontends/controllers/CMakeLists.txt +++ b/development/cmake/src/frontends/controllers/CMakeLists.txt @@ -16,10 +16,8 @@ include_directories(${TOP_SRC_DIR}/src/frontends/controllers) if(NOT MERGE_FILES) add_library(controllers ${library_type} ${controllers_sources} ${controllers_headers}) else(NOT MERGE_FILES) - lyx_merge_files(allinone controllers_sources) - add_library(controllers ${library_type} - ${CMAKE_CURRENT_BINARY_DIR}/allinone_const.C - ${CMAKE_CURRENT_BINARY_DIR}/allinone_touched.C) + lyx_const_touched_files(_allinone const_touched_files controllers_sources) + add_library(controllers ${library_type} ${const_touched_files}) endif(NOT MERGE_FILES) target_link_libraries(controllers boost_regex boost_filesystem) diff --git a/development/cmake/src/frontends/qt4/CMakeLists.txt b/development/cmake/src/frontends/qt4/CMakeLists.txt index 46fadefb9c..002436abbc 100644 --- a/development/cmake/src/frontends/qt4/CMakeLists.txt +++ b/development/cmake/src/frontends/qt4/CMakeLists.txt @@ -37,13 +37,12 @@ if(MERGE_FILES) list(REVERSE frontends_qt4_sources) list(REMOVE_ITEM frontends_qt4_sources ${TOP_SRC_DIR}/src/frontends/qt4/GuiApplication.C) list(APPEND frontends_qt4_sources ${TOP_SRC_DIR}/src/frontends/qt4/GuiApplication.C) - lyx_merge_files(allinone frontends_qt4_sources) + lyx_const_touched_files(_allinone const_touched_files frontends_qt4_sources) set(depends_moc_uic ${frontends_qt4_headers} ${ui_files}) - SET_SOURCE_FILES_PROPERTIES(allinone_const.C PROPERTIES OBJECT_DEPENDS "${depends_moc_uic}") - SET_SOURCE_FILES_PROPERTIES(allinone_touched.C PROPERTIES OBJECT_DEPENDS "${depends_moc_uic}") + SET_SOURCE_FILES_PROPERTIES(_allinone_const.C PROPERTIES OBJECT_DEPENDS "${depends_moc_uic}") + SET_SOURCE_FILES_PROPERTIES(_allinone_touched.C PROPERTIES OBJECT_DEPENDS "${depends_moc_uic}") add_library(frontend_qt4 ${library_type} - ${CMAKE_CURRENT_BINARY_DIR}/allinone_const.C - ${CMAKE_CURRENT_BINARY_DIR}/allinone_touched.C + ${const_touched_files} ${frontends_qt4_headers} ${ui_files} ) diff --git a/development/cmake/src/graphics/CMakeLists.txt b/development/cmake/src/graphics/CMakeLists.txt index 55780f3311..61b73a053d 100644 --- a/development/cmake/src/graphics/CMakeLists.txt +++ b/development/cmake/src/graphics/CMakeLists.txt @@ -17,10 +17,8 @@ include_directories(${TOP_SRC_DIR}/src/graphics) if(NOT MERGE_FILES) add_library(graphics ${library_type} ${graphics_sources} ${graphics_headers}) else(NOT MERGE_FILES) - lyx_merge_files(allinone graphics_sources) - add_library(graphics ${library_type} - ${CMAKE_CURRENT_BINARY_DIR}/allinone_const.C - ${CMAKE_CURRENT_BINARY_DIR}/allinone_touched.C) + lyx_const_touched_files(_allinone const_touched_files graphics_sources) + add_library(graphics ${library_type} ${const_touched_files}) endif(NOT MERGE_FILES) project_source_group("${GROUP_CODE}" graphics_sources graphics_headers) diff --git a/development/cmake/src/insets/CMakeLists.txt b/development/cmake/src/insets/CMakeLists.txt index fb62388b0f..d65ee9f3f6 100644 --- a/development/cmake/src/insets/CMakeLists.txt +++ b/development/cmake/src/insets/CMakeLists.txt @@ -19,10 +19,8 @@ include_directories(${TOP_SRC_DIR}/src/insets) if(NOT MERGE_FILES) add_library(insets ${library_type} ${insets_sources} ${insets_headers}) else(NOT MERGE_FILES) - lyx_merge_files(allinone insets_sources) - add_library(insets ${library_type} - ${CMAKE_CURRENT_BINARY_DIR}/allinone_const.C - ${CMAKE_CURRENT_BINARY_DIR}/allinone_touched.C) + lyx_const_touched_files(_allinone const_touched_files insets_sources) + add_library(insets ${library_type} ${const_touched_files}) endif(NOT MERGE_FILES) diff --git a/development/cmake/src/mathed/CMakeLists.txt b/development/cmake/src/mathed/CMakeLists.txt index e5bfe39627..30475eaa57 100644 --- a/development/cmake/src/mathed/CMakeLists.txt +++ b/development/cmake/src/mathed/CMakeLists.txt @@ -20,10 +20,8 @@ include_directories(${TOP_SRC_DIR}/src/mathed) if(NOT MERGE_FILES) add_library(mathed ${library_type} ${mathed_sources} ${mathed_headers}) else(NOT MERGE_FILES) - lyx_merge_files(allinone mathed_sources) - add_library(mathed ${library_type} - ${CMAKE_CURRENT_BINARY_DIR}/allinone_const.C - ${CMAKE_CURRENT_BINARY_DIR}/allinone_touched.C) + lyx_const_touched_files(_allinone const_touched_files mathed_sources) + add_library(mathed ${library_type} ${const_touched_files}) endif(NOT MERGE_FILES) diff --git a/development/cmake/src/support/CMakeLists.txt b/development/cmake/src/support/CMakeLists.txt index cc6d09f8f4..6d1a242988 100644 --- a/development/cmake/src/support/CMakeLists.txt +++ b/development/cmake/src/support/CMakeLists.txt @@ -35,10 +35,8 @@ else(NOT MERGE_FILES) list(REMOVE_ITEM support_sources ${TOP_SRC_DIR}/src/support/lstrings.C) list(APPEND support_sources ${TOP_SRC_DIR}/src/support/lstrings.C) list(REVERSE support_sources) - lyx_merge_files(allinone support_sources) - add_library(support ${library_type} - ${CMAKE_CURRENT_BINARY_DIR}/allinone_const.C - ${CMAKE_CURRENT_BINARY_DIR}/allinone_touched.C) + lyx_const_touched_files(_allinone const_touched_files support_sources) + add_library(support ${library_type} ${const_touched_files}) endif(NOT MERGE_FILES)