Want more features on Pastebin? Sign Up, it's FREE!
Guest

Untitled

By: voidpointer on Oct 30th, 2011  |  syntax: CMake  |  size: 0.79 KB  |  views: 363  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. MACRO(ADD_MSVC_PRECOMPILED_HEADER PrecompiledHeader PrecompiledSource SourcesVar)
  2.         IF(MSVC)
  3.                 GET_FILENAME_COMPONENT(PrecompiledBasename ${PrecompiledHeader} NAME_WE)
  4.                 SET(PrecompiledBinary "${CMAKE_CURRENT_BINARY_DIR}/${PrecompiledBasename}.pch")
  5.                 SET(Sources ${${SourcesVar}})
  6.  
  7.                 SET_SOURCE_FILES_PROPERTIES(
  8.                         ${PrecompiledSource}    PROPERTIES
  9.                         COMPILE_FLAGS "/Yc\"${PrecompiledHeader}\" /Fp\"${PrecompiledBinary}\""
  10.                         OBJECT_OUTPUTS "${PrecompiledBinary}"
  11.                 )
  12.                
  13.                 SET_SOURCE_FILES_PROPERTIES(
  14.                         ${Sources} PROPERTIES
  15.                         COMPILE_FLAGS "/Yu\"${PrecompiledBinary}\" /FI\"${PrecompiledBinary}\" /Fp\"${PrecompiledBinary}\""
  16.                         OBJECT_DEPENDS "${PrecompiledBinary}"
  17.                 )
  18.         ENDIF(MSVC)
  19.        
  20.         # Add precompiled header to SourcesVar
  21.         LIST(APPEND ${SourcesVar} ${PrecompiledSource})
  22. ENDMACRO()
clone this paste RAW Paste Data