From ad6e48c3727552dfbea28f814da928865704453f Mon Sep 17 00:00:00 2001 From: fredowski Date: Tue, 4 Sep 2018 02:27:32 +0200 Subject: [PATCH] cmake - check directory existence before copy_directory (#10402) Starting with cmake version 3.12 the cmake -E copy_directory command fails if the source directory does not exist. This results in a build failure. This fix creates the source directory before the copy which does not harm if the source directory exists. Closes: #10368 --- ROMFS/CMakeLists.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/ROMFS/CMakeLists.txt b/ROMFS/CMakeLists.txt index 94cd9cf989..e552ffc889 100644 --- a/ROMFS/CMakeLists.txt +++ b/ROMFS/CMakeLists.txt @@ -105,6 +105,7 @@ endif() add_custom_command(OUTPUT romfs_extras.stamp COMMAND ${CMAKE_COMMAND} -E make_directory ${romfs_gen_root_dir}/extras/ + COMMAND ${CMAKE_COMMAND} -E make_directory ${PX4_BINARY_DIR}/romfs_extras/ COMMAND ${CMAKE_COMMAND} -E copy_directory ${PX4_BINARY_DIR}/romfs_extras/ ${romfs_gen_root_dir}/extras/ COMMAND ${CMAKE_COMMAND} -E touch romfs_extras.stamp DEPENDS