summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorAlbrecht Schlosser <albrechts.fltk@online.de>2020-07-18 16:07:30 +0200
committerAlbrecht Schlosser <albrechts.fltk@online.de>2020-07-18 16:07:30 +0200
commit956a3bb16086c4b28159316d538986981518fa7f (patch)
treee2e74d7378dc48af68efeed8bef2d5d12f9aaf23 /test
parent3bb3429670f29bbf82424ce234d914201eee2d3f (diff)
CMake: simplify copying of test and demo files
Diffstat (limited to 'test')
-rw-r--r--test/CMakeLists.txt19
1 files 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