From 956a3bb16086c4b28159316d538986981518fa7f Mon Sep 17 00:00:00 2001 From: Albrecht Schlosser Date: Sat, 18 Jul 2020 16:07:30 +0200 Subject: CMake: simplify copying of test and demo files --- test/CMakeLists.txt | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index bd8123fcd..55a22f175 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -16,6 +16,7 @@ ####################################################################### set (EXECUTABLE_OUTPUT_PATH ${CMAKE_CURRENT_BINARY_DIR}/../bin/examples) +set (TESTFILE_PATH ${EXECUTABLE_OUTPUT_PATH}) include (../CMake/FLTK-Functions.cmake) include (../CMake/fl_create_example.cmake) @@ -202,18 +203,16 @@ endif (NOT ANDROID) # - demo.menu: help_dialog (help_dialog.html) can't find its images (not copied) # - maybe more ... -# prepare for a "better" test file installation path -set (TESTFILE_PATH ${EXECUTABLE_OUTPUT_PATH}) -# fl_debug_var (TESTFILE_PATH) +# create data directory for test and demo programs +file (MAKE_DIRECTORY ${TESTFILE_PATH}) -# use a target filename to make sure the target directory gets created -configure_file (demo.menu ${TESTFILE_PATH}/demo.menu COPYONLY) +# copy the test files -# use target directory only (no filename) to avoid redundancy -configure_file (rgb.txt ${TESTFILE_PATH} COPYONLY) -configure_file (help_dialog.html ${TESTFILE_PATH} COPYONLY) -configure_file (browser.cxx ${TESTFILE_PATH} COPYONLY) -configure_file (editor.cxx ${TESTFILE_PATH} COPYONLY) +file (COPY + demo.menu rgb.txt browser.cxx editor.cxx valuators.fl + help_dialog.html + DESTINATION ${TESTFILE_PATH} +) # Apple macOS creates bundles instead of executables and needs a little bit # more help for demos to run correctly -- cgit v1.2.3