summaryrefslogtreecommitdiff
path: root/libs/assimp/cmake-modules/PrecompiledHeader.cmake
diff options
context:
space:
mode:
authorsanine <sanine.not@pm.me>2022-04-16 11:55:09 -0500
committersanine <sanine.not@pm.me>2022-04-16 11:55:09 -0500
commitdb81b925d776103326128bf629cbdda576a223e7 (patch)
tree58bea8155c686733310009f6bed7363f91fbeb9d /libs/assimp/cmake-modules/PrecompiledHeader.cmake
parent55860037b14fb3893ba21cf2654c83d349cc1082 (diff)
move 3rd-party librarys into libs/ and add built-in honeysuckle
Diffstat (limited to 'libs/assimp/cmake-modules/PrecompiledHeader.cmake')
-rw-r--r--libs/assimp/cmake-modules/PrecompiledHeader.cmake25
1 files changed, 25 insertions, 0 deletions
diff --git a/libs/assimp/cmake-modules/PrecompiledHeader.cmake b/libs/assimp/cmake-modules/PrecompiledHeader.cmake
new file mode 100644
index 0000000..6af7866
--- /dev/null
+++ b/libs/assimp/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)