Author: kuemmel Date: Tue Jan 11 00:24:00 2011 New Revision: 37174 URL: http://www.lyx.org/trac/changeset/37174
Log: cmake: we have 2011 and more white space changes, won't call "use tabs" ;) Modified: lyx-devel/trunk/development/cmake/CMakeLists.txt lyx-devel/trunk/development/cmake/boost/CMakeLists.txt lyx-devel/trunk/development/cmake/boost/libs/CMakeLists.txt lyx-devel/trunk/development/cmake/boost/libs/regex/CMakeLists.txt lyx-devel/trunk/development/cmake/boost/libs/signals/CMakeLists.txt lyx-devel/trunk/development/cmake/doc/CMakeLists.txt lyx-devel/trunk/development/cmake/intl/CMakeLists.txt lyx-devel/trunk/development/cmake/lyx2lyx/CMakeLists.txt lyx-devel/trunk/development/cmake/man/CMakeLists.txt lyx-devel/trunk/development/cmake/modules/LyXMacros.cmake lyx-devel/trunk/development/cmake/po/CMakeLists.txt lyx-devel/trunk/development/cmake/scripts/CMakeLists.txt lyx-devel/trunk/development/cmake/src/CMakeLists.txt lyx-devel/trunk/development/cmake/src/client/CMakeLists.txt lyx-devel/trunk/development/cmake/src/frontends/CMakeLists.txt lyx-devel/trunk/development/cmake/src/frontends/qt4/CMakeLists.txt lyx-devel/trunk/development/cmake/src/graphics/CMakeLists.txt lyx-devel/trunk/development/cmake/src/insets/CMakeLists.txt lyx-devel/trunk/development/cmake/src/mathed/CMakeLists.txt lyx-devel/trunk/development/cmake/src/support/CMakeLists.txt lyx-devel/trunk/development/cmake/src/tex2lyx/CMakeLists.txt Modified: lyx-devel/trunk/development/cmake/CMakeLists.txt ============================================================================== --- lyx-devel/trunk/development/cmake/CMakeLists.txt Tue Jan 11 00:01:13 2011 (r37173) +++ lyx-devel/trunk/development/cmake/CMakeLists.txt Tue Jan 11 00:24:00 2011 (r37174) @@ -2,8 +2,8 @@ # This file is part of LyX, the document processor. # Licence details can be found in the file COPYING. # -# Copyright (c) 2006-2010 Peter Kümmel, <[email protected]> -# Copyright (c) 2008-2010 Kornel Benko, <[email protected]> +# Copyright (c) 2006-2011 Peter Kümmel, <[email protected]> +# Copyright (c) 2008-2011 Kornel Benko, <[email protected]> cmake_minimum_required(VERSION 2.6.4) Modified: lyx-devel/trunk/development/cmake/boost/CMakeLists.txt ============================================================================== --- lyx-devel/trunk/development/cmake/boost/CMakeLists.txt Tue Jan 11 00:01:13 2011 (r37173) +++ lyx-devel/trunk/development/cmake/boost/CMakeLists.txt Tue Jan 11 00:24:00 2011 (r37174) @@ -1,7 +1,7 @@ # This file is part of LyX, the document processor. # Licence details can be found in the file COPYING. # -# Copyright (c) 2006, Peter K�mmel, <[email protected]> +# Copyright (c) 2006-2011 Peter Kümmel, <[email protected]> # add_subdirectory(libs) Modified: lyx-devel/trunk/development/cmake/boost/libs/CMakeLists.txt ============================================================================== --- lyx-devel/trunk/development/cmake/boost/libs/CMakeLists.txt Tue Jan 11 00:01:13 2011 (r37173) +++ lyx-devel/trunk/development/cmake/boost/libs/CMakeLists.txt Tue Jan 11 00:24:00 2011 (r37174) @@ -1,7 +1,7 @@ # This file is part of LyX, the document processor. # Licence details can be found in the file COPYING. # -# Copyright (c) 2010, Peter Kümmel, <[email protected]> +# Copyright (c) 2010-2011 Peter Kümmel, <[email protected]> # project(boost) Modified: lyx-devel/trunk/development/cmake/boost/libs/regex/CMakeLists.txt ============================================================================== --- lyx-devel/trunk/development/cmake/boost/libs/regex/CMakeLists.txt Tue Jan 11 00:01:13 2011 (r37173) +++ lyx-devel/trunk/development/cmake/boost/libs/regex/CMakeLists.txt Tue Jan 11 00:24:00 2011 (r37174) @@ -1,7 +1,7 @@ # This file is part of LyX, the document processor. # Licence details can be found in the file COPYING. # -# Copyright (c) 2006, Peter K�mmel, <[email protected]> +# Copyright (c) 2006-2011 Peter Kümmel, <[email protected]> # project(boost_regex) Modified: lyx-devel/trunk/development/cmake/boost/libs/signals/CMakeLists.txt ============================================================================== --- lyx-devel/trunk/development/cmake/boost/libs/signals/CMakeLists.txt Tue Jan 11 00:01:13 2011 (r37173) +++ lyx-devel/trunk/development/cmake/boost/libs/signals/CMakeLists.txt Tue Jan 11 00:24:00 2011 (r37174) @@ -1,7 +1,7 @@ # This file is part of LyX, the document processor. # Licence details can be found in the file COPYING. # -# Copyright (c) 2006, Peter K�mmel, <[email protected]> +# Copyright (c) 2006-2011 Peter Kümmel, <[email protected]> # project(boost_signals) Modified: lyx-devel/trunk/development/cmake/doc/CMakeLists.txt ============================================================================== --- lyx-devel/trunk/development/cmake/doc/CMakeLists.txt Tue Jan 11 00:01:13 2011 (r37173) +++ lyx-devel/trunk/development/cmake/doc/CMakeLists.txt Tue Jan 11 00:24:00 2011 (r37174) @@ -1,8 +1,8 @@ # This file is part of LyX, the document processor. # Licence details can be found in the file COPYING. # -# Copyright (c) 2008-2010 Peter Kümmel, <[email protected]> -# Copyright (c) 2008-2010 Kornel Benko, <[email protected]> +# Copyright (c) 2008-2011 Peter Kümmel, <[email protected]> +# Copyright (c) 2008-2011 Kornel Benko, <[email protected]> # project(doc) Modified: lyx-devel/trunk/development/cmake/intl/CMakeLists.txt ============================================================================== --- lyx-devel/trunk/development/cmake/intl/CMakeLists.txt Tue Jan 11 00:01:13 2011 (r37173) +++ lyx-devel/trunk/development/cmake/intl/CMakeLists.txt Tue Jan 11 00:24:00 2011 (r37174) @@ -1,7 +1,7 @@ # This file is part of LyX, the document processor. # Licence details can be found in the file COPYING. # -# Copyright (c) 2006, Peter K�mmel, <[email protected]> +# Copyright (c) 2006,2011 Peter Kümmel, <[email protected]> # project(intl) @@ -12,57 +12,57 @@ add_definitions( - -DHAVE_CONFIG_H=1 - -DMAKE_INTL_LIB - -DIN_LIBINTL - -DENABLE_RELOCATABLE=1 - -DIN_LIBRARY - -DNO_XMALLOC - -Dset_relocation_prefix=libintl_set_relocation_prefix - -Drelocate=libintl_relocate - -DDEPENDS_ON_LIBICONV=1) + -DHAVE_CONFIG_H=1 + -DMAKE_INTL_LIB + -DIN_LIBINTL + -DENABLE_RELOCATABLE=1 + -DIN_LIBRARY + -DNO_XMALLOC + -Dset_relocation_prefix=libintl_set_relocation_prefix + -Drelocate=libintl_relocate + -DDEPENDS_ON_LIBICONV=1) if(NOT APPLE) add_definitions( - -DLOCALEDIR=\\"${LOACLE_DIR}\\" - -DLOCALE_ALIAS_PATH=\\"${LOACLE_DIR}\\" - -DLIBDIR=\\"${TOP_SRC_DIR}\\" - -DINSTALLDIR=\\"${PREFIX}\\" ) + -DLOCALEDIR=\\"${LOACLE_DIR}\\" + -DLOCALE_ALIAS_PATH=\\"${LOACLE_DIR}\\" + -DLIBDIR=\\"${TOP_SRC_DIR}\\" + -DINSTALLDIR=\\"${PREFIX}\\" ) else() add_definitions( - -DLOCALEDIR='\"${LOCALE_DIR}\"' - -DLOCALE_ALIAS_PATH='\"${LOCALE_DIR}\"' - -DLIBDIR='\"${TOP_SRC_DIR}\"' - -DINSTALLDIR='\"${PREFIX}\"' ) + -DLOCALEDIR='\"${LOCALE_DIR}\"' + -DLOCALE_ALIAS_PATH='\"${LOCALE_DIR}\"' + -DLIBDIR='\"${TOP_SRC_DIR}\"' + -DINSTALLDIR='\"${PREFIX}\"' ) endif() file(GLOB intl_headers ${TOP_SRC_DIR}/intl/*.h) set(intl_sources - bindtextdom.c - dcgettext.c - dgettext.c - gettext.c - finddomain.c - loadmsgcat.c - localealias.c - textdomain.c - l10nflist.c - explodename.c - dcigettext.c - dcngettext.c - dngettext.c - ngettext.c - plural.c - plural-exp.c - localcharset.c - relocatable.c - localename.c - log.c - printf.c - osdep.c - intl-compat.c - langprefs.c + bindtextdom.c + dcgettext.c + dgettext.c + gettext.c + finddomain.c + loadmsgcat.c + localealias.c + textdomain.c + l10nflist.c + explodename.c + dcigettext.c + dcngettext.c + dngettext.c + ngettext.c + plural.c + plural-exp.c + localcharset.c + relocatable.c + localename.c + log.c + printf.c + osdep.c + intl-compat.c + langprefs.c ) lyx_add_path(intl_sources ${TOP_SRC_DIR}/intl) Modified: lyx-devel/trunk/development/cmake/lyx2lyx/CMakeLists.txt ============================================================================== --- lyx-devel/trunk/development/cmake/lyx2lyx/CMakeLists.txt Tue Jan 11 00:01:13 2011 (r37173) +++ lyx-devel/trunk/development/cmake/lyx2lyx/CMakeLists.txt Tue Jan 11 00:24:00 2011 (r37174) @@ -1,8 +1,8 @@ # This file is part of LyX, the document processor. # Licence details can be found in the file COPYING. # -# Copyright (c) 2008-2010 Peter K�mmel, <[email protected]> -# Copyright (c) 2008-2010 Kornel Benko, <[email protected]> +# Copyright (c) 2008-2011 Peter Kümmel, <[email protected]> +# Copyright (c) 2008-2011 Kornel Benko, <[email protected]> # configure_file(${TOP_SRC_DIR}/lib/lyx2lyx/lyx2lyx_version.py.in @@ -10,8 +10,8 @@ install(FILES ${CMAKE_CURRENT_BINARY_DIR}/lyx2lyx_version.py DESTINATION ${LYX_DATA_SUBDIR}lyx2lyx) if (UNIX) - set(_project "lyx2lyx") - include(../PyCompile) + set(_project "lyx2lyx") + include(../PyCompile) endif() install(PROGRAMS ${TOP_SRC_DIR}/lib/lyx2lyx/lyx2lyx DESTINATION ${LYX_DATA_SUBDIR}lyx2lyx) Modified: lyx-devel/trunk/development/cmake/man/CMakeLists.txt ============================================================================== --- lyx-devel/trunk/development/cmake/man/CMakeLists.txt Tue Jan 11 00:01:13 2011 (r37173) +++ lyx-devel/trunk/development/cmake/man/CMakeLists.txt Tue Jan 11 00:24:00 2011 (r37174) @@ -1,8 +1,8 @@ # This file is part of LyX, the document processor. # Licence details can be found in the file COPYING. # -# Copyright (c) 2008-2010 Peter Kümmel, <[email protected]> -# Copyright (c) 2008-2010 Kornel Benko, <[email protected]> +# Copyright (c) 2008-2011 Peter Kümmel, <[email protected]> +# Copyright (c) 2008-2011 Kornel Benko, <[email protected]> # project(man) @@ -11,17 +11,18 @@ set(program_suffix ${PROGRAM_SUFFIX}) set(version_suffix ${PROGRAM_SUFFIX}) set(VERSION "${LYX_MAJOR_VERSION}.${LYX_MINOR_VERSION}") + macro(add_manual _mansrc) - get_filename_component(_mandest ${_mansrc} NAME_WE) - SET(_created_manual "${CMAKE_CURRENT_BINARY_DIR}/${_mandest}${PROGRAM_SUFFIX}.1") - configure_file("${TOP_SRC_DIR}/${_mansrc}" ${_created_manual} @ONLY) - SET_SOURCE_FILES_PROPERTIES(${_created_manual} GENERATED) - LIST(APPEND _manuals ${_created_manual}) + get_filename_component(_mandest ${_mansrc} NAME_WE) + SET(_created_manual "${CMAKE_CURRENT_BINARY_DIR}/${_mandest}${PROGRAM_SUFFIX}.1") + configure_file("${TOP_SRC_DIR}/${_mansrc}" ${_created_manual} @ONLY) + SET_SOURCE_FILES_PROPERTIES(${_created_manual} GENERATED) + LIST(APPEND _manuals ${_created_manual}) endmacro(add_manual) set(real_pkgdatadir ${LYX_ABS_INSTALLED_DATADIR}) foreach(_mn lyx.1in src/client/lyxclient.1in src/tex2lyx/tex2lyx.1in) - add_manual(${_mn}) + add_manual(${_mn}) endforeach(_mn) ADD_CUSTOM_TARGET(man ALL DEPENDS ${_manuals}) Modified: lyx-devel/trunk/development/cmake/modules/LyXMacros.cmake ============================================================================== --- lyx-devel/trunk/development/cmake/modules/LyXMacros.cmake Tue Jan 11 00:01:13 2011 (r37173) +++ lyx-devel/trunk/development/cmake/modules/LyXMacros.cmake Tue Jan 11 00:24:00 2011 (r37174) @@ -6,12 +6,12 @@ # are met: # # 1. Redistributions of source code must retain the copyright -# notice, this list of conditions and the following disclaimer. +# notice, this list of conditions and the following disclaimer. # 2. Redistributions in binary form must reproduce the copyright -# notice, this list of conditions and the following disclaimer in the -# documentation and/or other materials provided with the distribution. +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. # 3. The name of the author may not be used to endorse or promote products -# derived from this software without specific prior written permission. +# derived from this software without specific prior written permission. # # THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR # IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES @@ -28,210 +28,207 @@ set(CMAKE_ALLOW_LOOSE_LOOP_CONSTRUCTS true) macro(lyx_add_path _list _prefix) - set(_tmp) - foreach(_current ${${_list}}) - set(_tmp ${_tmp} ${_prefix}/${_current}) - #message(${_prefix}/${_current}) - endforeach(_current) - set(${_list} ${_tmp}) + set(_tmp) + foreach(_current ${${_list}}) + set(_tmp ${_tmp} ${_prefix}/${_current}) + endforeach(_current) + set(${_list} ${_tmp}) endmacro(lyx_add_path _out _prefix) #create the implementation files from the ui files and add them -# to the list of sources +#to the list of sources #usage: LYX_ADD_QT4_UI_FILES(foo_SRCS ${ui_files}) macro(LYX_ADD_UI_FILES _sources _ui) - foreach (_current_FILE ${ARGN}) + foreach (_current_FILE ${ARGN}) - get_filename_component(_tmp_FILE ${_current_FILE} ABSOLUTE) - get_filename_component(_basename ${_tmp_FILE} NAME_WE) - set(_header ${CMAKE_CURRENT_BINARY_DIR}/ui_${_basename}.h) - - # we need to run uic and replace some things in the generated file - # this is done by executing the cmake script LyXuic.cmake - # ###### - # Latest test showed on linux and windows show no bad consequeces, - # so we removed the call to LyXuic.cmake - add_custom_command(OUTPUT ${_header} + get_filename_component(_tmp_FILE ${_current_FILE} ABSOLUTE) + get_filename_component(_basename ${_tmp_FILE} NAME_WE) + set(_header ${CMAKE_CURRENT_BINARY_DIR}/ui_${_basename}.h) + + # we need to run uic and replace some things in the generated file + # this is done by executing the cmake script LyXuic.cmake + # ###### + # Latest test showed on linux and windows show no bad consequeces, + # so we removed the call to LyXuic.cmake + add_custom_command(OUTPUT ${_header} COMMAND ${QT_UIC_EXECUTABLE} -tr lyx::qt_ ${_tmp_FILE} -o ${_header} - MAIN_DEPENDENCY ${_tmp_FILE} -) - set(${_ui} ${${_ui}} ${_header}) - endforeach (_current_FILE) + MAIN_DEPENDENCY ${_tmp_FILE}) + set(${_ui} ${${_ui}} ${_header}) + endforeach (_current_FILE) endmacro(LYX_ADD_UI_FILES) macro(LYX_AUTOMOC) - if (QT4_GET_MOC_INC_DIRS) - QT4_GET_MOC_INC_DIRS(_moc_INCS) - endif() - - set(_matching_FILES) - foreach (_current_FILE ${ARGN}) - - get_filename_component(_abs_FILE ${_current_FILE} ABSOLUTE) - # if "SKIP_AUTOMOC" is set to true, we will not handle this file here. - # here. this is required to make bouic work correctly: - # we need to add generated .cpp files to the sources (to compile them), - # but we cannot let automoc handle them, as the .cpp files don't exist yet when - # cmake is run for the very first time on them -> however the .cpp files might - # exist at a later run. at that time we need to skip them, so that we don't add two - # different rules for the same moc file - get_source_file_property(_skip ${_abs_FILE} SKIP_AUTOMOC) - - if (EXISTS ${_abs_FILE} AND NOT _skip) - - file(READ ${_abs_FILE} _contents) - - get_filename_component(_abs_PATH ${_abs_FILE} PATH) - - string(REGEX MATCHALL "#include +[\"<]moc_[^ ]+\\.cpp[\">]" _match "${_contents}") - if (_match) - foreach (_current_MOC_INC ${_match}) - string(REGEX MATCH "moc_[^ <\"]+\\.cpp" _current_MOC "${_current_MOC_INC}") - - get_filename_component(_basename ${_current_MOC} NAME_WE) - - string(LENGTH ${_basename} _length) - MATH(EXPR _mocless_length ${_length}-4) - STRING(SUBSTRING ${_basename} 4 ${_mocless_length} _mocless_name ) - - set(_header ${_abs_PATH}/${_mocless_name}.h) - - #message(STATUS "moc : ${_header}") - #set(_header ${CMAKE_CURRENT_SOURCE_DIR}/${_basename}.h) - #set(_header ${_abs_PATH}/${_basename}.h) - - set(_moc ${CMAKE_CURRENT_BINARY_DIR}/${_current_MOC}) - if (WIN32) - set(_def -D_WIN32) - endif() - #set(_moc ${_abs_PATH}/${_current_MOC}) - add_custom_command(OUTPUT ${_moc} - COMMAND ${QT_MOC_EXECUTABLE} - ARGS ${_def} ${_moc_INCS} ${_header} -o ${_moc} - MAIN_DEPENDENCY ${_header}) - macro_add_file_dependencies(${_abs_FILE} ${_moc}) - SET_SOURCE_FILES_PROPERTIES(${_moc} GENERATED) - endforeach (_current_MOC_INC) - else() - #message(STATUS "moc not found : ${_abs_FILE} ") - endif() + if (QT4_GET_MOC_INC_DIRS) + QT4_GET_MOC_INC_DIRS(_moc_INCS) + endif() + + set(_matching_FILES) + foreach (_current_FILE ${ARGN}) - endif() - endforeach (_current_FILE) + get_filename_component(_abs_FILE ${_current_FILE} ABSOLUTE) + # if "SKIP_AUTOMOC" is set to true, we will not handle this file here. + # here. this is required to make bouic work correctly: + # we need to add generated .cpp files to the sources (to compile them), + # but we cannot let automoc handle them, as the .cpp files don't exist yet when + # cmake is run for the very first time on them -> however the .cpp files might + # exist at a later run. at that time we need to skip them, so that we don't add two + # different rules for the same moc file + get_source_file_property(_skip ${_abs_FILE} SKIP_AUTOMOC) + + if (EXISTS ${_abs_FILE} AND NOT _skip) + + file(READ ${_abs_FILE} _contents) + + get_filename_component(_abs_PATH ${_abs_FILE} PATH) + + string(REGEX MATCHALL "#include +[\"<]moc_[^ ]+\\.cpp[\">]" _match "${_contents}") + if (_match) + foreach (_current_MOC_INC ${_match}) + string(REGEX MATCH "moc_[^ <\"]+\\.cpp" _current_MOC "${_current_MOC_INC}") + + get_filename_component(_basename ${_current_MOC} NAME_WE) + + string(LENGTH ${_basename} _length) + MATH(EXPR _mocless_length ${_length}-4) + STRING(SUBSTRING ${_basename} 4 ${_mocless_length} _mocless_name ) + + set(_header ${_abs_PATH}/${_mocless_name}.h) + + #message(STATUS "moc : ${_header}") + #set(_header ${CMAKE_CURRENT_SOURCE_DIR}/${_basename}.h) + #set(_header ${_abs_PATH}/${_basename}.h) + + set(_moc ${CMAKE_CURRENT_BINARY_DIR}/${_current_MOC}) + if (WIN32) + set(_def -D_WIN32) + endif() + #set(_moc ${_abs_PATH}/${_current_MOC}) + add_custom_command(OUTPUT ${_moc} + COMMAND ${QT_MOC_EXECUTABLE} + ARGS ${_def} ${_moc_INCS} ${_header} -o ${_moc} + MAIN_DEPENDENCY ${_header}) + macro_add_file_dependencies(${_abs_FILE} ${_moc}) + SET_SOURCE_FILES_PROPERTIES(${_moc} GENERATED) + endforeach (_current_MOC_INC) + else() + #message(STATUS "moc not found : ${_abs_FILE} ") + endif() + endif() + endforeach (_current_FILE) endmacro (LYX_AUTOMOC) macro(lyx_const_touched_files _allinone_name _list) - set(_file_list ${_allinone_name}_files) - set(_file_const ${CMAKE_CURRENT_BINARY_DIR}/${_allinone_name}_const.C) - set(_file_touched ${CMAKE_CURRENT_BINARY_DIR}/${_allinone_name}_touched.C) - - - # don't touch exisiting or non-empty file, - # so a cmake re-run doesn't touch all created files - set(_rebuild_file_const 0) - if (NOT EXISTS ${_file_const}) - set(_rebuild_file_const 1) - else() - FILE(READ ${_file_const} _file_content) - if (NOT _file_content) - set(_rebuild_file_const 1) - endif() - endif() - - set(_rebuild_file_touched 0) - if (NOT EXISTS ${_file_touched}) - set(_rebuild_file_touched 1) - else() - FILE(READ ${_file_touched} _file_content) - if (NOT _file_content) - set(_rebuild_file_touched 1) - endif() - endif() - - if (LYX_MERGE_REBUILD) - #message(STATUS "Merge files build: rebuilding generated files") - set(_rebuild_file_const 1) - set(_rebuild_file_touched 1) - endif() - - if (_rebuild_file_const) - file(WRITE ${_file_const} "// autogenerated file \n//\n") - file(APPEND ${_file_const} "// * clear or delete this file to build it again by cmake \n//\n\n") - endif() - - if (_rebuild_file_touched) - file(WRITE ${_file_touched} "// autogenerated file \n//\n") - file(APPEND ${_file_touched} "// * clear or delete this file to build it again by cmake \n//\n") - file(APPEND ${_file_touched} "// * don't touch this file \n//\n\n") - file(APPEND ${_file_touched} "#define DONT_INCLUDE_CONST_FILES\n") - file(APPEND ${_file_touched} "#include \"${_file_const}\"\n\n\n") - endif() + set(_file_list ${_allinone_name}_files) + set(_file_const ${CMAKE_CURRENT_BINARY_DIR}/${_allinone_name}_const.C) + set(_file_touched ${CMAKE_CURRENT_BINARY_DIR}/${_allinone_name}_touched.C) + + # don't touch exisiting or non-empty file, + # so a cmake re-run doesn't touch all created files + set(_rebuild_file_const 0) + if (NOT EXISTS ${_file_const}) + set(_rebuild_file_const 1) + else() + FILE(READ ${_file_const} _file_content) + if (NOT _file_content) + set(_rebuild_file_const 1) + endif() + endif() + + set(_rebuild_file_touched 0) + if (NOT EXISTS ${_file_touched}) + set(_rebuild_file_touched 1) + else() + FILE(READ ${_file_touched} _file_content) + if (NOT _file_content) + set(_rebuild_file_touched 1) + endif() + endif() + + if (LYX_MERGE_REBUILD) + #message(STATUS "Merge files build: rebuilding generated files") + set(_rebuild_file_const 1) + set(_rebuild_file_touched 1) + endif() + + if (_rebuild_file_const) + file(WRITE ${_file_const} "// autogenerated file \n//\n") + file(APPEND ${_file_const} "// * clear or delete this file to build it again by cmake \n//\n\n") + endif() - #add merged files also to the project so they become editable - if(${GROUP_CODE} MATCHES "flat") + if (_rebuild_file_touched) + file(WRITE ${_file_touched} "// autogenerated file \n//\n") + file(APPEND ${_file_touched} "// * clear or delete this file to build it again by cmake \n//\n") + file(APPEND ${_file_touched} "// * don't touch this file \n//\n\n") + file(APPEND ${_file_touched} "#define DONT_INCLUDE_CONST_FILES\n") + file(APPEND ${_file_touched} "#include \"${_file_const}\"\n\n\n") + endif() + + #add merged files also to the project so they become editable + if(${GROUP_CODE} MATCHES "flat") lyx_add_info_files_no_group(${${_list}}) else() lyx_add_info_files(MergedFiles ${${_list}}) endif() - set(${_file_list} ${_file_const} ${_file_touched} ${lyx_${groupname}_info_files}) + + set(${_file_list} ${_file_const} ${_file_touched} ${lyx_${groupname}_info_files}) - 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 ${_file_list} ${_abs_FILE}) - else() - GET_FILENAME_COMPONENT(_file_name ${_abs_FILE} NAME_WE) - STRING(REGEX REPLACE "-" "_" _file_name "${_file_name}") - set(__macro_name ${_file_name}___ASSUME_CONST) - - if (_rebuild_file_const) - file(APPEND ${_file_const} "#define ${__macro_name}\n") - file(APPEND ${_file_const} "#if defined(${__macro_name}) && !defined(DONT_INCLUDE_CONST_FILES)\n") - file(APPEND ${_file_const} "#include \"${_abs_FILE}\"\n") - file(APPEND ${_file_const} "#endif\n\n") - endif() - - if (_rebuild_file_touched) - file(APPEND ${_file_touched} "#ifndef ${__macro_name}\n") - file(APPEND ${_file_touched} "#include \"${_abs_FILE}\"\n") - file(APPEND ${_file_touched} "#endif\n\n") - endif() - endif() - endforeach (_current_FILE) + 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 ${_file_list} ${_abs_FILE}) + else() + GET_FILENAME_COMPONENT(_file_name ${_abs_FILE} NAME_WE) + STRING(REGEX REPLACE "-" "_" _file_name "${_file_name}") + set(__macro_name ${_file_name}___ASSUME_CONST) + + if (_rebuild_file_const) + file(APPEND ${_file_const} "#define ${__macro_name}\n") + file(APPEND ${_file_const} "#if defined(${__macro_name}) && !defined(DONT_INCLUDE_CONST_FILES)\n") + file(APPEND ${_file_const} "#include \"${_abs_FILE}\"\n") + file(APPEND ${_file_const} "#endif\n\n") + endif() + + if (_rebuild_file_touched) + file(APPEND ${_file_touched} "#ifndef ${__macro_name}\n") + file(APPEND ${_file_touched} "#include \"${_abs_FILE}\"\n") + file(APPEND ${_file_touched} "#endif\n\n") + endif() + endif() + endforeach (_current_FILE) endmacro(lyx_const_touched_files) macro(lyx_qt_resources_file _qrc_name _to_dir _list) - if (NOT EXISTS ${_qrc_name}) - set(_rebuild_file 1) - else() - FILE(READ ${_qrc_name} _file_content) - if (NOT _file_content) - set(_rebuild_file 1) - endif() - endif() - - if (_rebuild_file) - message(STATUS "Generating ${_qrc_name}") - file(WRITE ${_qrc_name} "<!DOCTYPE RCC><RCC version=\"1.0\">\n") - file(APPEND ${_qrc_name} "<qresource>\n") - - foreach (_current_FILE ${${_list}}) - get_filename_component(_abs_FILE ${_current_FILE} ABSOLUTE) - string(REGEX REPLACE "${_to_dir}" "" _file_name ${_abs_FILE}) - file(APPEND ${_qrc_name} " <file alias=\"${_file_name}\">${_abs_FILE}</file>\n") - endforeach (_current_FILE) - - file(APPEND ${_qrc_name} "</qresource>\n") - file(APPEND ${_qrc_name} "</RCC>\n") - endif() + if (NOT EXISTS ${_qrc_name}) + set(_rebuild_file 1) + else() + FILE(READ ${_qrc_name} _file_content) + if (NOT _file_content) + set(_rebuild_file 1) + endif() + endif() + + if (_rebuild_file) + message(STATUS "Generating ${_qrc_name}") + file(WRITE ${_qrc_name} "<!DOCTYPE RCC><RCC version=\"1.0\">\n") + file(APPEND ${_qrc_name} "<qresource>\n") + + foreach (_current_FILE ${${_list}}) + get_filename_component(_abs_FILE ${_current_FILE} ABSOLUTE) + string(REGEX REPLACE "${_to_dir}" "" _file_name ${_abs_FILE}) + file(APPEND ${_qrc_name} " <file alias=\"${_file_name}\">${_abs_FILE}</file>\n") + endforeach (_current_FILE) + + file(APPEND ${_qrc_name} "</qresource>\n") + file(APPEND ${_qrc_name} "</RCC>\n") + endif() endmacro(lyx_qt_resources_file) @@ -252,9 +249,9 @@ endif() endif() if(_msg) - string(SUBSTRING "LYX_${_name} " 0 25 _var) - string(SUBSTRING "${LYX_${_name}} " 0 4 _val) - message(STATUS "${_var}: ${_val} (${_description})") + string(SUBSTRING "LYX_${_name} " 0 25 _var) + string(SUBSTRING "${LYX_${_name}} " 0 4 _val) + message(STATUS "${_var}: ${_val} (${_description})") endif() endmacro() Modified: lyx-devel/trunk/development/cmake/po/CMakeLists.txt ============================================================================== --- lyx-devel/trunk/development/cmake/po/CMakeLists.txt Tue Jan 11 00:01:13 2011 (r37173) +++ lyx-devel/trunk/development/cmake/po/CMakeLists.txt Tue Jan 11 00:24:00 2011 (r37174) @@ -1,8 +1,8 @@ # This file is part of LyX, the document processor. # Licence details can be found in the file COPYING. # -# Copyright (c) 2008, 2009 Peter Kümmel, <[email protected]> -# Copyright (c) 2008, 2009 Kornel Benko, <[email protected]> +# Copyright (c) 2008-2011 Peter Kümmel, <[email protected]> +# Copyright (c) 2008-2011 Kornel Benko, <[email protected]> # project(po) Modified: lyx-devel/trunk/development/cmake/scripts/CMakeLists.txt ============================================================================== --- lyx-devel/trunk/development/cmake/scripts/CMakeLists.txt Tue Jan 11 00:01:13 2011 (r37173) +++ lyx-devel/trunk/development/cmake/scripts/CMakeLists.txt Tue Jan 11 00:24:00 2011 (r37174) @@ -1,12 +1,12 @@ # This file is part of LyX, the document processor. # Licence details can be found in the file COPYING. # -# Copyright (c) 2008, 2009 Peter K�mmel, <[email protected]> -# Copyright (c) 2008, 2009 Kornel Benko, <[email protected]> +# Copyright (c) 2008-2011 Peter Kümmel, <[email protected]> +# Copyright (c) 2008-2011 Kornel Benko, <[email protected]> # if (UNIX) - set(_project "scripts") - include(../PyCompile) + set(_project "scripts") + include(../PyCompile) endif() Modified: lyx-devel/trunk/development/cmake/src/CMakeLists.txt ============================================================================== --- lyx-devel/trunk/development/cmake/src/CMakeLists.txt Tue Jan 11 00:01:13 2011 (r37173) +++ lyx-devel/trunk/development/cmake/src/CMakeLists.txt Tue Jan 11 00:24:00 2011 (r37174) @@ -16,7 +16,7 @@ add_subdirectory(support) add_subdirectory(tex2lyx) if (UNIX) - add_subdirectory(client) + add_subdirectory(client) endif() file(GLOB lyx_sources ${TOP_SRC_DIR}/src/${LYX_CPP_FILES}) @@ -63,8 +63,8 @@ lyx_automoc(${TOP_SRC_DIR}/src/Compare.cpp) -if (WIN32) - lyx_automoc(${TOP_SRC_DIR}/src/Server.cpp) +if(WIN32) + lyx_automoc(${TOP_SRC_DIR}/src/Server.cpp) endif() include_directories(${CMAKE_CURRENT_BINARY_DIR} @@ -123,23 +123,23 @@ ${QT_QTMAIN_LIBRARY} ${vld_dll}) -if (HUNSPELL_FOUND) - target_link_libraries(${_lyx} ${HUNSPELL_LIBRARY}) +if(HUNSPELL_FOUND) + target_link_libraries(${_lyx} ${HUNSPELL_LIBRARY}) endif() -if (ASPELL_FOUND) +if(ASPELL_FOUND) target_link_libraries(${_lyx} ${ASPELL_LIBRARY}) endif() -if (ENCHANT_FOUND) - target_link_libraries(${_lyx} ${ENCHANT_LIBRARY}) +if(ENCHANT_FOUND) + target_link_libraries(${_lyx} ${ENCHANT_LIBRARY}) endif() -if (APPLE) - target_link_libraries(${_lyx} "-bind_at_load") - target_link_libraries(${_lyx} "-framework Carbon") +if(APPLE) + target_link_libraries(${_lyx} "-bind_at_load") + target_link_libraries(${_lyx} "-framework Carbon") endif() -if (MINGW) - target_link_libraries(${_lyx} ole32) +if(MINGW) + target_link_libraries(${_lyx} ole32) endif() project_source_group("${GROUP_CODE}" lyx_sources lyx_headers) Modified: lyx-devel/trunk/development/cmake/src/client/CMakeLists.txt ============================================================================== --- lyx-devel/trunk/development/cmake/src/client/CMakeLists.txt Tue Jan 11 00:01:13 2011 (r37173) +++ lyx-devel/trunk/development/cmake/src/client/CMakeLists.txt Tue Jan 11 00:24:00 2011 (r37174) @@ -1,8 +1,8 @@ # This file is part of LyX, the document processor. # Licence details can be found in the file COPYING. # -# Copyright (c) 2008, 2009 Peter Kümmel, <[email protected]> -# Copyright (c) 2008, 2009 Kornel Benko, <[email protected]> +# Copyright (c) 2008-2011 Peter Kümmel, <[email protected]> +# Copyright (c) 2008-2011 Kornel Benko, <[email protected]> # set(_lyxclient lyxclient${PROGRAM_SUFFIX}) @@ -14,8 +14,10 @@ list(REMOVE_ITEM _lyxclient_headers "${TOP_SRC_DIR}/src/client/pch.h") list(REMOVE_ITEM _lyxclient_sources "${TOP_SRC_DIR}/src/client/lyxclient.cpp") -include_directories(BEFORE "${TOP_SRC_DIR}/src/client" - "${TOP_SRC_DIR}/boost" ${ZLIB_INCLUDE_DIR}) +include_directories(BEFORE + "${TOP_SRC_DIR}/src/client" + "${TOP_SRC_DIR}/boost" + ${ZLIB_INCLUDE_DIR}) add_executable(${_lyxclient} ${_lyxclient_sources} ${_lyxclient_headers}) @@ -28,12 +30,12 @@ ${QT_QTGUI_LIBRARY} ) -if (ASPELL_FOUND) - target_link_libraries(${_lyxclient} ${ASPELL_LIBRARY}) +if(ASPELL_FOUND) + target_link_libraries(${_lyxclient} ${ASPELL_LIBRARY}) endif() -if (APPLE) - target_link_libraries(${_lyxclient} "-framework Carbon") +if(APPLE) + target_link_libraries(${_lyxclient} "-framework Carbon") endif() install(TARGETS ${_lyxclient} DESTINATION bin) Modified: lyx-devel/trunk/development/cmake/src/frontends/CMakeLists.txt ============================================================================== --- lyx-devel/trunk/development/cmake/src/frontends/CMakeLists.txt Tue Jan 11 00:01:13 2011 (r37173) +++ lyx-devel/trunk/development/cmake/src/frontends/CMakeLists.txt Tue Jan 11 00:24:00 2011 (r37174) @@ -1,7 +1,7 @@ # This file is part of LyX, the document processor. # Licence details can be found in the file COPYING. # -# Copyright (c) 2006, Peter K�mmel, <[email protected]> +# Copyright (c) 2006-2011 Peter K�mmel, <[email protected]> # project(frontends) Modified: lyx-devel/trunk/development/cmake/src/frontends/qt4/CMakeLists.txt ============================================================================== --- lyx-devel/trunk/development/cmake/src/frontends/qt4/CMakeLists.txt Tue Jan 11 00:01:13 2011 (r37173) +++ lyx-devel/trunk/development/cmake/src/frontends/qt4/CMakeLists.txt Tue Jan 11 00:24:00 2011 (r37174) @@ -1,23 +1,20 @@ # This file is part of LyX, the document processor. # Licence details can be found in the file COPYING. # -# Copyright (c) 2006, Peter K�mmel, <[email protected]> +# Copyright (c) 2006-2011 Peter K�mmel, <[email protected]> # project(frontend_qt4) -file(GLOB frontends_qt4_sources - ${TOP_SRC_DIR}/src/frontends/qt4/${LYX_CPP_FILES}) +file(GLOB frontends_qt4_sources ${TOP_SRC_DIR}/src/frontends/qt4/${LYX_CPP_FILES}) file(GLOB moc_files ${TOP_SRC_DIR}/src/frontends/qt4/${LYX_MOC_FILES}) list(REMOVE_ITEM frontends_qt4_sources ${moc_files} .) list(REMOVE_ITEM frontends_qt4_sources ${TOP_SRC_DIR}/src/frontends/qt4/liblyxqt4.cpp) list(REMOVE_ITEM frontends_qt4_sources ${TOP_SRC_DIR}/src/frontends/qt4/Resources.cpp) -file(GLOB frontends_qt4_headers - ${TOP_SRC_DIR}/src/frontends/qt4/${LYX_HPP_FILES}) -file(GLOB frontend_qt4_UI - ${TOP_SRC_DIR}/src/frontends/qt4/ui/*.ui) +file(GLOB frontends_qt4_headers ${TOP_SRC_DIR}/src/frontends/qt4/${LYX_HPP_FILES}) +file(GLOB frontend_qt4_UI ${TOP_SRC_DIR}/src/frontends/qt4/ui/*.ui) lyx_add_msvc_pch(frontends_qt4) @@ -45,15 +42,12 @@ if(LYX_MERGE_FILES) lyx_const_touched_files(_allinone 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} ${_allinone_files} ${frontends_qt4_headers} ${ui_files} ${resource_files}) else() - add_library(frontend_qt4 ${library_type} - ${frontends_qt4_sources} ${frontends_qt4_headers} ${ui_files} ${resource_files}) + add_library(frontend_qt4 ${library_type} ${frontends_qt4_sources} ${frontends_qt4_headers} ${ui_files} ${resource_files}) endif() @@ -68,8 +62,7 @@ target_link_libraries(frontend_qt4 Gdi32) endif() -project_source_group("${GROUP_CODE}" - frontends_qt4_sources frontends_qt4_headers) +project_source_group("${GROUP_CODE}" frontends_qt4_sources frontends_qt4_headers) source_group("Uic files" FILES ${frontend_qt4_UI}) Modified: lyx-devel/trunk/development/cmake/src/graphics/CMakeLists.txt ============================================================================== --- lyx-devel/trunk/development/cmake/src/graphics/CMakeLists.txt Tue Jan 11 00:01:13 2011 (r37173) +++ lyx-devel/trunk/development/cmake/src/graphics/CMakeLists.txt Tue Jan 11 00:24:00 2011 (r37174) @@ -1,7 +1,7 @@ # This file is part of LyX, the document processor. # Licence details can be found in the file COPYING. # -# Copyright (c) 2006, Peter K�mmel, <[email protected]> +# Copyright (c) 2006-2011 Peter K�mmel, <[email protected]> # project(graphics) Modified: lyx-devel/trunk/development/cmake/src/insets/CMakeLists.txt ============================================================================== --- lyx-devel/trunk/development/cmake/src/insets/CMakeLists.txt Tue Jan 11 00:01:13 2011 (r37173) +++ lyx-devel/trunk/development/cmake/src/insets/CMakeLists.txt Tue Jan 11 00:24:00 2011 (r37174) @@ -1,7 +1,7 @@ # This file is part of LyX, the document processor. # Licence details can be found in the file COPYING. # -# Copyright (c) 2006, Peter K�mmel, <[email protected]> +# Copyright (c) 2006-2011 Peter K�mmel, <[email protected]> # project(insets) Modified: lyx-devel/trunk/development/cmake/src/mathed/CMakeLists.txt ============================================================================== --- lyx-devel/trunk/development/cmake/src/mathed/CMakeLists.txt Tue Jan 11 00:01:13 2011 (r37173) +++ lyx-devel/trunk/development/cmake/src/mathed/CMakeLists.txt Tue Jan 11 00:24:00 2011 (r37174) @@ -1,7 +1,7 @@ # This file is part of LyX, the document processor. # Licence details can be found in the file COPYING. # -# Copyright (c) 2006, Peter K�mmel, <[email protected]> +# Copyright (c) 2006-2011, Peter K�mmel, <[email protected]> # project(mathed) Modified: lyx-devel/trunk/development/cmake/src/support/CMakeLists.txt ============================================================================== --- lyx-devel/trunk/development/cmake/src/support/CMakeLists.txt Tue Jan 11 00:01:13 2011 (r37173) +++ lyx-devel/trunk/development/cmake/src/support/CMakeLists.txt Tue Jan 11 00:24:00 2011 (r37174) @@ -1,7 +1,7 @@ # This file is part of LyX, the document processor. # Licence details can be found in the file COPYING. # -# Copyright (c) 2006, Peter K�mmel, <[email protected]> +# Copyright (c) 2006-2011 Peter Kümmel, <[email protected]> # project(support) Modified: lyx-devel/trunk/development/cmake/src/tex2lyx/CMakeLists.txt ============================================================================== --- lyx-devel/trunk/development/cmake/src/tex2lyx/CMakeLists.txt Tue Jan 11 00:01:13 2011 (r37173) +++ lyx-devel/trunk/development/cmake/src/tex2lyx/CMakeLists.txt Tue Jan 11 00:24:00 2011 (r37174) @@ -1,8 +1,8 @@ # This file is part of LyX, the document processor. # Licence details can be found in the file COPYING. # -# Copyright (c) 2006, 2008, 2009 Peter K�mmel, <[email protected]> -# Copyright (c) 2008, 2009 Kornel Benko, <[email protected]> +# Copyright (c) 2006-2011 Peter Kümmel, <[email protected]> +# Copyright (c) 2008-2011 Kornel Benko, <[email protected]> # set(_tex2lyx tex2lyx${PROGRAM_SUFFIX}) @@ -13,25 +13,26 @@ set(LINKED_headers) foreach(_src insets/InsetLayout Color Counters - Encoding FloatList Floating - Layout LayoutModuleList Lexer ModuleList TextClass - FontInfo Spacing) - list(APPEND LINKED_sources ${TOP_SRC_DIR}/src/${_src}.cpp) - list(APPEND LINKED_headers ${TOP_SRC_DIR}/src/${_src}.h) + Encoding FloatList Floating + Layout LayoutModuleList Lexer ModuleList TextClass + FontInfo Spacing) + list(APPEND LINKED_sources ${TOP_SRC_DIR}/src/${_src}.cpp) + list(APPEND LINKED_headers ${TOP_SRC_DIR}/src/${_src}.h) endforeach(_src) file(GLOB tex2lyx_sources ${TOP_SRC_DIR}/src/tex2lyx/${LYX_CPP_FILES}) file(GLOB tex2lyx_headers ${TOP_SRC_DIR}/src/tex2lyx/${LYX_HPP_FILES}) -include_directories(BEFORE ${TOP_SRC_DIR}/src/tex2lyx - ${TOP_SRC_DIR}/src/support/minizip ${ZLIB_INCLUDE_DIR}) +include_directories(BEFORE + ${TOP_SRC_DIR}/src/tex2lyx + ${TOP_SRC_DIR}/src/support/minizip + ${ZLIB_INCLUDE_DIR}) add_definitions(-DTEX2LYX) if(NOT LYX_MERGE_FILES) - add_executable(${_tex2lyx} ${tex2lyx_sources} ${LINKED_sources} - ${tex2lyx_headers} ${LINKED_headers}) + add_executable(${_tex2lyx} ${tex2lyx_sources} ${LINKED_sources} ${tex2lyx_headers} ${LINKED_headers}) else() lyx_const_touched_files(_allinone tex2lyx_sources) lyx_const_touched_files(_allinone_linked LINKED_sources)
