[Kst] branches/work/kst/portto4/kst/cmake/modules
Peter Kümmel
syntheticpp at gmx.net
Tue Jan 18 14:23:46 CET 2011
SVN commit 1215374 by kuemmel:
Studio holds multiple pchs in the build folder
M +4 -2 KstPchSupport.cmake
--- branches/work/kst/portto4/kst/cmake/modules/KstPchSupport.cmake #1215373:1215374
@@ -23,6 +23,8 @@
macro(kst_add_pch_rule _header _sources _lib_type)
+ set(_pch_name ${_header}.${CMAKE_BUILD_TYPE})
+
if(CMAKE_COMPILER_IS_GNUCC)
# first we have to find all compiler arguments
get_directory_property(_definitions COMPILE_DEFINITIONS)
@@ -49,7 +51,7 @@
LIST(APPEND _args "-I" ${_inc})
endforeach(_inc ${DIRINC})
- set(_gch_filename "${_header}.gch")
+ set(_gch_filename "${_pch_name}.gch")
list(APPEND ${_sources} ${_gch_filename})
list(APPEND _args -c ${_header} -o ${_gch_filename})
@@ -69,7 +71,7 @@
file(WRITE ${_header}.tmp "#include \"${_header}\"\n")
execute_process(COMMAND ${CMAKE_COMMAND} -E copy_if_different ${_header}.tmp ${_header}.cpp)
- set(use_pch /Fp${_header}.pch)
+ set(use_pch /Fp${_pch_name}.pch)
set_source_files_properties(${_header}.cpp PROPERTIES COMPILE_FLAGS "/Yc\"${_header}\" ${use_pch}")
# Bug in cmake: next line also compile .c files with pchs
More information about the Kst
mailing list