CMake: fix handling of empty strings in ENABLE_TESTSUITES
@@ -113,7 +113,11 @@ if(ENABLE_TESTSUITES)
message(STATUS " source: ${TESTSUITE_SOURCE_BASEDIR}")
foreach(TESTSUITE IN LISTS ENABLE_TESTSUITES)
- list(FIND ALL_TESTSUITES ${TESTSUITE} INDEX)
+ if(NOT TESTSUITE)
+ continue()
+ endif()
+ set(INDEX -1)
+ list(FIND ALL_TESTSUITES "${TESTSUITE}" INDEX)
if(${INDEX} GREATER -1)
if(IS_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/${TESTSUITE}")
add_subdirectory("${TESTSUITE}")
@@ -121,7 +125,7 @@ if(ENABLE_TESTSUITES)
message(FATAL_ERROR "Cannot find source dir for testsuite: ${TESTSUITE}")
endif()
else()
- message(WARNING "Unknown testsuite ${TESTSUITE} requested")
+ message(WARNING "Unknown testsuite '${TESTSUITE}' requested")
endif()
endforeach()
