Advertisement
voidpointer

Untitled

Oct 30th, 2011
943
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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()
Advertisement
Advertisement
Advertisement
RAW Paste Data Copied
Advertisement