aboutsummaryrefslogtreecommitdiff
path: root/project
diff options
context:
space:
mode:
authorChristian Fetzer <fetzer.ch@gmail.com>2016-04-06 18:28:11 +0200
committerChristian Fetzer <fetzer.ch@gmail.com>2016-04-06 18:28:11 +0200
commit2d8f68ca08ee6e5c10918c0e7bb06eb416e3a0a0 (patch)
treee7fdd5d35aeedabd2bc58d1adadbf50e66abd2eb /project
parent9368c25bf4fe41848001ce0450e022582830a873 (diff)
parentcc735b78888d58cf8bf8608905ae315782e21ed0 (diff)
Merge pull request #9561 from fetzerch/cmake_exportfiles
[cmake] Speed up export-files target
Diffstat (limited to 'project')
-rw-r--r--project/cmake/scripts/common/macros.cmake14
1 files changed, 7 insertions, 7 deletions
diff --git a/project/cmake/scripts/common/macros.cmake b/project/cmake/scripts/common/macros.cmake
index 5566f76189..e878033f7c 100644
--- a/project/cmake/scripts/common/macros.cmake
+++ b/project/cmake/scripts/common/macros.cmake
@@ -62,20 +62,20 @@ endfunction()
# (if NO_INSTALL is not given).
function(copy_file_to_buildtree file relative)
cmake_parse_arguments(arg "NO_INSTALL" "" "" ${ARGN})
- if(NOT WIN32)
- string(REPLACE "\(" "\\(" file ${file})
- string(REPLACE "\)" "\\)" file ${file})
- endif()
string(REPLACE "${relative}/" "" outfile ${file})
+ get_filename_component(outdir ${outfile} DIRECTORY)
if(NOT TARGET export-files)
- add_custom_target(export-files ALL COMMENT "Copying files into build tree")
+ file(REMOVE ${CMAKE_BINARY_DIR}/${CORE_BUILD_DIR}/ExportFiles.cmake)
+ add_custom_target(export-files ALL COMMENT "Copying files into build tree"
+ COMMAND ${CMAKE_COMMAND} -P ${CMAKE_BINARY_DIR}/${CORE_BUILD_DIR}/ExportFiles.cmake)
endif()
if(NOT ${CORE_SOURCE_DIR} MATCHES ${CMAKE_BINARY_DIR})
if(VERBOSE)
- message(STATUS "copy_file_to_buildtree - copying file: ${file} -> ${CMAKE_CURRENT_BINARY_DIR}/${outfile}")
+ message(STATUS "copy_file_to_buildtree - copying file: ${file} -> ${CMAKE_BINARY_DIR}/${outfile}")
endif()
- add_custom_command(TARGET export-files COMMAND ${CMAKE_COMMAND} -E copy_if_different "${file}" "${CMAKE_CURRENT_BINARY_DIR}/${outfile}")
+ file(APPEND ${CMAKE_BINARY_DIR}/${CORE_BUILD_DIR}/ExportFiles.cmake
+ "file(COPY \"${file}\" DESTINATION \"${CMAKE_BINARY_DIR}/${outdir}\")\n")
endif()
if(NOT arg_NO_INSTALL)
list(APPEND install_data ${outfile})