]> git.lyx.org Git - features.git/commitdiff
cmake precompile:
authorPeter Kümmel <syntheticpp@gmx.net>
Mon, 23 Oct 2006 19:04:29 +0000 (19:04 +0000)
committerPeter Kümmel <syntheticpp@gmx.net>
Mon, 23 Oct 2006 19:04:29 +0000 (19:04 +0000)
- only precompile boost and stl headers
- for qt4 also precompile QtGui and QtGui
- don't use one global precomiled header file
  to get out of the dependency hell

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@15517 a592a061-630c-0410-9148-cb99ea01b6c8

development/cmake/CMakeLists.txt
development/cmake/config.h.cmake
development/cmake/pcheaders.h
development/cmake/src/CMakeLists.txt
development/cmake/src/frontends/CMakeLists.txt
development/cmake/src/frontends/controllers/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

index 4512ec70948dacad427d3d8728ce493947f09509..6198f7006ebfbcf6301ff949898d3f2a0be651de 100644 (file)
@@ -96,27 +96,18 @@ endif(MSVC)
 
 if(pch AND MSVC)
        set(pch TRUE CACHE TYPE STRING)
-
-       macro(lyx_add_msvc_pch _sources)
-               SET_SOURCE_FILES_PROPERTIES(${${_sources}} PROPERTIES COMPILE_FLAGS 
-                       "/Yuconfig.h /Fp${CMAKE_BINARY_DIR}/config.pch /Fd${CMAKE_BINARY_DIR}/pchlib.pdb")
-               add_definitions(-DLYX_PRECOMPILED_HEADERS)
+       configure_file(${CMAKE_SOURCE_DIR}/pcheaders.h    ${CMAKE_BINARY_DIR}/pcheaders.h)
+       macro(lyx_add_msvc_pch name_)
+               configure_file(${CMAKE_SOURCE_DIR}/config.C.cmake ${CMAKE_CURRENT_BINARY_DIR}/config.C)
+               SET_SOURCE_FILES_PROPERTIES(${${name_}_sources} PROPERTIES COMPILE_FLAGS /Yuconfig.h)
+               SET_SOURCE_FILES_PROPERTIES(${CMAKE_CURRENT_BINARY_DIR}/config.C PROPERTIES COMPILE_FLAGS /Ycconfig.h)
+               add_definitions(/DLYX_PRECOMPILED_HEADERS)
+               set(${name_}_sources ${${name_}_sources} ${CMAKE_CURRENT_BINARY_DIR}/config.C ${CMAKE_BINARY_DIR}/pcheaders.h)
        endmacro(lyx_add_msvc_pch)
-       
-       configure_file(config.C.cmake ${CMAKE_BINARY_DIR}/config.C)
-       configure_file(pcheaders.h ${CMAKE_BINARY_DIR}/pcheaders.h)
-       SET_SOURCE_FILES_PROPERTIES(${CMAKE_BINARY_DIR}/config.C PROPERTIES COMPILE_FLAGS  
-               "/Ycconfig.h /Fp${CMAKE_BINARY_DIR}/config.pch /Fd${CMAKE_BINARY_DIR}/pchlib.pdb -DLYX_PRECOMPILED_HEADERS")
-               
-       include_directories(${CMAKE_CURRENT_BINARY_DIR} ${TOP_SRC_DIR}/src/support ${ICONV_INCLUDE_DIR})
-       add_library(pchlib STATIC ${CMAKE_BINARY_DIR}/config.C ${CMAKE_BINARY_DIR}/pcheaders.h)
-       
-       set(pchlibname pchlib )
        set(PRECOMPILED_HEADERS TRUE)
 else(pch AND MSVC)
        macro(lyx_add_msvc_pch)
        endmacro(lyx_add_msvc_pch)
-       set(pchlibname boost_signals) # dummy 
 endif(pch AND MSVC)
 
 
index d96187cdb5a2877a99ff452d45f7838cbc46797b..fb1e7d42989c39ecf301b1cc1bc26575ff370b36 100644 (file)
 #endif
 
 #ifdef LYX_PRECOMPILED_HEADERS
-#include "pcheaders.h"
+#  include "pcheaders.h"
+#  ifdef LYX_BUILD_QT4_FRONTEND
+#    include <QtCore>
+#    include <QtGUI>
+#  endif
 #endif
 
 #endif
index 2a588e7dd515c23ae922065ea493acbae8dc15a7..b4239847db706729cf4d12898b4f34b1433805d5 100644 (file)
  */
 
 
-//#define LYX_DONT_PRECOMPILE_SRC
-
 #include <boost/any.hpp>
 #include <boost/array.hpp>
 #include <boost/assert.hpp>
+#include <boost/bind.hpp>
 #include <boost/crc.hpp>
 #include <boost/cregex.hpp>
 #include <boost/current_function.hpp>
+#include <boost/filesystem/operations.hpp>
 #include <boost/function.hpp>
+#include <boost/iostreams/device/file.hpp>
+#include <boost/iostreams/filter/gzip.hpp>
+#include <boost/iostreams/filtering_streambuf.hpp>
 #include <boost/iterator/indirect_iterator.hpp>
 #include <boost/optional.hpp>
 #include <boost/regex.hpp>
 #include <boost/scoped_array.hpp>
 #include <boost/scoped_ptr.hpp>
-#include <boost/shared_ptr.hpp>
-#include <boost/signals/connection.hpp>
 #include <boost/signal.hpp>
+#include <boost/signals/connection.hpp>
 #include <boost/signals/trackable.hpp>
+#include <boost/tokenizer.hpp>
+#include <boost/tuple/tuple.hpp>
+#include <boost/utility.hpp>
 #include <boost/version.hpp>
 
 #if BOOST_VERSION < 103300
 # include <boost/test/utils/nullstream.hpp>
 #endif
 
-#include <boost/tokenizer.hpp>
-#include <boost/tuple/tuple.hpp>
-#include <boost/utility.hpp>
 
 #include <algorithm>
 #include <cerrno>
+#include <cassert>
 #include <clocale>
 #include <csignal>
 #include <cstddef>
 #include <queue>
 #include <set>
 #include <sstream>
+#include <string>
 #include <stack>
 #include <string>
 #include <utility>
 #include <vector>
-
-#ifndef LYX_DONT_PRECOMPILE_SRC
-#include <vspace.h>
-#include <version.h>
-#include <vc-backend.h>
-#include <undo.h>
-#include <trans_mgr.h>
-#include <trans_decl.h>
-#include <trans.h>
-#include <toc.h>
-#include <texrow.h>
-#include <tex-strings.h>
-#include <tex-accent.h>
-#include <tabular.h>
-#include <sgml.h>
-#include <session.h>
-#include <rowpainter.h>
-#include <pspell.h>
-#include <pariterator.h>
-#include <paragraph_pimpl.h>
-#include <paragraph_funcs.h>
-#include <paragraph.h>
-#include <paper.h>
-#include <outputparams.h>
-#include <output_plaintext.h>
-#include <output_latex.h>
-#include <output_docbook.h>
-#include <output.h>
-#include <mover.h>
-#include <metricsinfo.h>
-#include <messages.h>
-#include <lyxvc.h>
-#include <lyxtextclasslist.h>
-#include <lyxtextclass.h>
-#include <lyxtext.h>
-#include <lyxsocket.h>
-#include <lyxserver.h>
-#include <lyxrow.h>
-#include <lyxrc.h>
-#include <lyxlex_pimpl.h>
-#include <lyxlex.h>
-#include <lyxlength.h>
-#include <lyxlayout_ptr_fwd.h>
-#include <lyxlayout.h>
-#include <lyxgluelength.h>
-#include <lyxfunc.h>
-#include <lyxfont.h>
-#include <lyxfind.h>
-#include <lyx_sty.h>
-#include <lyx_main.h>
-#include <lyx_cb.h>
-#include <lfuns.h>
-#include <lengthcommon.h>
-#include <layout.h>
-#include <language.h>
-#include <kbsequence.h>
-#include <kbmap.h>
-#include <ispell.h>
-#include <intl.h>
-#include <insetiterator.h>
-#include <importer.h>
-#include <graph.h>
-#include <gettext.h>
-#include <funcrequest.h>
-#include <format.h>
-#include <factory.h>
-#include <exporter.h>
-#include <errorlist.h>
-#include <encoding.h>
-#include <dociterator.h>
-#include <dispatchresult.h>
-#include <dimension.h>
-#include <debug.h>
-#include <cursor_slice.h>
-#include <cursor.h>
-#include <counters.h>
-#include <coordcache.h>
-#include <converter.h>
-#include <chset.h>
-#include <changes.h>
-#include <bufferview_funcs.h>
-#include <bufferparams.h>
-#include <bufferlist.h>
-#include <buffer_funcs.h>
-#include <buffer.h>
-#include <box.h>
-#include <author.h>
-#include <aspell_local.h>
-#include <WordLangTuple.h>
-#include <Variables.h>
-#include <ToolbarBackend.h>
-#include <TocBackend.h>
-#include <Thesaurus.h>
-#include <SpellBase.h>
-#include <Spacing.h>
-#include <Sectioning.h>
-#include <RowList_fwd.h>
-#include <PrinterParams.h>
-#include <ParagraphParameters.h>
-#include <ParagraphList_fwd.h>
-#include <ParagraphList.h>
-#include <MenuBackend.h>
-#include <LyXAction.h>
-#include <LaTeXFeatures.h>
-#include <LaTeX.h>
-#include <LColor.h>
-#include <InsetList.h>
-#include <FuncStatus.h>
-#include <FontIterator.h>
-#include <Floating.h>
-#include <FloatList.h>
-#include <DepTable.h>
-#include <CutAndPaste.h>
-#include <Color.h>
-#include <Chktex.h>
-#include <Bullet.h>
-#include <BufferView.h>
-#include <BranchList.h>
-#include <Bidi.h>
-#endif
index a18f1d6f5f92713a6f14348a291f2397eb44374c..25da339d6ee1179e9b612fafc2b522d48420b902 100644 (file)
@@ -35,7 +35,7 @@ endif(ASPELL_FOUND)
 
 include_directories(${CMAKE_CURRENT_BINARY_DIR})
 
-lyx_add_msvc_pch(lyx_sources)
+lyx_add_msvc_pch(lyx)
 
 set(lyx_sources ${lyx_sources} ${CMAKE_CURRENT_BINARY_DIR}/version.C)
 
@@ -54,7 +54,6 @@ target_link_libraries(lyx-${qt_postfix}
        intl
        ${QT_QTMAIN_LIBRARY}
        boost_iostreams
-       ${pchlibname}
 )
 
 if(ASPELL_FOUND)
index 55e73bfd0105c9ecd9b7a5f39860545eae25e97c..52c565a1808d4297893631e7619c8dc7819485b6 100644 (file)
@@ -12,15 +12,12 @@ add_subdirectory(controllers)
 add_subdirectory(${qt_postfix}) 
 
 
-
 file(GLOB frontends_sources ${TOP_SRC_DIR}/src/frontends/*.C)
 file(GLOB frontends_headers ${TOP_SRC_DIR}/src/frontends/*.h)
 
-lyx_add_msvc_pch(frontends_sources)
+lyx_add_msvc_pch(frontends)
 
 add_library(frontends STATIC ${frontends_sources} ${frontends_headers})
 
-add_dependencies(frontends ${pchlibname})
-
 project_source_group("${GROUP_CODE}" frontends_sources frontends_headers)
 
index a5c572348b189e9fc53056698a848b39cf3d9b5f..28e613c3c5e5f6a864ba4b49e9b860270cc13f31 100644 (file)
@@ -9,7 +9,7 @@ project(controllers)
 file(GLOB controllers_sources ${TOP_SRC_DIR}/src/frontends/controllers/*.C)
 file(GLOB controllers_headers ${TOP_SRC_DIR}/src/frontends/controllers/*.h)
 
-lyx_add_msvc_pch(controllers_sources)
+lyx_add_msvc_pch(controllers)
 
 include_directories(${TOP_SRC_DIR}/src/frontends/controllers)
 
@@ -17,7 +17,5 @@ add_library(controllers STATIC ${controllers_sources} ${controllers_headers})
 
 target_link_libraries(controllers boost_regex boost_filesystem)
 
-add_dependencies(controllers ${pchlibname})
-
 project_source_group("${GROUP_CODE}" controllers_sources controllers_headers)
 
index b0dab2fadad9b8e988e22e4a3de33825e5591fa0..ec26f4e2774b1b8a8330f5c8abddf64674642740 100644 (file)
@@ -11,7 +11,7 @@ file(GLOB frontends_qt4_sources ${TOP_SRC_DIR}/src/frontends/qt4/*.C)
 file(GLOB frontends_qt4_headers ${TOP_SRC_DIR}/src/frontends/qt4/*.h)
 file(GLOB frontend_qt4_UI       ${TOP_SRC_DIR}/src/frontends/qt4/ui/*.ui)
 
-lyx_add_msvc_pch(frontends_qt4_sources)
+lyx_add_msvc_pch(frontends_qt4)
 
 lyx_automoc(${frontends_qt4_sources})
 
@@ -22,6 +22,7 @@ add_definitions(
                -DQT_GENUINE_STR
                -DQT_NO_STL
                -DQT_NO_KEYWORDS
+               -DLYX_BUILD_QT4_FRONTEND
                )
 
 
@@ -33,8 +34,6 @@ add_library(frontend_qt4 STATIC ${frontends_qt4_sources} ${frontends_qt4_headers
 
 target_link_libraries(frontend_qt4 ${QT_QTCORE_LIBRARY} ${QT_QTGUI_LIBRARY} controllers)
 
-add_dependencies(frontend_qt4 ${pchlibname})
-
 if(WIN32)
        target_link_libraries(frontend_qt4 Gdi32)
 endif(WIN32)
index 3eb5421396d6bb49670a93b033aff53bbc4771c2..fe24c1e25f47070e10f2c8397cdb21d40f9980d6 100644 (file)
@@ -9,13 +9,11 @@ project(graphics)
 file(GLOB graphics_sources ${TOP_SRC_DIR}/src/graphics/*.C)
 file(GLOB graphics_headers ${TOP_SRC_DIR}/src/graphics/*.h)
 
-lyx_add_msvc_pch(graphics_sources)
+lyx_add_msvc_pch(graphics)
 
 include_directories(${TOP_SRC_DIR}/src/graphics)
 
 add_library(graphics STATIC ${graphics_sources} ${graphics_headers})
 
-add_dependencies(graphics ${pchlibname})
-
 project_source_group("${GROUP_CODE}" graphics_sources graphics_headers)
 
index 4fe34c569d24fdd448386cf5fa05d0bdbe8f2288..733f4dc9863055f57ae90b94d8b6f1a24a043736 100644 (file)
@@ -11,13 +11,11 @@ file(GLOB insets_headers ${TOP_SRC_DIR}/src/insets/*.h)
 
 list(REMOVE_ITEM insets_sources ${TOP_SRC_DIR}/src/insets/insettheorem.C)
 
-lyx_add_msvc_pch(insets_sources)
+lyx_add_msvc_pch(insets)
 
 include_directories(${TOP_SRC_DIR}/src/insets)
 
 add_library(insets STATIC ${insets_sources} ${insets_headers})
 
-add_dependencies(insets ${pchlibname})
-
 project_source_group("${GROUP_CODE}" insets_sources insets_headers)
 
index d0e91000de586975feb29bb0cc0cde9a7c74c978..65ec0432950fde0e9f2786ce6cfd9af3ad9b7ec3 100644 (file)
@@ -14,13 +14,11 @@ list(REMOVE_ITEM mathed_sources
        ${TOP_SRC_DIR}/src/mathed/InsetMathMBox.C
        ${TOP_SRC_DIR}/src/mathed/InsetFormulaMacro.C)
 
-lyx_add_msvc_pch(mathed_sources)
+lyx_add_msvc_pch(mathed)
 
 include_directories(${TOP_SRC_DIR}/src/mathed)
 
 add_library(mathed STATIC ${mathed_sources} ${mathed_headers})
 
-add_dependencies(mathed ${pchlibname})
-
 project_source_group("${GROUP_CODE}" mathed_sources mathed_headers)
 
index ce2784676b5860438e75008e0f8d2235a78dd317..c23a30817050482b8867acbb4ce5e803c767f109 100644 (file)
@@ -20,9 +20,9 @@ list(REMOVE_ITEM support_sources
        ${TOP_SRC_DIR}/src/support/atexit.c
        ${TOP_SRC_DIR}/src/support/strerror.c)
 
-lyx_add_msvc_pch(support_sources)
-
 set(support_sources ${support_sources} ${CMAKE_CURRENT_BINARY_DIR}/package.C)
+
+lyx_add_msvc_pch(support)
        
 include_directories(${TOP_SRC_DIR}/src/support ${ICONV_INCLUDE_DIR})
 
@@ -30,8 +30,6 @@ add_library(support STATIC ${support_sources} ${support_headers})
 
 target_link_libraries(support boost_signals)
 
-add_dependencies(support ${pchlibname})
-
 if(WIN32)
        target_link_libraries(support shlwapi)
 endif(WIN32)