summaryrefslogtreecommitdiff
path: root/src/third_party/wiredtiger/test/ctest_dir_sync.cmake
blob: d485b08de40c541a10b17b4973d56648e8bc26ba (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
cmake_minimum_required(VERSION 3.10.0)

if(NOT SYNC_DIR_SRC)
    message(FATAL_ERROR "Missing a source directory to sync")
endif()

if(NOT SYNC_DIR_DST)
    message(FATAL_ERROR "Missing a destination directory to sync")
endif()

# Get the list of files in the sync directory
file(GLOB files ${SYNC_DIR_SRC}/*)
# Check each file and copy over if it has changed
foreach (sync_file IN LISTS files)
    get_filename_component(sync_file_basename ${sync_file} NAME)
    execute_process(COMMAND ${CMAKE_COMMAND} -E copy_if_different
        ${sync_file}
        ${SYNC_DIR_DST}/${sync_file_basename}
    )
endforeach()