forked from qt-creator/qt-creator
CMake: copy clang and resource files only if necessary
Uses a timestamp file in the build directory to detect when the input changes using DEPENDS from add_custom_command. Total copied files size sum up to more than 260 MB. This was copied at every incremental build, even if nothing changed. This leads to faster build, especially when the copied files are not cached in RAM or when not using a SSD. Change-Id: I3a0b691b961e1d8591068bacf40ae2467c8637cf Reviewed-by: Eike Ziller <eike.ziller@qt.io> Reviewed-by: Cristian Adam <cristian.adam@qt.io>
This commit is contained in:
@@ -37,11 +37,8 @@ install(
|
||||
DESTINATION "${IDE_DATA_PATH}/generic-highlighter/"
|
||||
)
|
||||
|
||||
add_custom_target(copy_generic_highligher_to_builddir ALL VERBATIM)
|
||||
add_custom_command(TARGET copy_generic_highligher_to_builddir POST_BUILD
|
||||
COMMAND "${CMAKE_COMMAND}" -E copy_directory data/syntax
|
||||
"${PROJECT_BINARY_DIR}/${IDE_DATA_PATH}/generic-highlighter/syntax"
|
||||
WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}"
|
||||
COMMENT Copy files into build directory
|
||||
VERBATIM
|
||||
# copy resource directories during build
|
||||
qtc_copy_to_builddir(copy_generic_highligher_to_builddir
|
||||
DIRECTORIES data/syntax
|
||||
DESTINATION "${IDE_DATA_PATH}/generic-highlighter/syntax"
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user