From e87d9a572bcd190759fb95fe44dd3a0e7227563b Mon Sep 17 00:00:00 2001 From: Bill Somerville Date: Thu, 20 Oct 2016 21:20:26 +0000 Subject: [PATCH] Fix two defects in the sample uploader target Also added new sample files to samples/CMakeLists.txt git-svn-id: svn+ssh://svn.code.sf.net/p/wsjt/wsjt/branches/wsjtx@7210 ab8295b8-cf94-4d9e-aec4-7959e3be5d79 --- samples/CMakeLists.txt | 11 ++++++++++- samples/make_contents.cmake | 10 +++++++++- 2 files changed, 19 insertions(+), 2 deletions(-) diff --git a/samples/CMakeLists.txt b/samples/CMakeLists.txt index 0a653f5b8..6694bc39a 100644 --- a/samples/CMakeLists.txt +++ b/samples/CMakeLists.txt @@ -1,7 +1,16 @@ set (SAMPLE_FILES + ISCAT/ISCAT-A/VK7MO_110401_235515.wav + ISCAT/ISCAT-B/K0AWU_100714_115000.wav + JT4/JT4A/DF2ZC_070926_040700.WAV + JT4/JT4F/OK1KIR_141105_175700.WAV + JT65/JT65B/DL7UAE_040308_002400.wav JT9+JT65/130610_2343.wav JT9/130418_1742.wav - JT65/JT65B/DL7UAE_040308_002400.wav + MSK144/160915_113100.wav + MSK144/160915_113230.wav + QRA64/QRA64A/160707_1554.wav + QRA64/QRA64A/160729_0056.wav + WSPR/150426_0918.wav ) set (contents_file_name contents_${WSJTX_VERSION_MAJOR}.${WSJTX_VERSION_MINOR}.json) diff --git a/samples/make_contents.cmake b/samples/make_contents.cmake index bcbdcdfc9..42f2bead6 100644 --- a/samples/make_contents.cmake +++ b/samples/make_contents.cmake @@ -1,5 +1,11 @@ string (REPLACE " " ";" FILES ${FILES}) # make back into a list +function(JOIN VALUES GLUE OUTPUT) + string (REGEX REPLACE "([^\\]|^);" "\\1${GLUE}" _TMP_STR "${VALUES}") + string (REGEX REPLACE "[\\](.)" "\\1" _TMP_STR "${_TMP_STR}") #fixes escaping + set (${OUTPUT} "${_TMP_STR}" PARENT_SCOPE) +endfunction() + function (indent) foreach (temp RANGE ${level}) file (APPEND ${contents_file} " ") @@ -41,6 +47,7 @@ foreach (file IN LISTS FILES) while ((NOT ${pos} EQUAL 0) AND ${cwd_count} GREATER 0) math (EXPR cwd_count "${cwd_count} - 1") list (REMOVE_AT cwd ${cwd_count}) + string (FIND "${dirs}" "${cwd}" pos) end_entry () endwhile () # back to same root @@ -74,7 +81,8 @@ foreach (file IN LISTS FILES) math (EXPR level "${level} + 2") math (EXPR path_count "${path_count} - 1") endwhile () - file (COPY ${file} DESTINATION ${DEST}/web/samples/${cwd}) + JOIN ("${cwd}" "/" path) + file (COPY "${file}" DESTINATION "${DEST}/web/samples/${path}") if (${first}) file (APPEND ${contents_file} "\n") set (first 0)