[test-suite] r251865 - [CMake] Make the 'clean' target actually work

Chris Bieneman via llvm-commits llvm-commits at lists.llvm.org
Mon Nov 2 16:01:06 PST 2015


Author: cbieneman
Date: Mon Nov  2 18:01:05 2015
New Revision: 251865

URL: http://llvm.org/viewvc/llvm-project?rev=251865&view=rev
Log:
[CMake] Make the 'clean' target actually work

The script-generated CMake was copying the data files with a wildcard which makes it so that CMake doesn't know which files to clean up.

This change makes it so that the files are glob'd and cleaned up appropriately.

Modified:
    test-suite/trunk/MultiSource/Benchmarks/MiBench/consumer-typeset/CMakeLists.txt

Modified: test-suite/trunk/MultiSource/Benchmarks/MiBench/consumer-typeset/CMakeLists.txt
URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/MultiSource/Benchmarks/MiBench/consumer-typeset/CMakeLists.txt?rev=251865&r1=251864&r2=251865&view=diff
==============================================================================
--- test-suite/trunk/MultiSource/Benchmarks/MiBench/consumer-typeset/CMakeLists.txt (original)
+++ test-suite/trunk/MultiSource/Benchmarks/MiBench/consumer-typeset/CMakeLists.txt Mon Nov  2 18:01:05 2015
@@ -10,12 +10,23 @@ set(LDFLAGS -lm)
 set(RUN_OPTIONS -x -I ${CMAKE_CURRENT_SOURCE_DIR}/data/include -D ${CMAKE_CURRENT_SOURCE_DIR}/data/data -F ${CMAKE_CURRENT_SOURCE_DIR}/data/font -C ${CMAKE_CURRENT_SOURCE_DIR}/data/maps -H ${CMAKE_CURRENT_BINARY_DIR}/data/hyph ${CMAKE_CURRENT_SOURCE_DIR}/large.lout)
 set(GeneratedTestInputs copy-hyph-files)
 
-add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/data/hyph
-    COMMAND mkdir -p ${CMAKE_CURRENT_BINARY_DIR}/data/hyph
-    COMMAND cp -r ${CMAKE_CURRENT_SOURCE_DIR}/data/hyph/* ${CMAKE_CURRENT_BINARY_DIR}/data/hyph
-    WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
-    COMMENT "Copying consumer-typeset test inputs")
-add_custom_target(consumer-typeset_input SOURCES ${CMAKE_CURRENT_BINARY_DIR}/data/hyph)
+add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/data/hyph/${file}
+      COMMAND mkdir -p ${CMAKE_CURRENT_BINARY_DIR}/data/hyph
+      COMMENT "Making directory for consumer-typeset test inputs")
+
+file(GLOB test_data "${CMAKE_CURRENT_SOURCE_DIR}/data/hyph/*")
+foreach(file ${test_data})
+  add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/data/hyph/${file}
+      DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/data/hyph
+      COMMAND cp -r ${file} ${CMAKE_CURRENT_BINARY_DIR}/data/hyph/
+      WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
+      COMMENT "Copying consumer-typeset test inputs")
+  list(APPEND test_files ${file})
+endforeach()
+
+add_custom_target(consumer-typeset_input SOURCES ${test_files})
     llvm_multisource()
+
+#set_directory_properties(PROPERTIES ADDITIONAL_MAKE_CLEAN_FILES ${test_files})
 add_dependencies(consumer-typeset consumer-typeset_input)
 llvm_add_subdirectories(${DIRS} ${PARALLEL_DIRS})




More information about the llvm-commits mailing list