]> git.lyx.org Git - features.git/commitdiff
cmake: precompiled headers
authorPeter Kümmel <syntheticpp@gmx.net>
Wed, 25 Oct 2006 17:57:04 +0000 (17:57 +0000)
committerPeter Kümmel <syntheticpp@gmx.net>
Wed, 25 Oct 2006 17:57:04 +0000 (17:57 +0000)
    - enable by default, could be disabled with -Ddisable-pch
    - use different pch files for Debug/Release/...
    - use only one config_pch.C

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

development/cmake/CMakeLists.txt

index 6198f7006ebfbcf6301ff949898d3f2a0be651de..97dcb7421b2ad5a2a2a5b3bc48d1df6a3358573d 100644 (file)
@@ -94,21 +94,20 @@ else(MSVC)
        add_definitions(-DBOOST_USER_CONFIG="<config.h>")
 endif(MSVC)
 
-if(pch AND MSVC)
-       set(pch TRUE CACHE TYPE STRING)
+if(MSVC AND NOT disable-pch)
        configure_file(${CMAKE_SOURCE_DIR}/pcheaders.h    ${CMAKE_BINARY_DIR}/pcheaders.h)
+       configure_file(${CMAKE_SOURCE_DIR}/config.C.cmake ${CMAKE_CURRENT_BINARY_DIR}/config_pch.C)
        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)
+               SET_SOURCE_FILES_PROPERTIES(${${name_}_sources} PROPERTIES COMPILE_FLAGS "/Yuconfig.h /Fp\$(IntDir)/config.pch")
+               SET_SOURCE_FILES_PROPERTIES(${CMAKE_BINARY_DIR}/config_pch.C PROPERTIES COMPILE_FLAGS "/Ycconfig.h /Fp\$(IntDir)/config.pch")
                add_definitions(/DLYX_PRECOMPILED_HEADERS)
-               set(${name_}_sources ${${name_}_sources} ${CMAKE_CURRENT_BINARY_DIR}/config.C ${CMAKE_BINARY_DIR}/pcheaders.h)
+               set(${name_}_sources ${${name_}_sources} ${CMAKE_BINARY_DIR}/config_pch.C ${CMAKE_BINARY_DIR}/pcheaders.h)
        endmacro(lyx_add_msvc_pch)
-       set(PRECOMPILED_HEADERS TRUE)
-else(pch AND MSVC)
+else(MSVC AND NOT disable-pch)
+       set(disable-pch TRUE CACHE TYPE STRING)
        macro(lyx_add_msvc_pch)
        endmacro(lyx_add_msvc_pch)
-endif(pch AND MSVC)
+endif(MSVC AND NOT disable-pch)
 
 
 #TODO: insource is not the best place