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")