/
pch.cmake
27 lines (24 loc) · 927 Bytes
/
pch.cmake
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
# Adds a precompiled header
MACRO(ADD_MSVC_PRECOMPILED_HEADER PrecompiledHeader PrecompiledSource SourcesVar)
if(MSVC)
set_source_files_properties(${PrecompiledSource}
PROPERTIES
COMPILE_FLAGS "/Yc${PrecompiledHeader}"
)
foreach( src_file ${${SourcesVar}} )
set_source_files_properties(
${src_file}
PROPERTIES
COMPILE_FLAGS "/Yu${PrecompiledHeader}"
)
endforeach( src_file ${${SourcesVar}} )
list(APPEND ${SourcesVar} ${PrecompiledHeader} ${PrecompiledSource})
endif(MSVC)
ENDMACRO(ADD_MSVC_PRECOMPILED_HEADER)
function(ADD_MSVC_DISABLED_FILES SourceGroupName SourcesVar ...)
if(WIN32)
set_source_files_properties( ${ARGN} PROPERTIES HEADER_FILE_ONLY TRUE )
source_group(${SourceGroupName} FILES ${ARGN})
set(${SourcesVar} ${${SourcesVar}} ${ARGN} PARENT_SCOPE)
endif(WIN32)
endfunction(ADD_MSVC_DISABLED_FILES)