This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ADD_CUSTOM_COMMAND(TARGET PROJECT_NAME POST_BUILD | |
COMMAND ${CMAKE_COMMAND} -E copy | |
"${DLL_FILE}" $<TARGET_FILE_DIR:PROJECT_NAME>) | |
# Note that this must be run after a target has been created, i.e., after running add_executable |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#Based on an answer on StackOverflow https://stackoverflow.com/a/1380048 | |
MACRO(ADD_MSVC_PRECOMPILED_HEADER PrecompiledHeader PrecompiledSource SourcesVar) | |
IF(MSVC) | |
GET_FILENAME_COMPONENT(PrecompiledBasename ${PrecompiledHeader} NAME_WE) | |
SET(PrecompiledBinary "${CMAKE_CURRENT_BINARY_DIR}/${PrecompiledBasename}.pch") | |
SET(Sources ${${SourcesVar}}) | |
SET_SOURCE_FILES_PROPERTIES(${PrecompiledSource} | |
PROPERTIES COMPILE_FLAGS "/Yc\"${PrecompiledHeader}\" /Fp\"${PrecompiledBinary}\"" |