[Kst] branches/work/kst/portto4/kst/cmake/modules

Peter Kümmel syntheticpp at gmx.net
Fri Oct 5 15:02:35 UTC 2012


SVN commit 1319283 by kuemmel:

add missing dependency for pre-compiled header file

 M  +8 -5      KstPchSupport.cmake  


--- branches/work/kst/portto4/kst/cmake/modules/KstPchSupport.cmake #1319282:1319283
@@ -72,19 +72,22 @@
 		execute_process(COMMAND ${CMAKE_COMMAND} -E copy_if_different ${_header}.tmp ${_header}.cpp)
 		
 		if(MSVC_IDE)
-			set(use_pch "/Fp${_header}.\$(ConfigurationName).pch")
+			set(pch_file "${_header}.\$(ConfigurationName).pch")
 		else()
-			set(use_pch /Fp${_header}.pch)
+			set(pch_file ${_header}.pch)
 		endif()
-		set_source_files_properties(${_header}.cpp PROPERTIES COMPILE_FLAGS "/Yc\"${_header}\" ${use_pch}")
 		
+		set_source_files_properties(${_header}.cpp PROPERTIES COMPILE_FLAGS "/Yc\"${_header}\" /Fp${pch_file}"
+		                                                      OBJECT_OUTPUTS ${pch_file})
+
 		# Bug in cmake: next line also compile .c files with pchs
-		#set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /FI${_header} /Yu${_header} ${use_pch}")
+		#set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /FI${_header} /Yu${_header} /Fp${pch_file}")
 		foreach(it ${${_sources}})
 			get_filename_component(ext ${it} EXT)
 			if(ext STREQUAL .c)
 			else()
-				set_source_files_properties(${it} PROPERTIES COMPILE_FLAGS "/FI${_header} /Yu${_header} ${use_pch}")
+				set_source_files_properties(${it} PROPERTIES COMPILE_FLAGS "/FI${_header} /Yu${_header} /Fp${pch_file}"
+				                                             OBJECT_DEPENDS ${pch_file})
 			endif()
 		endforeach()
 			


More information about the Kst mailing list