comparison Resources/CMake/VisualStudioPrecompiledHeaders.cmake @ 2391:233d6eeef799

fix pch
author Sebastien Jodogne <s.jodogne@gmail.com>
date Wed, 30 Aug 2017 12:29:48 +0200
parents c9e0e709485b
children c6dab987f43a
comparison
equal deleted inserted replaced
2390:cf0eb76c5e81 2391:233d6eeef799
1 macro(ADD_VISUAL_STUDIO_PRECOMPILED_HEADERS PrecompiledHeaders PrecompiledSource Sources) 1 macro(ADD_VISUAL_STUDIO_PRECOMPILED_HEADERS PrecompiledHeaders PrecompiledSource Sources Target)
2 get_filename_component(PrecompiledBasename ${PrecompiledHeaders} NAME_WE) 2 get_filename_component(PrecompiledBasename ${PrecompiledHeaders} NAME_WE)
3 set(PrecompiledBinary "${PrecompiledBasename}_$(ConfigurationName).pch") 3 set(PrecompiledBinary "${PrecompiledBasename}_$(ConfigurationName).pch")
4 4
5 set_source_files_properties(${PrecompiledSource} 5 set_source_files_properties(${PrecompiledSource}
6 PROPERTIES COMPILE_FLAGS "/Yc\"${PrecompiledHeaders}\" /Fp\"${PrecompiledBinary}\"" 6 PROPERTIES COMPILE_FLAGS "/Yc\"${PrecompiledHeaders}\" /Fp\"${PrecompiledBinary}\""
8 8
9 set_source_files_properties(${${Sources}} 9 set_source_files_properties(${${Sources}}
10 PROPERTIES COMPILE_FLAGS "/Yu\"${PrecompiledHeaders}\" /FI\"${PrecompiledHeaders}\" /Fp\"${PrecompiledBinary}\"" 10 PROPERTIES COMPILE_FLAGS "/Yu\"${PrecompiledHeaders}\" /FI\"${PrecompiledHeaders}\" /Fp\"${PrecompiledBinary}\""
11 OBJECT_DEPENDS "${PrecompiledBinary}") 11 OBJECT_DEPENDS "${PrecompiledBinary}")
12 12
13 list(APPEND ${Sources} ${PrecompiledSource}) 13 set(${Target} ${PrecompiledSource})
14 endmacro() 14 endmacro()