From d10b5e99264ab74195be6af526d5a9cdaf3f1570 Mon Sep 17 00:00:00 2001 From: Odd Kiva <2375733-oddkiva@users.noreply.gitlab.com> Date: Mon, 15 Jul 2024 17:47:56 +0100 Subject: [PATCH] MAINT: fix CMake script. --- cpp/examples/Kalpana/CMakeLists.txt | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/cpp/examples/Kalpana/CMakeLists.txt b/cpp/examples/Kalpana/CMakeLists.txt index bb1f5822e..0afa0e1d1 100644 --- a/cpp/examples/Kalpana/CMakeLists.txt +++ b/cpp/examples/Kalpana/CMakeLists.txt @@ -1,12 +1,21 @@ add_custom_target(copy_data_folder_to_binary_dir) -add_custom_command( - TARGET copy_data_folder_to_binary_dir - COMMAND +if (CMAKE_CONFIGURATION_TYPES) + add_custom_command( + TARGET copy_data_folder_to_binary_dir + COMMAND ${CMAKE_COMMAND} -E copy_directory ${CMAKE_SOURCE_DIR}/data/ - # Check append ("Debug", "Release") subfolder if we are in a multi-config + # Append ("Debug", "Release") subfolder if we are in a multi-config # project. - ${CMAKE_BINARY_DIR}/bin/$<$:$>data -) + ${CMAKE_BINARY_DIR}/bin/$/data + ) +else () + add_custom_command( + TARGET copy_data_folder_to_binary_dir + COMMAND + ${CMAKE_COMMAND} -E copy_directory ${CMAKE_SOURCE_DIR}/data/ + ${CMAKE_BINARY_DIR}/bin/data + ) +endif() set_property(TARGET copy_data_folder_to_binary_dir # PROPERTY FOLDER "Examples")