[test-suite] r297766 - CMakeLists: Improve TEST_SUITE_SUBDIRS behavior

Matthias Braun via llvm-commits llvm-commits at lists.llvm.org
Tue Mar 14 11:26:17 PDT 2017


Author: matze
Date: Tue Mar 14 13:26:17 2017
New Revision: 297766

URL: http://llvm.org/viewvc/llvm-project?rev=297766&view=rev
Log:
CMakeLists: Improve TEST_SUITE_SUBDIRS behavior

- Do not mark the option as advanced any longer.
- put the set(... CACHE) on the main execution path so the setting
  will always show up in configuration tools.
- The autodetection produces relative paths now which are easier to
  read.

Modified:
    test-suite/trunk/CMakeLists.txt

Modified: test-suite/trunk/CMakeLists.txt
URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/CMakeLists.txt?rev=297766&r1=297765&r2=297766&view=diff
==============================================================================
--- test-suite/trunk/CMakeLists.txt (original)
+++ test-suite/trunk/CMakeLists.txt Tue Mar 14 13:26:17 2017
@@ -178,20 +178,19 @@ endif()
 # manually specify directories to include test-suites at external locations
 # and to leave out some of the default ones.
 if(NOT TEST_SUITE_SUBDIRS)
-  file(GLOB sub_cmakelists */CMakeLists.txt)
+  file(GLOB sub_cmakelists RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} */CMakeLists.txt)
   set(TEST_SUITE_SUBDIRS "")
   foreach(entry ${sub_cmakelists})
     get_filename_component(subdir ${entry} DIRECTORY)
     # Exclude tools and CTMark from default list
-    if(NOT ${subdir} STREQUAL ${CMAKE_CURRENT_SOURCE_DIR}/tools AND
-       NOT ${subdir} STREQUAL ${CMAKE_CURRENT_SOURCE_DIR}/CTMark)
+    if(NOT ${subdir} STREQUAL tools AND NOT ${subdir} STREQUAL CTMark)
       list(APPEND TEST_SUITE_SUBDIRS ${subdir})
     endif()
   endforeach()
-  set(TEST_SUITE_SUBDIRS "${TEST_SUITE_SUBDIRS}" CACHE STRING
-      "Semicolon separated list of directories with CMakeLists.txt to include")
+  set(TEST_SUITE_SUBDIRS "${TEST_SUITE_SUBDIRS}")
 endif()
-mark_as_advanced(TEST_SUITE_SUBDIRS)
+set(TEST_SUITE_SUBDIRS "${TEST_SUITE_SUBDIRS}" CACHE STRING
+    "Semicolon separated list of directories with CMakeLists.txt to include")
 
 foreach(subdir ${TEST_SUITE_SUBDIRS})
   message(STATUS "Adding directory ${subdir}")




More information about the llvm-commits mailing list