diff options
author | sanine <sanine.not@pm.me> | 2022-03-04 10:47:15 -0600 |
---|---|---|
committer | sanine <sanine.not@pm.me> | 2022-03-04 10:47:15 -0600 |
commit | 058f98a63658dc1a2579826ba167fd61bed1e21f (patch) | |
tree | bcba07a1615a14d943f3af3f815a42f3be86b2f3 /src/mesh/assimp-master/cmake-modules/PrecompiledHeader.cmake | |
parent | 2f8028ac9e0812cb6f3cbb08f0f419e4e717bd22 (diff) |
add assimp submodule
Diffstat (limited to 'src/mesh/assimp-master/cmake-modules/PrecompiledHeader.cmake')
-rw-r--r-- | src/mesh/assimp-master/cmake-modules/PrecompiledHeader.cmake | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/src/mesh/assimp-master/cmake-modules/PrecompiledHeader.cmake b/src/mesh/assimp-master/cmake-modules/PrecompiledHeader.cmake new file mode 100644 index 0000000..6af7866 --- /dev/null +++ b/src/mesh/assimp-master/cmake-modules/PrecompiledHeader.cmake @@ -0,0 +1,25 @@ +MACRO(ADD_MSVC_PRECOMPILED_HEADER PrecompiledHeader PrecompiledSource SourcesVar) + IF(MSVC) + GET_FILENAME_COMPONENT(PrecompiledBasename ${PrecompiledHeader} NAME_WE) + SET(PrecompiledBinary "${CMAKE_CFG_INTDIR}/${PrecompiledBasename}.pch") + SET(Sources ${${SourcesVar}}) + + SET_SOURCE_FILES_PROPERTIES(${PrecompiledSource} + PROPERTIES COMPILE_FLAGS "/Yc\"${PrecompiledHeader}\" /Fp\"${PrecompiledBinary}\"" + OBJECT_OUTPUTS "${PrecompiledBinary}") + + # Do not consider .c files + foreach(fname ${Sources}) + GET_FILENAME_COMPONENT(fext ${fname} EXT) + if(fext STREQUAL ".cpp") + SET_SOURCE_FILES_PROPERTIES(${fname} + PROPERTIES COMPILE_FLAGS "/Yu\"${PrecompiledBinary}\" /FI\"${PrecompiledBinary}\" /Fp\"${PrecompiledBinary}\"" + OBJECT_DEPENDS "${PrecompiledBinary}") + endif(fext STREQUAL ".cpp") + endforeach(fname) + + ENDIF(MSVC) + # Add precompiled header to SourcesVar + LIST(APPEND ${SourcesVar} ${PrecompiledSource}) + +ENDMACRO(ADD_MSVC_PRECOMPILED_HEADER) |