]> git.lyx.org Git - features.git/commitdiff
cmake: we have 2011 and more white space changes, won't call "use tabs" ;)
authorPeter Kümmel <syntheticpp@gmx.net>
Mon, 10 Jan 2011 23:24:00 +0000 (23:24 +0000)
committerPeter Kümmel <syntheticpp@gmx.net>
Mon, 10 Jan 2011 23:24:00 +0000 (23:24 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@37174 a592a061-630c-0410-9148-cb99ea01b6c8

21 files changed:
development/cmake/CMakeLists.txt
development/cmake/boost/CMakeLists.txt
development/cmake/boost/libs/CMakeLists.txt
development/cmake/boost/libs/regex/CMakeLists.txt
development/cmake/boost/libs/signals/CMakeLists.txt
development/cmake/doc/CMakeLists.txt
development/cmake/intl/CMakeLists.txt
development/cmake/lyx2lyx/CMakeLists.txt
development/cmake/man/CMakeLists.txt
development/cmake/modules/LyXMacros.cmake
development/cmake/po/CMakeLists.txt
development/cmake/scripts/CMakeLists.txt
development/cmake/src/CMakeLists.txt
development/cmake/src/client/CMakeLists.txt
development/cmake/src/frontends/CMakeLists.txt
development/cmake/src/frontends/qt4/CMakeLists.txt
development/cmake/src/graphics/CMakeLists.txt
development/cmake/src/insets/CMakeLists.txt
development/cmake/src/mathed/CMakeLists.txt
development/cmake/src/support/CMakeLists.txt
development/cmake/src/tex2lyx/CMakeLists.txt

index 3c06219599c1fc7c626e4e7869640026a6eb5572..fffbd21d07230287efd0d48bd3b6294b115065e4 100644 (file)
@@ -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, <syntheticpp@gmx.net>
-# Copyright (c) 2008-2010 Kornel Benko, <Kornel.Benko@berlin.de>
+# Copyright (c) 2006-2011 Peter Kümmel, <syntheticpp@gmx.net>
+# Copyright (c) 2008-2011 Kornel Benko, <Kornel.Benko@berlin.de>
 
 
 cmake_minimum_required(VERSION 2.6.4)
index fed3b9a8c17c21d7c54d1dfc520195ca19dff451..6d7839a7136902d5f8e5d79f82e292ba8674fa2d 100644 (file)
@@ -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, <syntheticpp@gmx.net>
+# Copyright (c) 2006-2011 Peter Kümmel, <syntheticpp@gmx.net>
 #
 
 add_subdirectory(libs) 
index c4ec26c182e742d1136795698111aab14a2e07ad..67a68498afbddd0d95b1a4d4b654e7437bbc9273 100644 (file)
@@ -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, <syntheticpp@gmx.net>
+# Copyright (c) 2010-2011 Peter Kümmel, <syntheticpp@gmx.net>
 #
 
 project(boost)
index 0f65b40f819e13f961ac68fb5793a90f7d36b2ad..ffce508a80cd4c162563ceebc0eafef7304f85c7 100644 (file)
@@ -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, <syntheticpp@gmx.net>
+# Copyright (c) 2006-2011 Peter Kümmel, <syntheticpp@gmx.net>
 #
 
 project(boost_regex)
index 16a39059c2a384986e7d3ca821b39dc09b77f4bd..6616401edb1cda35e84c2f491e1d4a5632060e36 100644 (file)
@@ -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, <syntheticpp@gmx.net>
+# Copyright (c) 2006-2011 Peter Kümmel, <syntheticpp@gmx.net>
 #
 
 project(boost_signals)
index 1217f83b21720499e97ac2d39cf8eb61db93c84c..0fa78547687142d6ef2aac6efea8e52fa9af44de 100644 (file)
@@ -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, <syntheticpp@gmx.net>
-# Copyright (c) 2008-2010 Kornel Benko, <Kornel.Benko@berlin.de>
+# Copyright (c) 2008-2011 Peter Kümmel, <syntheticpp@gmx.net>
+# Copyright (c) 2008-2011 Kornel Benko, <Kornel.Benko@berlin.de>
 #
 
 project(doc)
index 313fa623f239b2cc7c936fea5cb63852277f3a52..c03c3423cd9fe520128c3d91e1cc7255dfbeaea5 100644 (file)
@@ -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, <syntheticpp@gmx.net>
+# Copyright (c) 2006,2011 Peter Kümmel, <syntheticpp@gmx.net>
 #
 
 project(intl) 
@@ -12,57 +12,57 @@ configure_file(libgnuintl.h ${CMAKE_CURRENT_BINARY_DIR}/libintl.h COPYONLY)
 
 
 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)
index f3517d301e9579b8d6889be59b1bb46ddfaeccf0..ed30a54d31083ca4dc6767b4d892ace3695eb669 100644 (file)
@@ -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, <syntheticpp@gmx.net>
-# Copyright (c) 2008-2010 Kornel Benko, <Kornel.Benko@berlin.de>
+# Copyright (c) 2008-2011 Peter Kümmel, <syntheticpp@gmx.net>
+# Copyright (c) 2008-2011 Kornel Benko, <Kornel.Benko@berlin.de>
 #
 
 configure_file(${TOP_SRC_DIR}/lib/lyx2lyx/lyx2lyx_version.py.in 
@@ -10,8 +10,8 @@ configure_file(${TOP_SRC_DIR}/lib/lyx2lyx/lyx2lyx_version.py.in
 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)
index 84d4bc32d5b68e70a2048548feeb392c977ff9c7..1cec15475be73900f34f29aa26ad5a047986a3d0 100755 (executable)
@@ -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, <syntheticpp@gmx.net>
-# Copyright (c) 2008-2010 Kornel Benko, <Kornel.Benko@berlin.de>
+# Copyright (c) 2008-2011 Peter Kümmel, <syntheticpp@gmx.net>
+# Copyright (c) 2008-2011 Kornel Benko, <Kornel.Benko@berlin.de>
 #
 
 project(man)
@@ -11,17 +11,18 @@ SET(_manuals)
 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})
index 2d0a1ff94907b3d44b48a16e57dd28de696226e7..1e9dd676925c7f402de323f06358f6afd44e7f2d 100644 (file)
@@ -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
 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})
-
-      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}
+       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}
         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()
-
-      endif()
-   endforeach (_current_FILE)
+       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()
+               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()
-
-   #add merged files also to the project so they become editable
-       if(${GROUP_CODE} MATCHES "flat")
+       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()
+
+       #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})
-
-   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)
+       
+       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)
 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 @@ macro(LYX_OPTION _name _description _default _sys)
                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()
 
index f0fff57f149b1b5a51ed5fc0c35370be56fdbdfd..1d8417fe8331ebfeef97df713374e8c1aa8ccd0b 100755 (executable)
@@ -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, <syntheticpp@gmx.net>
-# Copyright (c) 2008, 2009 Kornel Benko, <Kornel.Benko@berlin.de>
+# Copyright (c) 2008-2011 Peter Kümmel, <syntheticpp@gmx.net>
+# Copyright (c) 2008-2011 Kornel Benko, <Kornel.Benko@berlin.de>
 #
 
 project(po)
index 5977bc70da1f5f7c13dbe42a0d8c44e43427ea95..2274dc0506b163282ece01da20265a52decd4fb4 100644 (file)
@@ -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, <syntheticpp@gmx.net>
-# Copyright (c) 2008, 2009 Kornel Benko, <Kornel.Benko@berlin.de>
+# Copyright (c) 2008-2011 Peter Kümmel, <syntheticpp@gmx.net>
+# Copyright (c) 2008-2011 Kornel Benko, <Kornel.Benko@berlin.de>
 #
 
 if (UNIX)
-  set(_project "scripts")
-  include(../PyCompile)
+       set(_project "scripts")
+       include(../PyCompile)
 endif()
 
index 773bfb2bcf3bcc6d74ee0c007cb49ea7265ecbe5..19cb613f256da53b015c443b8b50ceba719f8ed1 100644 (file)
@@ -16,7 +16,7 @@ add_subdirectory(mathed)
 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 @@ endif()
 
 
 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 @@ target_link_libraries(${_lyx}
        ${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)
index 1ed547918e019d86de9a33f8b213914b6dc42bd2..90b407ce58fa48f445324f43ee8209a41c71172e 100644 (file)
@@ -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, <syntheticpp@gmx.net>
-# Copyright (c) 2008, 2009 Kornel Benko, <Kornel.Benko@berlin.de>
+# Copyright (c) 2008-2011 Peter Kümmel, <syntheticpp@gmx.net>
+# Copyright (c) 2008-2011 Kornel Benko, <Kornel.Benko@berlin.de>
 #
 
 set(_lyxclient lyxclient${PROGRAM_SUFFIX})
@@ -14,8 +14,10 @@ file(GLOB _lyxclient_headers ${TOP_SRC_DIR}/src/client/*.h)
 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 @@ target_link_libraries(${_lyxclient}
        ${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)
index 4f59705e6ac4a9a12a34db1de7adfbf0ce94002b..171e0a26f996bd21ab1c89a1cde73eb3d027d49f 100644 (file)
@@ -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, <syntheticpp@gmx.net>
+# Copyright (c) 2006-2011 Peter Kümmel, <syntheticpp@gmx.net>
 #
 
 project(frontends)
index 4fbd30826bd8ecbc2e31091db09726a427877522..a97f596472b6988a98148acc89d531f879b44077 100644 (file)
@@ -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, <syntheticpp@gmx.net>
+# Copyright (c) 2006-2011 Peter Kümmel, <syntheticpp@gmx.net>
 #
 
 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 @@ endif()
 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 @@ if(WIN32)
        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})
 
index 2d46051486842f98aa92df0189d48acb81fc0060..56daf64b088ccc3c061a59981038c5fa66bb7310 100644 (file)
@@ -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, <syntheticpp@gmx.net>
+# Copyright (c) 2006-2011 Peter Kümmel, <syntheticpp@gmx.net>
 #
 
 project(graphics)
index 175485e10d75096f057a00e2b9d1a77f31cdb02c..a16ce3f496910fa528dca3c90f3ce510a64da7f4 100644 (file)
@@ -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, <syntheticpp@gmx.net>
+# Copyright (c) 2006-2011 Peter Kümmel, <syntheticpp@gmx.net>
 #
 
 project(insets)
index d035eb9cb85c164f2e0875c99e49b4115b1d5c4f..55dd303795639b09b0b8abfe1baae6e884991e52 100644 (file)
@@ -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, <syntheticpp@gmx.net>
+# Copyright (c) 2006-2011, Peter Kümmel, <syntheticpp@gmx.net>
 #
 
 project(mathed)
index 8e66b497420d30f2ae97e90c2430dad79a32fdb1..c9dce581c6c1402231f89ddd42fc9a3a1d4fbe58 100644 (file)
@@ -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, <syntheticpp@gmx.net>
+# Copyright (c) 2006-2011 Peter Kümmel, <syntheticpp@gmx.net>
 #
 
 project(support)
index 0058487e0eab6f5cace90d4b8670deec8100ba07..42b2efec97b0d8383db656ca951fd6a08d0be660 100644 (file)
@@ -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, <syntheticpp@gmx.net>
-# Copyright (c)       2008, 2009 Kornel Benko, <Kornel.Benko@berlin.de>
+# Copyright (c) 2006-2011 Peter Kümmel, <syntheticpp@gmx.net>
+# Copyright (c) 2008-2011 Kornel Benko, <Kornel.Benko@berlin.de>
 #
 
 set(_tex2lyx tex2lyx${PROGRAM_SUFFIX})
@@ -13,25 +13,26 @@ set(LINKED_sources ${TOP_SRC_DIR}/src/lengthcommon.cpp)
 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)