cmake string(TOLOWER) examples

86Box/86Box CMakeLists.txt :200

string(TOLOWER "${BUILD_TYPE}" BUILD_TYPE_LOWER)

assimp/assimp contrib/draco/cmake/draco_cpu_detection.cmake :23

string(TOLOWER "${CMAKE_SYSTEM_PROCESSOR}" cpu_lowercase)

OpenChemistry/avogadroapp cmake/DeployQt5.cmake :228

string(TOLOWER "${plugin_parent_dir_name}" plugin_parent_dir_name)

OpenChemistry/avogadrolibs avogadro/CMakeLists.txt :18

string(TOLOWER ${name} _lower_name)

OpenChemistry/avogadrolibs tests/qtgui/CMakeLists.txt :51

string(TOLOWER ${TestName} testname)

OpenChemistry/avogadrolibs tests/qtopengl/CMakeLists.txt :54

string(TOLOWER ${test} testname)

google/benchmark CMakeLists.txt :62

string(TOLOWER ${CMAKE_BUILD_TYPE} CMAKE_BUILD_TYPE_LOWER)

catchorg/Catch2 CMake/Findcodecov.cmake :137

string(TOLOWER "${FILE_EXT}" FILE_EXT)

catchorg/Catch2 extras/ParseAndAddCatchTests.cmake :136

    string(REGEX MATCH "(CATCH_)?(TEMPLATE_)?(TEST_CASE_METHOD|SCENARIO|TEST_CASE)[ \t]*\\([^,^\"]*" TestTypeAndFixture "${TestName}")
    string(REGEX MATCH "(CATCH_)?(TEMPLATE_)?(TEST_CASE_METHOD|SCENARIO|TEST_CASE)" TestType "${TestTypeAndFixture}")
    string(REGEX REPLACE "${TestType}\\([ \t]*" "" TestFixture "${TestTypeAndFixture}")

    # Get string parts of test definition
    string(REGEX MATCHALL "\"+([^\\^\"]|\\\\\")+\"+" TestStrings "${TestName}")

    # Strip wrapping quotation marks
    string(REGEX REPLACE "^\"(.*)\"$" "\\1" TestStrings "${TestStrings}")
    string(REPLACE "\";\"" ";" TestStrings "${TestStrings}")

    # Validate that a test name and tags have been provided
    list(LENGTH TestStrings TestStringsLength)
    if(TestStringsLength GREATER 2 OR TestStringsLength LESS 1)
      message(FATAL_ERROR "You must provide a valid test name and tags for all tests in ${SourceFile}")
    endif()

    # Assign name and tags
    list(GET TestStrings 0 Name)
    if("${TestType}" STREQUAL "SCENARIO")
      set(Name "Scenario: ${Name}")
    endif()
    if(PARSE_CATCH_TESTS_ADD_FIXTURE_IN_TEST_NAME AND "${TestType}" MATCHES "(CATCH_)?TEST_CASE_METHOD" AND TestFixture)
      set(CTestName "${TestFixture}:${Name}")
    else()
      set(CTestName "${Name}")
    endif()
    if(PARSE_CATCH_TESTS_ADD_TARGET_IN_TEST_NAME)
      set(CTestName "${TestTarget}:${CTestName}")
    endif()
    # add target to labels to enable running all tests added from this target
    set(Labels ${TestTarget})
    if(TestStringsLength EQUAL 2)
      list(GET TestStrings 1 Tags)
      string(TOLOWER "${Tags}" Tags)
      # remove target from labels if the test is hidden
      if("${Tags}" MATCHES ".*\\[!?(hide|\\.)\\].*")
        list(REMOVE_ITEM Labels ${TestTarget})
      endif()
      string(REPLACE "]" ";" Tags "${Tags}")
      string(REPLACE "[" "" Tags "${Tags}")
    else()
      # unset tags variable from previous loop
      unset(Tags)
    endif()

    list(APPEND Labels ${Tags})

    set(HiddenTagFound OFF)
    foreach(label ${Labels})
      string(REGEX MATCH "^!hide|^\\." result ${label})
      if(result)
        set(HiddenTagFound ON)
        break()
      endif()
    endforeach(label)
    if(PARSE_CATCH_TESTS_NO_HIDDEN_TESTS AND ${HiddenTagFound} AND ${CMAKE_VERSION} VERSION_LESS "3.9")
      ParseAndAddCatchTests_PrintDebugMessage("Skipping test \"${CTestName}\" as it has [!hide], [.] or [.foo] label")
    else()
      ParseAndAddCatchTests_PrintDebugMessage("Adding test \"${CTestName}\"")
      if(Labels)
        ParseAndAddCatchTests_PrintDebugMessage("Setting labels to ${Labels}")
      endif()

      # Escape commas in the test spec
      string(REPLACE "," "\\," Name ${Name})

      # Work around CMake 3.18.0 change in `add_test()`, before the escaped quotes were necessary,
      # only with CMake 3.18.0 the escaped double quotes confuse the call. This change is reverted in 3.18.1
      # And properly introduced in 3.19 with the CMP0110 policy
      if(_cmp0110_value STREQUAL "NEW" OR ${CMAKE_VERSION} VERSION_EQUAL "3.18")
        ParseAndAddCatchTests_PrintDebugMessage("CMP0110 set to NEW, no need for add_test(\"\") workaround")
      else()
        ParseAndAddCatchTests_PrintDebugMessage("CMP0110 set to OLD adding \"\" for add_test() workaround")
        set(CTestName "\"${CTestName}\"")
      endif()

      # Handle template test cases
      if("${TestTypeAndFixture}" MATCHES ".*TEMPLATE_.*")
        set(Name "${Name} - *")
      endif()

      # Add the test and set its properties
      add_test(NAME "${CTestName}" COMMAND ${OptionalCatchTestLauncher} $<TARGET_FILE:${TestTarget}> ${Name} ${AdditionalCatchParameters})
      # Old CMake versions do not document VERSION_GREATER_EQUAL, so we use VERSION_GREATER with 3.8 instead
      if(PARSE_CATCH_TESTS_NO_HIDDEN_TESTS AND ${HiddenTagFound} AND ${CMAKE_VERSION} VERSION_GREATER "3.8")
        ParseAndAddCatchTests_PrintDebugMessage("Setting DISABLED test property")
        set_tests_properties("${CTestName}" PROPERTIES DISABLED ON)
      else()
        set_tests_properties("${CTestName}" PROPERTIES FAIL_REGULAR_EXPRESSION "No tests ran"
                                                LABELS "${Labels}")
      endif()
      set_property(
        TARGET ${TestTarget}
        APPEND
        PROPERTY ParseAndAddCatchTests_TESTS "${CTestName}")
      set_property(
        SOURCE ${SourceFile}
        APPEND
        PROPERTY ParseAndAddCatchTests_TESTS "${CTestName}")
    endif()
  endforeach()
endfunction()

# entry point
function(ParseAndAddCatchTests TestTarget)
  message(DEPRECATION "ParseAndAddCatchTest: function deprecated because of possibility of missed test cases. Consider using 'catch_discover_tests' from 'Catch.cmake'")
  ParseAndAddCatchTests_PrintDebugMessage("Started parsing ${TestTarget}")
  get_target_property(SourceFiles ${TestTarget} SOURCES)
  ParseAndAddCatchTests_PrintDebugMessage("Found the following sources: ${SourceFiles}")
  foreach(SourceFile ${SourceFiles})
    ParseAndAddCatchTests_ParseFile(${SourceFile} ${TestTarget})
  endforeach()
  ParseAndAddCatchTests_PrintDebugMessage("Finished parsing ${TestTarget}")
endfunction()

catchorg/Catch2 extras/ParseAndAddCatchTests.cmake :138

    string(REGEX REPLACE "${TestType}\\([ \t]*" "" TestFixture "${TestTypeAndFixture}")

    # Get string parts of test definition
    string(REGEX MATCHALL "\"+([^\\^\"]|\\\\\")+\"+" TestStrings "${TestName}")

    # Strip wrapping quotation marks
    string(REGEX REPLACE "^\"(.*)\"$" "\\1" TestStrings "${TestStrings}")
    string(REPLACE "\";\"" ";" TestStrings "${TestStrings}")

    # Validate that a test name and tags have been provided
    list(LENGTH TestStrings TestStringsLength)
    if(TestStringsLength GREATER 2 OR TestStringsLength LESS 1)
      message(FATAL_ERROR "You must provide a valid test name and tags for all tests in ${SourceFile}")
    endif()

    # Assign name and tags
    list(GET TestStrings 0 Name)
    if("${TestType}" STREQUAL "SCENARIO")
      set(Name "Scenario: ${Name}")
    endif()
    if(PARSE_CATCH_TESTS_ADD_FIXTURE_IN_TEST_NAME AND "${TestType}" MATCHES "(CATCH_)?TEST_CASE_METHOD" AND TestFixture)
      set(CTestName "${TestFixture}:${Name}")
    else()
      set(CTestName "${Name}")
    endif()
    if(PARSE_CATCH_TESTS_ADD_TARGET_IN_TEST_NAME)
      set(CTestName "${TestTarget}:${CTestName}")
    endif()
    # add target to labels to enable running all tests added from this target
    set(Labels ${TestTarget})
    if(TestStringsLength EQUAL 2)
      list(GET TestStrings 1 Tags)
      string(TOLOWER "${Tags}" Tags)
      # remove target from labels if the test is hidden
      if("${Tags}" MATCHES ".*\\[!?(hide|\\.)\\].*")
        list(REMOVE_ITEM Labels ${TestTarget})
      endif()
      string(REPLACE "]" ";" Tags "${Tags}")
      string(REPLACE "[" "" Tags "${Tags}")
    else()
      # unset tags variable from previous loop
      unset(Tags)
    endif()

    list(APPEND Labels ${Tags})

    set(HiddenTagFound OFF)
    foreach(label ${Labels})
      string(REGEX MATCH "^!hide|^\\." result ${label})
      if(result)
        set(HiddenTagFound ON)
        break()
      endif()
    endforeach(label)
    if(PARSE_CATCH_TESTS_NO_HIDDEN_TESTS AND ${HiddenTagFound} AND ${CMAKE_VERSION} VERSION_LESS "3.9")
      ParseAndAddCatchTests_PrintDebugMessage("Skipping test \"${CTestName}\" as it has [!hide], [.] or [.foo] label")
    else()
      ParseAndAddCatchTests_PrintDebugMessage("Adding test \"${CTestName}\"")
      if(Labels)
        ParseAndAddCatchTests_PrintDebugMessage("Setting labels to ${Labels}")
      endif()

      # Escape commas in the test spec
      string(REPLACE "," "\\," Name ${Name})

      # Work around CMake 3.18.0 change in `add_test()`, before the escaped quotes were necessary,
      # only with CMake 3.18.0 the escaped double quotes confuse the call. This change is reverted in 3.18.1
      # And properly introduced in 3.19 with the CMP0110 policy
      if(_cmp0110_value STREQUAL "NEW" OR ${CMAKE_VERSION} VERSION_EQUAL "3.18")
        ParseAndAddCatchTests_PrintDebugMessage("CMP0110 set to NEW, no need for add_test(\"\") workaround")
      else()
        ParseAndAddCatchTests_PrintDebugMessage("CMP0110 set to OLD adding \"\" for add_test() workaround")
        set(CTestName "\"${CTestName}\"")
      endif()

      # Handle template test cases
      if("${TestTypeAndFixture}" MATCHES ".*TEMPLATE_.*")
        set(Name "${Name} - *")
      endif()

      # Add the test and set its properties
      add_test(NAME "${CTestName}" COMMAND ${OptionalCatchTestLauncher} $<TARGET_FILE:${TestTarget}> ${Name} ${AdditionalCatchParameters})
      # Old CMake versions do not document VERSION_GREATER_EQUAL, so we use VERSION_GREATER with 3.8 instead
      if(PARSE_CATCH_TESTS_NO_HIDDEN_TESTS AND ${HiddenTagFound} AND ${CMAKE_VERSION} VERSION_GREATER "3.8")
        ParseAndAddCatchTests_PrintDebugMessage("Setting DISABLED test property")
        set_tests_properties("${CTestName}" PROPERTIES DISABLED ON)
      else()
        set_tests_properties("${CTestName}" PROPERTIES FAIL_REGULAR_EXPRESSION "No tests ran"
                                                LABELS "${Labels}")
      endif()
      set_property(
        TARGET ${TestTarget}
        APPEND
        PROPERTY ParseAndAddCatchTests_TESTS "${CTestName}")
      set_property(
        SOURCE ${SourceFile}
        APPEND
        PROPERTY ParseAndAddCatchTests_TESTS "${CTestName}")
    endif()
  endforeach()
endfunction()

# entry point
function(ParseAndAddCatchTests TestTarget)
  message(DEPRECATION "ParseAndAddCatchTest: function deprecated because of possibility of missed test cases. Consider using 'catch_discover_tests' from 'Catch.cmake'")
  ParseAndAddCatchTests_PrintDebugMessage("Started parsing ${TestTarget}")
  get_target_property(SourceFiles ${TestTarget} SOURCES)
  ParseAndAddCatchTests_PrintDebugMessage("Found the following sources: ${SourceFiles}")
  foreach(SourceFile ${SourceFiles})
    ParseAndAddCatchTests_ParseFile(${SourceFile} ${TestTarget})
  endforeach()
  ParseAndAddCatchTests_PrintDebugMessage("Finished parsing ${TestTarget}")
endfunction()

CGAL/cgal Lab/demo/Lab/CGALlab_macros.cmake :63

STRING(TOLOWER "${plugin_implementation_base_name}.json" base_name)

cp2k/cp2k cmake/modules/FindMKL.cmake :320

string(
  TOLOWER "${_mpi_impl}_${_iface}_${_bits}_${_threading}_${_libtype}"
          _tgt_config)

dftbplus/dftbplus cmake/DftbPlusUtils.cmake :547

string(TOLOWER "${package}" _package_lower)

dftbplus/dftbplus cmake/DftbPlusUtils.cmake :552

string(TOLOWER "${_config_method}" _config_lower)

microsoft/DirectXMath SHMath/CMakeLists.txt :108

string(TOLOWER ${PROJECT_NAME} PACKAGE_NAME)

microsoft/DirectXMath XDSP/CMakeLists.txt :45

string(TOLOWER ${PROJECT_NAME} PACKAGE_NAME)

microsoft/DirectXTK CMakeLists.txt :350

string(TOLOWER ${PROJECT_NAME} PACKAGE_NAME)

doxygen/doxygen cmake/Sanitizers/sanitize-helpers.cmake :35

string(TOLOWER "${FILE_EXT}" FILE_EXT)

duckdb/duckdb CMakeLists.txt :1049

string(TOLOWER ${NAME} EXTENSION_NAME_LOWERCASE)

duckdb/duckdb CMakeLists.txt :1196

string(TOLOWER ${NAME} EXTENSION_NAME_LOWERCASE)

JPeterMugaas/efxc2 build/PVS-Studio.cmake :157

string(TOLOWER "${SOURCE}" SOURCE_LOWER)

dyne/frei0r src/mixer2/sleid0r/CMakeLists.txt :21

string(TOLOWER ${MIXER} LOWERCASE_MIXER)

KDAB/GammaRay cmake/ECM/find-modules/FindWayland.cmake :70

string(TOLOWER "${_comp}" _lc_comp)

OSGeo/gdal cmake/helpers/CheckCompilerMachineOption.cmake :67

string(TOLOWER ${feature} _flag)

OSGeo/gdal cmake/modules/thirdparty/FindDotnet.cmake :305

STRING(TOLOWER ${pkg} pkg_lowercase)

malaterre/GDCM CMakeLists.txt :219

string(TOLOWER ${PROJECT_NAME} projectname)

malaterre/GDCM CMake/UseDebian.cmake :57

string(TOLOWER
  ${CPACK_PACKAGE_NAME}
  DEBIAN_PACKAGE_NAME
  )

malaterre/GDCM Utilities/gdcmcharls/CMakeLists.txt :10

string(TOLOWER ${CHARLS_NAMESPACE} CHARLS_LIBRARY_NAME)

malaterre/GDCM Utilities/gdcmmd5/CMakeLists.txt :10

string(TOLOWER ${MD5_NAMESPACE} MD5_LIBRARY_NAME)

malaterre/GDCM Utilities/gdcmzlib/CMakeLists.txt :10

string(TOLOWER ${ZLIB_NAMESPACE} ZLIB_LIBRARY_NAME)

malaterre/GDCM Utilities/getopt/CMakeLists.txt :10

string(TOLOWER ${GETOPT_NAMESPACE} GETOPT_LIBRARY_NAME)

malaterre/GDCM Utilities/socketxx/CMakeLists.txt :11

string(TOLOWER ${SOCKETXX_NAMESPACE} SOCKETXX_LIBRARY_NAME)

gflags/gflags CMakeLists.txt :449

string (TOLOWER "${TYPE}" type)

gflags/gflags CMakeLists.txt :698

string (TOLOWER "${CMAKE_SYSTEM_NAME}" CPACK_SYSTEM_NAME)

cginternals/glbinding deploy/packages/pack-glbinding.cmake :146

string(TOLOWER ${META_PROJECT_NAME} package_name)

silnrsi/graphite CMakeLists.txt :52

string(TOLOWER ${GRAPHITE2_VM_TYPE} GRAPHITE2_VM_TYPE)

HDFGroup/hdf4 HDF4Examples/config/cmake/HDFExampleMacros.cmake :4

string (TOLOWER ${varname} EXAMPLE_VARNAME)

HDFGroup/hdf5 CMakeVOL.cmake :49

      string (REGEX MATCH "^[ \t]*set_tests_properties\\([ \t]*[\r\n]?" match_string "${line}")
      if (NOT "${match_string}" STREQUAL "")
        string (REGEX REPLACE "^[ \t]*set_tests_properties\\([ \t]*[\r\n]?" "" stripped_line "${line}")
      endif ()
      string (REGEX MATCH "^[ \t]*.\\{test\\}[ \t]*[\r\n]?" match_string "${line}")
      if (NOT "${match_string}" STREQUAL "")
        string (REGEX REPLACE "^[ \t]*.\\{[A-Za-z]*\\}[ \t]*[\r\n]?" "" stripped_line "${line}")
      endif ()
      string (REGEX MATCH "^[ \t]*PROPERTIES[ \t]*[\r\n]?" match_string "${line}")
      if (NOT "${match_string}" STREQUAL "")
        string (REGEX REPLACE "^[ \t]*PROPERTIES[ \t]*[\r\n]?" "" stripped_line "${line}")
      endif ()
      string (REGEX MATCH "^[ \t]*ENVIRONMENT[ \t]*.*[\r\n]?" match_string "${line}")
      if (NOT "${match_string}" STREQUAL "")
        string (REGEX REPLACE "^[ \t]*ENVIRONMENT[ \t]*.*[\r\n]?" "" stripped_line "${line}")
      endif ()
      file (APPEND "${source_dir}/tests/CMakeLists.txt" "${stripped_line}\n")
    endforeach ()
  endif ()
endfunction ()

set (HDF5_VOL_ALLOW_EXTERNAL "NO" CACHE STRING "Allow building of external HDF5 VOL connectors with FetchContent")
set_property (CACHE HDF5_VOL_ALLOW_EXTERNAL PROPERTY STRINGS NO GIT LOCAL_DIR)
mark_as_advanced (HDF5_VOL_ALLOW_EXTERNAL)
if (HDF5_VOL_ALLOW_EXTERNAL MATCHES "GIT" OR HDF5_VOL_ALLOW_EXTERNAL MATCHES "LOCAL_DIR")
  # For compatibility, set some variables that projects would
  # typically look for after calling find_package(HDF5)
  set (HDF5_FOUND 1)
  set (HDF5_LIBRARIES "${HDF5_LIBSH_TARGET};${LINK_LIBS};${LINK_COMP_LIBS};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:MPI::MPI_C>")
  set (HDF5_INCLUDE_DIRS "${HDF5_SRC_INCLUDE_DIRS};${HDF5_SRC_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>")
  set (HDF5_IS_PARALLEL ${H5_HAVE_PARALLEL})
  set (HDF5_VERSION ${HDF5_PACKAGE_VERSION})

  set (HDF5_C_LIBRARIES "${HDF5_LIBRARIES}")

  if (HDF5_BUILD_HL_LIB)
    set (HDF5_C_HL_LIBRARIES "${HDF5_HL_LIBSH_TARGET}")
  endif()

  set (HDF5_MAX_EXTERNAL_VOLS 10)
  set (HDF5_EXTERNAL_VOL_TARGETS "")

  foreach (vol_idx RANGE 1 ${HDF5_MAX_EXTERNAL_VOLS})
    # Generate fixed-width index number prepended with 0s
    # so VOL sources come in order from 1 - HDF5_MAX_EXTERNAL_VOLS
    set (vol_idx_num_digits 2) # Based on HDF5_MAX_EXTERNAL_VOLS
    set (vol_idx_fixed "${vol_idx}")
    string (LENGTH "${vol_idx_fixed}" vol_idx_len)
    while (vol_idx_len LESS vol_idx_num_digits)
      string (PREPEND vol_idx_fixed "0")
      math (EXPR vol_idx_len "${vol_idx_len}+1")
    endwhile ()

    if (HDF5_VOL_ALLOW_EXTERNAL MATCHES "GIT")
      set (HDF5_VOL_URL${vol_idx_fixed} "" CACHE STRING "Git repository URL of an external HDF5 VOL connector to build")
      mark_as_advanced (HDF5_VOL_URL${vol_idx_fixed})
      set (HDF5_VOL_SOURCE "${HDF5_VOL_URL${vol_idx_fixed}}")
    elseif(HDF5_VOL_ALLOW_EXTERNAL MATCHES "LOCAL_DIR")
      set (HDF5_VOL_PATH${vol_idx_fixed} "" CACHE STRING "Path to the source directory of an external HDF5 VOL connector to build")
      mark_as_advanced (HDF5_VOL_PATH${vol_idx_fixed})
      set (HDF5_VOL_SOURCE "${HDF5_VOL_PATH${vol_idx_fixed}}")
    endif()

    if (NOT "${HDF5_VOL_SOURCE}" STREQUAL "")
      # Deal with trailing slash in path for LOCAL_DIR case
      if (HDF5_VOL_ALLOW_EXTERNAL MATCHES "LOCAL_DIR")
        # Erase trailing slash
        string (REGEX REPLACE "/$" "" HDF5_VOL_SOURCE ${HDF5_VOL_SOURCE})
      endif()

      # Extract the name of the VOL connector
      string (FIND "${HDF5_VOL_SOURCE}" "/" hdf5_vol_name_pos REVERSE)
      if (hdf5_vol_name_pos EQUAL -1)
        if (HDF5_VOL_ALLOW_EXTERNAL MATCHES "GIT")
          message (SEND_ERROR "Invalid URL '${HDF5_VOL_SOURCE}' specified for HDF5_VOL_URL${vol_idx_fixed}")
        elseif (HDF5_VOL_ALLOW_EXTERNAL MATCHES "LOCAL_DIR")
          message (SEND_ERROR "Invalid source path '${HDF5_VOL_SOURCE}' specified for HDF5_VOL_PATH${vol_idx_fixed}")
        endif()
      endif ()

      math (EXPR hdf5_vol_name_pos "${hdf5_vol_name_pos}+1")

      string (SUBSTRING "${HDF5_VOL_SOURCE}" ${hdf5_vol_name_pos} -1 hdf5_vol_name)
      string (REPLACE ".git" "" hdf5_vol_name "${hdf5_vol_name}")
      string (STRIP "${hdf5_vol_name}" hdf5_vol_name)
      string (TOUPPER "${hdf5_vol_name}" hdf5_vol_name_upper)
      string (TOLOWER "${hdf5_vol_name}" hdf5_vol_name_lower)

      message (VERBOSE "Building VOL connector '${hdf5_vol_name}' with FetchContent from source ${HDF5_VOL_SOURCE}")

      # Set some cache variables that can be set by users when building
      if (HDF5_VOL_ALLOW_EXTERNAL MATCHES "GIT")
        set ("HDF5_VOL_${hdf5_vol_name_upper}_BRANCH" "main" CACHE STRING "Git branch (or tag) to use when building VOL connector '${hdf5_vol_name}'")
        mark_as_advanced ("HDF5_VOL_${hdf5_vol_name_upper}_BRANCH")
      endif()

      set ("HDF5_VOL_${hdf5_vol_name_upper}_CMAKE_PACKAGE_NAME"
        "${hdf5_vol_name_lower}"
        CACHE
        STRING
        "CMake package name used by find_package(...) calls for VOL connector '${hdf5_vol_name}'"
      )

      set ("HDF5_VOL_${hdf5_vol_name_upper}_NAME" "" CACHE STRING "Name of VOL connector to set for the HDF5_VOL_CONNECTOR environment variable")
      option ("HDF5_VOL_${hdf5_vol_name_upper}_TEST_PARALLEL" "Whether to test VOL connector '${hdf5_vol_name}' against the parallel API tests" OFF)

      mark_as_advanced ("HDF5_VOL_${hdf5_vol_name_upper}_NAME")
      mark_as_advanced ("HDF5_VOL_${hdf5_vol_name_upper}_TEST_PARALLEL")

      if (HDF5_TEST_API)
        if ("${HDF5_VOL_${hdf5_vol_name_upper}_NAME}" STREQUAL "")
          message (SEND_ERROR "HDF5_VOL_${hdf5_vol_name_upper}_NAME must be set to a valid connector name to use VOL connector '${hdf5_vol_name}' for testing")
        endif ()
      endif ()

      if ((HDF5_VOL_ALLOW_EXTERNAL MATCHES "GIT") AND ("${HDF5_VOL_${hdf5_vol_name_upper}_BRANCH}" STREQUAL ""))
        message (SEND_ERROR "HDF5_VOL_${hdf5_vol_name_upper}_BRANCH must be set to a valid git branch name (or git tag) to build VOL connector '${hdf5_vol_name}'")
      endif ()

      if ((HDF5_VOL_ALLOW_EXTERNAL MATCHES "LOCAL_DIR")
        AND NOT (EXISTS ${HDF5_VOL_SOURCE} AND IS_DIRECTORY ${HDF5_VOL_SOURCE}))
          message (FATAL_ERROR "HDF5_VOL_PATH${vol_idx_fixed} must be an absolute path to a valid directory")
      endif ()

      # Set internal convenience variables for FetchContent dependency name
      set (hdf5_vol_depname "${HDF5_VOL_${hdf5_vol_name_upper}_CMAKE_PACKAGE_NAME}")
      string (TOLOWER "${hdf5_vol_depname}" hdf5_vol_depname_lower)

      if (${CMAKE_VERSION} VERSION_GREATER_EQUAL "3.24")
        set("OVERRIDE_FIND_PACKAGE_OPT" "OVERRIDE_FIND_PACKAGE")
      endif()

      if (HDF5_VOL_ALLOW_EXTERNAL MATCHES "GIT")
        FetchContent_Declare (${hdf5_vol_depname}
            GIT_REPOSITORY "${HDF5_VOL_SOURCE}"
            GIT_TAG "${HDF5_VOL_${hdf5_vol_name_upper}_BRANCH}"
            "${OVERRIDE_FIND_PACKAGE_OPT}"
        )
      elseif(HDF5_VOL_ALLOW_EXTERNAL MATCHES "LOCAL_DIR")
        FetchContent_Declare (${hdf5_vol_depname}
          SOURCE_DIR "${HDF5_VOL_SOURCE}"
        )
      endif()

      FetchContent_GetProperties(${hdf5_vol_depname})
      if (NOT ${hdf5_vol_depname}_POPULATED)
        FetchContent_Populate(${hdf5_vol_depname})

        # Now that content has been populated, set other internal
        # convenience variables for FetchContent dependency
        set (hdf5_vol_depname_source_dir "${${hdf5_vol_depname_lower}_SOURCE_DIR}")
        set (hdf5_vol_depname_binary_dir "${${hdf5_vol_depname_lower}_BINARY_DIR}")

        if (NOT EXISTS "${hdf5_vol_depname_source_dir}/CMakeLists.txt")
          if (HDF5_VOL_ALLOW_EXTERNAL MATCHES "GIT")
            message (SEND_ERROR "The git repository branch '${HDF5_VOL_${hdf5_vol_name_upper}_BRANCH}' for VOL connector '${hdf5_vol_name}' does not appear to contain a CMakeLists.txt file")
          elseif (HDF5_VOL_ALLOW_EXTERNAL MATCHES "LOCAL_DIR")
            message(SEND_ERROR "The local directory '${HDF5_VOL_SOURCE}' for VOL connector '${hdf5_vol_name}' does not appear to contain a CMakeLists.txt file")
          endif()
        endif ()

        # If there are any calls to find_package(HDF5) in the connector's
        # CMakeLists.txt files, remove those since any found HDF5 targets
        # will conflict with targets being generated by this build of HDF5
        if (EXISTS "${hdf5_vol_depname_source_dir}/CMakeLists.txt")
          file (READ "${hdf5_vol_depname_source_dir}/CMakeLists.txt" vol_cmake_contents)
          string (REGEX REPLACE "[ \t]*find_package[ \t]*\\([ \t]*HDF5[^\r\n\\)]*\\)[ \t]*[\r\n]+" "" vol_cmake_contents "${vol_cmake_contents}")
          file (WRITE "${hdf5_vol_depname_source_dir}/CMakeLists.txt" "${vol_cmake_contents}")
        endif ()
        if (EXISTS "${hdf5_vol_depname_source_dir}/src/CMakeLists.txt")
          file (READ "${hdf5_vol_depname_source_dir}/src/CMakeLists.txt" vol_cmake_contents)
          string (REGEX REPLACE "[ \t]*find_package[ \t]*\\([ \t]*HDF5[^\r\n\\)]*\\)[ \t]*[\r\n]+" "" vol_cmake_contents "${vol_cmake_contents}")

HDFGroup/hdf5 CMakeVOL.cmake :51

        string (REGEX REPLACE "^[ \t]*set_tests_properties\\([ \t]*[\r\n]?" "" stripped_line "${line}")
      endif ()
      string (REGEX MATCH "^[ \t]*.\\{test\\}[ \t]*[\r\n]?" match_string "${line}")
      if (NOT "${match_string}" STREQUAL "")
        string (REGEX REPLACE "^[ \t]*.\\{[A-Za-z]*\\}[ \t]*[\r\n]?" "" stripped_line "${line}")
      endif ()
      string (REGEX MATCH "^[ \t]*PROPERTIES[ \t]*[\r\n]?" match_string "${line}")
      if (NOT "${match_string}" STREQUAL "")
        string (REGEX REPLACE "^[ \t]*PROPERTIES[ \t]*[\r\n]?" "" stripped_line "${line}")
      endif ()
      string (REGEX MATCH "^[ \t]*ENVIRONMENT[ \t]*.*[\r\n]?" match_string "${line}")
      if (NOT "${match_string}" STREQUAL "")
        string (REGEX REPLACE "^[ \t]*ENVIRONMENT[ \t]*.*[\r\n]?" "" stripped_line "${line}")
      endif ()
      file (APPEND "${source_dir}/tests/CMakeLists.txt" "${stripped_line}\n")
    endforeach ()
  endif ()
endfunction ()

set (HDF5_VOL_ALLOW_EXTERNAL "NO" CACHE STRING "Allow building of external HDF5 VOL connectors with FetchContent")
set_property (CACHE HDF5_VOL_ALLOW_EXTERNAL PROPERTY STRINGS NO GIT LOCAL_DIR)
mark_as_advanced (HDF5_VOL_ALLOW_EXTERNAL)
if (HDF5_VOL_ALLOW_EXTERNAL MATCHES "GIT" OR HDF5_VOL_ALLOW_EXTERNAL MATCHES "LOCAL_DIR")
  # For compatibility, set some variables that projects would
  # typically look for after calling find_package(HDF5)
  set (HDF5_FOUND 1)
  set (HDF5_LIBRARIES "${HDF5_LIBSH_TARGET};${LINK_LIBS};${LINK_COMP_LIBS};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:MPI::MPI_C>")
  set (HDF5_INCLUDE_DIRS "${HDF5_SRC_INCLUDE_DIRS};${HDF5_SRC_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>")
  set (HDF5_IS_PARALLEL ${H5_HAVE_PARALLEL})
  set (HDF5_VERSION ${HDF5_PACKAGE_VERSION})

  set (HDF5_C_LIBRARIES "${HDF5_LIBRARIES}")

  if (HDF5_BUILD_HL_LIB)
    set (HDF5_C_HL_LIBRARIES "${HDF5_HL_LIBSH_TARGET}")
  endif()

  set (HDF5_MAX_EXTERNAL_VOLS 10)
  set (HDF5_EXTERNAL_VOL_TARGETS "")

  foreach (vol_idx RANGE 1 ${HDF5_MAX_EXTERNAL_VOLS})
    # Generate fixed-width index number prepended with 0s
    # so VOL sources come in order from 1 - HDF5_MAX_EXTERNAL_VOLS
    set (vol_idx_num_digits 2) # Based on HDF5_MAX_EXTERNAL_VOLS
    set (vol_idx_fixed "${vol_idx}")
    string (LENGTH "${vol_idx_fixed}" vol_idx_len)
    while (vol_idx_len LESS vol_idx_num_digits)
      string (PREPEND vol_idx_fixed "0")
      math (EXPR vol_idx_len "${vol_idx_len}+1")
    endwhile ()

    if (HDF5_VOL_ALLOW_EXTERNAL MATCHES "GIT")
      set (HDF5_VOL_URL${vol_idx_fixed} "" CACHE STRING "Git repository URL of an external HDF5 VOL connector to build")
      mark_as_advanced (HDF5_VOL_URL${vol_idx_fixed})
      set (HDF5_VOL_SOURCE "${HDF5_VOL_URL${vol_idx_fixed}}")
    elseif(HDF5_VOL_ALLOW_EXTERNAL MATCHES "LOCAL_DIR")
      set (HDF5_VOL_PATH${vol_idx_fixed} "" CACHE STRING "Path to the source directory of an external HDF5 VOL connector to build")
      mark_as_advanced (HDF5_VOL_PATH${vol_idx_fixed})
      set (HDF5_VOL_SOURCE "${HDF5_VOL_PATH${vol_idx_fixed}}")
    endif()

    if (NOT "${HDF5_VOL_SOURCE}" STREQUAL "")
      # Deal with trailing slash in path for LOCAL_DIR case
      if (HDF5_VOL_ALLOW_EXTERNAL MATCHES "LOCAL_DIR")
        # Erase trailing slash
        string (REGEX REPLACE "/$" "" HDF5_VOL_SOURCE ${HDF5_VOL_SOURCE})
      endif()

      # Extract the name of the VOL connector
      string (FIND "${HDF5_VOL_SOURCE}" "/" hdf5_vol_name_pos REVERSE)
      if (hdf5_vol_name_pos EQUAL -1)
        if (HDF5_VOL_ALLOW_EXTERNAL MATCHES "GIT")
          message (SEND_ERROR "Invalid URL '${HDF5_VOL_SOURCE}' specified for HDF5_VOL_URL${vol_idx_fixed}")
        elseif (HDF5_VOL_ALLOW_EXTERNAL MATCHES "LOCAL_DIR")
          message (SEND_ERROR "Invalid source path '${HDF5_VOL_SOURCE}' specified for HDF5_VOL_PATH${vol_idx_fixed}")
        endif()
      endif ()

      math (EXPR hdf5_vol_name_pos "${hdf5_vol_name_pos}+1")

      string (SUBSTRING "${HDF5_VOL_SOURCE}" ${hdf5_vol_name_pos} -1 hdf5_vol_name)
      string (REPLACE ".git" "" hdf5_vol_name "${hdf5_vol_name}")
      string (STRIP "${hdf5_vol_name}" hdf5_vol_name)
      string (TOUPPER "${hdf5_vol_name}" hdf5_vol_name_upper)
      string (TOLOWER "${hdf5_vol_name}" hdf5_vol_name_lower)

      message (VERBOSE "Building VOL connector '${hdf5_vol_name}' with FetchContent from source ${HDF5_VOL_SOURCE}")

      # Set some cache variables that can be set by users when building
      if (HDF5_VOL_ALLOW_EXTERNAL MATCHES "GIT")
        set ("HDF5_VOL_${hdf5_vol_name_upper}_BRANCH" "main" CACHE STRING "Git branch (or tag) to use when building VOL connector '${hdf5_vol_name}'")
        mark_as_advanced ("HDF5_VOL_${hdf5_vol_name_upper}_BRANCH")
      endif()

      set ("HDF5_VOL_${hdf5_vol_name_upper}_CMAKE_PACKAGE_NAME"
        "${hdf5_vol_name_lower}"
        CACHE
        STRING
        "CMake package name used by find_package(...) calls for VOL connector '${hdf5_vol_name}'"
      )

      set ("HDF5_VOL_${hdf5_vol_name_upper}_NAME" "" CACHE STRING "Name of VOL connector to set for the HDF5_VOL_CONNECTOR environment variable")
      option ("HDF5_VOL_${hdf5_vol_name_upper}_TEST_PARALLEL" "Whether to test VOL connector '${hdf5_vol_name}' against the parallel API tests" OFF)

      mark_as_advanced ("HDF5_VOL_${hdf5_vol_name_upper}_NAME")
      mark_as_advanced ("HDF5_VOL_${hdf5_vol_name_upper}_TEST_PARALLEL")

      if (HDF5_TEST_API)
        if ("${HDF5_VOL_${hdf5_vol_name_upper}_NAME}" STREQUAL "")
          message (SEND_ERROR "HDF5_VOL_${hdf5_vol_name_upper}_NAME must be set to a valid connector name to use VOL connector '${hdf5_vol_name}' for testing")
        endif ()
      endif ()

      if ((HDF5_VOL_ALLOW_EXTERNAL MATCHES "GIT") AND ("${HDF5_VOL_${hdf5_vol_name_upper}_BRANCH}" STREQUAL ""))
        message (SEND_ERROR "HDF5_VOL_${hdf5_vol_name_upper}_BRANCH must be set to a valid git branch name (or git tag) to build VOL connector '${hdf5_vol_name}'")
      endif ()

      if ((HDF5_VOL_ALLOW_EXTERNAL MATCHES "LOCAL_DIR")
        AND NOT (EXISTS ${HDF5_VOL_SOURCE} AND IS_DIRECTORY ${HDF5_VOL_SOURCE}))
          message (FATAL_ERROR "HDF5_VOL_PATH${vol_idx_fixed} must be an absolute path to a valid directory")
      endif ()

      # Set internal convenience variables for FetchContent dependency name
      set (hdf5_vol_depname "${HDF5_VOL_${hdf5_vol_name_upper}_CMAKE_PACKAGE_NAME}")
      string (TOLOWER "${hdf5_vol_depname}" hdf5_vol_depname_lower)

      if (${CMAKE_VERSION} VERSION_GREATER_EQUAL "3.24")
        set("OVERRIDE_FIND_PACKAGE_OPT" "OVERRIDE_FIND_PACKAGE")
      endif()

      if (HDF5_VOL_ALLOW_EXTERNAL MATCHES "GIT")
        FetchContent_Declare (${hdf5_vol_depname}
            GIT_REPOSITORY "${HDF5_VOL_SOURCE}"
            GIT_TAG "${HDF5_VOL_${hdf5_vol_name_upper}_BRANCH}"
            "${OVERRIDE_FIND_PACKAGE_OPT}"
        )
      elseif(HDF5_VOL_ALLOW_EXTERNAL MATCHES "LOCAL_DIR")
        FetchContent_Declare (${hdf5_vol_depname}
          SOURCE_DIR "${HDF5_VOL_SOURCE}"
        )
      endif()

      FetchContent_GetProperties(${hdf5_vol_depname})
      if (NOT ${hdf5_vol_depname}_POPULATED)
        FetchContent_Populate(${hdf5_vol_depname})

        # Now that content has been populated, set other internal
        # convenience variables for FetchContent dependency
        set (hdf5_vol_depname_source_dir "${${hdf5_vol_depname_lower}_SOURCE_DIR}")
        set (hdf5_vol_depname_binary_dir "${${hdf5_vol_depname_lower}_BINARY_DIR}")

        if (NOT EXISTS "${hdf5_vol_depname_source_dir}/CMakeLists.txt")
          if (HDF5_VOL_ALLOW_EXTERNAL MATCHES "GIT")
            message (SEND_ERROR "The git repository branch '${HDF5_VOL_${hdf5_vol_name_upper}_BRANCH}' for VOL connector '${hdf5_vol_name}' does not appear to contain a CMakeLists.txt file")
          elseif (HDF5_VOL_ALLOW_EXTERNAL MATCHES "LOCAL_DIR")
            message(SEND_ERROR "The local directory '${HDF5_VOL_SOURCE}' for VOL connector '${hdf5_vol_name}' does not appear to contain a CMakeLists.txt file")
          endif()
        endif ()

        # If there are any calls to find_package(HDF5) in the connector's
        # CMakeLists.txt files, remove those since any found HDF5 targets
        # will conflict with targets being generated by this build of HDF5
        if (EXISTS "${hdf5_vol_depname_source_dir}/CMakeLists.txt")
          file (READ "${hdf5_vol_depname_source_dir}/CMakeLists.txt" vol_cmake_contents)
          string (REGEX REPLACE "[ \t]*find_package[ \t]*\\([ \t]*HDF5[^\r\n\\)]*\\)[ \t]*[\r\n]+" "" vol_cmake_contents "${vol_cmake_contents}")

HDFGroup/hdf5 config/cmake/HDF5PluginMacros.cmake :38

string(TOLOWER ${plname} PLUGIN_NAME)

HDFGroup/hdf5 HDF5Examples/config/cmake/HDFExampleMacros.cmake :16

string (TOLOWER ${varname} EXAMPLE_VARNAME)

InsightSoftwareConsortium/ITK Modules/ThirdParty/GDCM/src/gdcm/Utilities/socketxx/CMakeLists.txt :11

string(TOLOWER ${SOCKETXX_NAMESPACE} SOCKETXX_LIBRARY_NAME)

InsightSoftwareConsortium/ITK Modules/ThirdParty/HDF5/src/itkhdf5/CMakeVOL.cmake :49

      string (REGEX MATCH "^[ \t]*set_tests_properties\\([ \t]*[\r\n]?" match_string "${line}")
      if (NOT "${match_string}" STREQUAL "")
        string (REGEX REPLACE "^[ \t]*set_tests_properties\\([ \t]*[\r\n]?" "" stripped_line "${line}")
      endif ()
      string (REGEX MATCH "^[ \t]*.\\{test\\}[ \t]*[\r\n]?" match_string "${line}")
      if (NOT "${match_string}" STREQUAL "")
        string (REGEX REPLACE "^[ \t]*.\\{[A-Za-z]*\\}[ \t]*[\r\n]?" "" stripped_line "${line}")
      endif ()
      string (REGEX MATCH "^[ \t]*PROPERTIES[ \t]*[\r\n]?" match_string "${line}")
      if (NOT "${match_string}" STREQUAL "")
        string (REGEX REPLACE "^[ \t]*PROPERTIES[ \t]*[\r\n]?" "" stripped_line "${line}")
      endif ()
      string (REGEX MATCH "^[ \t]*ENVIRONMENT[ \t]*.*[\r\n]?" match_string "${line}")
      if (NOT "${match_string}" STREQUAL "")
        string (REGEX REPLACE "^[ \t]*ENVIRONMENT[ \t]*.*[\r\n]?" "" stripped_line "${line}")
      endif ()
      file (APPEND "${source_dir}/tests/CMakeLists.txt" "${stripped_line}\n")
    endforeach ()
  endif ()
endfunction ()

set (HDF5_VOL_ALLOW_EXTERNAL "NO" CACHE STRING "Allow building of external HDF5 VOL connectors with FetchContent")
set_property (CACHE HDF5_VOL_ALLOW_EXTERNAL PROPERTY STRINGS NO GIT LOCAL_DIR)
mark_as_advanced (HDF5_VOL_ALLOW_EXTERNAL)
if (HDF5_VOL_ALLOW_EXTERNAL MATCHES "GIT" OR HDF5_VOL_ALLOW_EXTERNAL MATCHES "LOCAL_DIR")
  # For compatibility, set some variables that projects would
  # typically look for after calling find_package(HDF5)
  set (HDF5_FOUND 1)
  set (HDF5_LIBRARIES "${HDF5_LIBSH_TARGET};${LINK_LIBS};${LINK_COMP_LIBS};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:MPI::MPI_C>")
  set (HDF5_INCLUDE_DIRS "${HDF5_SRC_INCLUDE_DIRS};${HDF5_SRC_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>")
  set (HDF5_IS_PARALLEL ${H5_HAVE_PARALLEL})
  set (HDF5_VERSION ${HDF5_PACKAGE_VERSION})

  set (HDF5_C_LIBRARIES "${HDF5_LIBRARIES}")

  if (HDF5_BUILD_HL_LIB)
    set (HDF5_C_HL_LIBRARIES "${HDF5_HL_LIBSH_TARGET}")
  endif()

  set (HDF5_MAX_EXTERNAL_VOLS 10)
  set (HDF5_EXTERNAL_VOL_TARGETS "")

  foreach (vol_idx RANGE 1 ${HDF5_MAX_EXTERNAL_VOLS})
    # Generate fixed-width index number prepended with 0s
    # so VOL sources come in order from 1 - HDF5_MAX_EXTERNAL_VOLS
    set (vol_idx_num_digits 2) # Based on HDF5_MAX_EXTERNAL_VOLS
    set (vol_idx_fixed "${vol_idx}")
    string (LENGTH "${vol_idx_fixed}" vol_idx_len)
    while (vol_idx_len LESS vol_idx_num_digits)
      string (PREPEND vol_idx_fixed "0")
      math (EXPR vol_idx_len "${vol_idx_len}+1")
    endwhile ()

    if (HDF5_VOL_ALLOW_EXTERNAL MATCHES "GIT")
      set (HDF5_VOL_URL${vol_idx_fixed} "" CACHE STRING "Git repository URL of an external HDF5 VOL connector to build")
      mark_as_advanced (HDF5_VOL_URL${vol_idx_fixed})
      set (HDF5_VOL_SOURCE "${HDF5_VOL_URL${vol_idx_fixed}}")
    elseif(HDF5_VOL_ALLOW_EXTERNAL MATCHES "LOCAL_DIR")
      set (HDF5_VOL_PATH${vol_idx_fixed} "" CACHE STRING "Path to the source directory of an external HDF5 VOL connector to build")
      mark_as_advanced (HDF5_VOL_PATH${vol_idx_fixed})
      set (HDF5_VOL_SOURCE "${HDF5_VOL_PATH${vol_idx_fixed}}")
    endif()

    if (NOT "${HDF5_VOL_SOURCE}" STREQUAL "")
      # Deal with trailing slash in path for LOCAL_DIR case
      if (HDF5_VOL_ALLOW_EXTERNAL MATCHES "LOCAL_DIR")
        # Erase trailing slash
        string (REGEX REPLACE "/$" "" HDF5_VOL_SOURCE ${HDF5_VOL_SOURCE})
      endif()

      # Extract the name of the VOL connector
      string (FIND "${HDF5_VOL_SOURCE}" "/" hdf5_vol_name_pos REVERSE)
      if (hdf5_vol_name_pos EQUAL -1)
        if (HDF5_VOL_ALLOW_EXTERNAL MATCHES "GIT")
          message (SEND_ERROR "Invalid URL '${HDF5_VOL_SOURCE}' specified for HDF5_VOL_URL${vol_idx_fixed}")
        elseif (HDF5_VOL_ALLOW_EXTERNAL MATCHES "LOCAL_DIR")
          message (SEND_ERROR "Invalid source path '${HDF5_VOL_SOURCE}' specified for HDF5_VOL_PATH${vol_idx_fixed}")
        endif()
      endif ()

      math (EXPR hdf5_vol_name_pos "${hdf5_vol_name_pos}+1")

      string (SUBSTRING "${HDF5_VOL_SOURCE}" ${hdf5_vol_name_pos} -1 hdf5_vol_name)
      string (REPLACE ".git" "" hdf5_vol_name "${hdf5_vol_name}")
      string (STRIP "${hdf5_vol_name}" hdf5_vol_name)
      string (TOUPPER "${hdf5_vol_name}" hdf5_vol_name_upper)
      string (TOLOWER "${hdf5_vol_name}" hdf5_vol_name_lower)

      message (VERBOSE "Building VOL connector '${hdf5_vol_name}' with FetchContent from source ${HDF5_VOL_SOURCE}")

      # Set some cache variables that can be set by users when building
      if (HDF5_VOL_ALLOW_EXTERNAL MATCHES "GIT")
        set ("HDF5_VOL_${hdf5_vol_name_upper}_BRANCH" "main" CACHE STRING "Git branch (or tag) to use when building VOL connector '${hdf5_vol_name}'")
        mark_as_advanced ("HDF5_VOL_${hdf5_vol_name_upper}_BRANCH")
      endif()

      set ("HDF5_VOL_${hdf5_vol_name_upper}_CMAKE_PACKAGE_NAME"
        "${hdf5_vol_name_lower}"
        CACHE
        STRING
        "CMake package name used by find_package(...) calls for VOL connector '${hdf5_vol_name}'"
      )

      set ("HDF5_VOL_${hdf5_vol_name_upper}_NAME" "" CACHE STRING "Name of VOL connector to set for the HDF5_VOL_CONNECTOR environment variable")
      option ("HDF5_VOL_${hdf5_vol_name_upper}_TEST_PARALLEL" "Whether to test VOL connector '${hdf5_vol_name}' against the parallel API tests" OFF)

      mark_as_advanced ("HDF5_VOL_${hdf5_vol_name_upper}_NAME")
      mark_as_advanced ("HDF5_VOL_${hdf5_vol_name_upper}_TEST_PARALLEL")

      if (HDF5_TEST_API)
        if ("${HDF5_VOL_${hdf5_vol_name_upper}_NAME}" STREQUAL "")
          message (SEND_ERROR "HDF5_VOL_${hdf5_vol_name_upper}_NAME must be set to a valid connector name to use VOL connector '${hdf5_vol_name}' for testing")
        endif ()
      endif ()

      if ((HDF5_VOL_ALLOW_EXTERNAL MATCHES "GIT") AND ("${HDF5_VOL_${hdf5_vol_name_upper}_BRANCH}" STREQUAL ""))
        message (SEND_ERROR "HDF5_VOL_${hdf5_vol_name_upper}_BRANCH must be set to a valid git branch name (or git tag) to build VOL connector '${hdf5_vol_name}'")
      endif ()

      if ((HDF5_VOL_ALLOW_EXTERNAL MATCHES "LOCAL_DIR")
        AND NOT (EXISTS ${HDF5_VOL_SOURCE} AND IS_DIRECTORY ${HDF5_VOL_SOURCE}))
          message (FATAL_ERROR "HDF5_VOL_PATH${vol_idx_fixed} must be an absolute path to a valid directory")
      endif ()

      # Set internal convenience variables for FetchContent dependency name
      set (hdf5_vol_depname "${HDF5_VOL_${hdf5_vol_name_upper}_CMAKE_PACKAGE_NAME}")
      string (TOLOWER "${hdf5_vol_depname}" hdf5_vol_depname_lower)

      if (${CMAKE_VERSION} VERSION_GREATER_EQUAL "3.24")
        set("OVERRIDE_FIND_PACKAGE_OPT" "OVERRIDE_FIND_PACKAGE")
      endif()

      if (HDF5_VOL_ALLOW_EXTERNAL MATCHES "GIT")
        FetchContent_Declare (${hdf5_vol_depname}
            GIT_REPOSITORY "${HDF5_VOL_SOURCE}"
            GIT_TAG "${HDF5_VOL_${hdf5_vol_name_upper}_BRANCH}"
            "${OVERRIDE_FIND_PACKAGE_OPT}"
        )
      elseif(HDF5_VOL_ALLOW_EXTERNAL MATCHES "LOCAL_DIR")
        FetchContent_Declare (${hdf5_vol_depname}
          SOURCE_DIR "${HDF5_VOL_SOURCE}"
        )
      endif()

      FetchContent_GetProperties(${hdf5_vol_depname})
      if (NOT ${hdf5_vol_depname}_POPULATED)
        FetchContent_Populate(${hdf5_vol_depname})

        # Now that content has been populated, set other internal
        # convenience variables for FetchContent dependency
        set (hdf5_vol_depname_source_dir "${${hdf5_vol_depname_lower}_SOURCE_DIR}")
        set (hdf5_vol_depname_binary_dir "${${hdf5_vol_depname_lower}_BINARY_DIR}")

        if (NOT EXISTS "${hdf5_vol_depname_source_dir}/CMakeLists.txt")
          if (HDF5_VOL_ALLOW_EXTERNAL MATCHES "GIT")
            message (SEND_ERROR "The git repository branch '${HDF5_VOL_${hdf5_vol_name_upper}_BRANCH}' for VOL connector '${hdf5_vol_name}' does not appear to contain a CMakeLists.txt file")
          elseif (HDF5_VOL_ALLOW_EXTERNAL MATCHES "LOCAL_DIR")
            message(SEND_ERROR "The local directory '${HDF5_VOL_SOURCE}' for VOL connector '${hdf5_vol_name}' does not appear to contain a CMakeLists.txt file")
          endif()
        endif ()

        # If there are any calls to find_package(HDF5) in the connector's
        # CMakeLists.txt files, remove those since any found HDF5 targets
        # will conflict with targets being generated by this build of HDF5
        if (EXISTS "${hdf5_vol_depname_source_dir}/CMakeLists.txt")
          file (READ "${hdf5_vol_depname_source_dir}/CMakeLists.txt" vol_cmake_contents)
          string (REGEX REPLACE "[ \t]*find_package[ \t]*\\([ \t]*HDF5[^\r\n\\)]*\\)[ \t]*[\r\n]+" "" vol_cmake_contents "${vol_cmake_contents}")
          file (WRITE "${hdf5_vol_depname_source_dir}/CMakeLists.txt" "${vol_cmake_contents}")
        endif ()
        if (EXISTS "${hdf5_vol_depname_source_dir}/src/CMakeLists.txt")
          file (READ "${hdf5_vol_depname_source_dir}/src/CMakeLists.txt" vol_cmake_contents)
          string (REGEX REPLACE "[ \t]*find_package[ \t]*\\([ \t]*HDF5[^\r\n\\)]*\\)[ \t]*[\r\n]+" "" vol_cmake_contents "${vol_cmake_contents}")

InsightSoftwareConsortium/ITK Modules/ThirdParty/HDF5/src/itkhdf5/CMakeVOL.cmake :51

        string (REGEX REPLACE "^[ \t]*set_tests_properties\\([ \t]*[\r\n]?" "" stripped_line "${line}")
      endif ()
      string (REGEX MATCH "^[ \t]*.\\{test\\}[ \t]*[\r\n]?" match_string "${line}")
      if (NOT "${match_string}" STREQUAL "")
        string (REGEX REPLACE "^[ \t]*.\\{[A-Za-z]*\\}[ \t]*[\r\n]?" "" stripped_line "${line}")
      endif ()
      string (REGEX MATCH "^[ \t]*PROPERTIES[ \t]*[\r\n]?" match_string "${line}")
      if (NOT "${match_string}" STREQUAL "")
        string (REGEX REPLACE "^[ \t]*PROPERTIES[ \t]*[\r\n]?" "" stripped_line "${line}")
      endif ()
      string (REGEX MATCH "^[ \t]*ENVIRONMENT[ \t]*.*[\r\n]?" match_string "${line}")
      if (NOT "${match_string}" STREQUAL "")
        string (REGEX REPLACE "^[ \t]*ENVIRONMENT[ \t]*.*[\r\n]?" "" stripped_line "${line}")
      endif ()
      file (APPEND "${source_dir}/tests/CMakeLists.txt" "${stripped_line}\n")
    endforeach ()
  endif ()
endfunction ()

set (HDF5_VOL_ALLOW_EXTERNAL "NO" CACHE STRING "Allow building of external HDF5 VOL connectors with FetchContent")
set_property (CACHE HDF5_VOL_ALLOW_EXTERNAL PROPERTY STRINGS NO GIT LOCAL_DIR)
mark_as_advanced (HDF5_VOL_ALLOW_EXTERNAL)
if (HDF5_VOL_ALLOW_EXTERNAL MATCHES "GIT" OR HDF5_VOL_ALLOW_EXTERNAL MATCHES "LOCAL_DIR")
  # For compatibility, set some variables that projects would
  # typically look for after calling find_package(HDF5)
  set (HDF5_FOUND 1)
  set (HDF5_LIBRARIES "${HDF5_LIBSH_TARGET};${LINK_LIBS};${LINK_COMP_LIBS};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:MPI::MPI_C>")
  set (HDF5_INCLUDE_DIRS "${HDF5_SRC_INCLUDE_DIRS};${HDF5_SRC_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>")
  set (HDF5_IS_PARALLEL ${H5_HAVE_PARALLEL})
  set (HDF5_VERSION ${HDF5_PACKAGE_VERSION})

  set (HDF5_C_LIBRARIES "${HDF5_LIBRARIES}")

  if (HDF5_BUILD_HL_LIB)
    set (HDF5_C_HL_LIBRARIES "${HDF5_HL_LIBSH_TARGET}")
  endif()

  set (HDF5_MAX_EXTERNAL_VOLS 10)
  set (HDF5_EXTERNAL_VOL_TARGETS "")

  foreach (vol_idx RANGE 1 ${HDF5_MAX_EXTERNAL_VOLS})
    # Generate fixed-width index number prepended with 0s
    # so VOL sources come in order from 1 - HDF5_MAX_EXTERNAL_VOLS
    set (vol_idx_num_digits 2) # Based on HDF5_MAX_EXTERNAL_VOLS
    set (vol_idx_fixed "${vol_idx}")
    string (LENGTH "${vol_idx_fixed}" vol_idx_len)
    while (vol_idx_len LESS vol_idx_num_digits)
      string (PREPEND vol_idx_fixed "0")
      math (EXPR vol_idx_len "${vol_idx_len}+1")
    endwhile ()

    if (HDF5_VOL_ALLOW_EXTERNAL MATCHES "GIT")
      set (HDF5_VOL_URL${vol_idx_fixed} "" CACHE STRING "Git repository URL of an external HDF5 VOL connector to build")
      mark_as_advanced (HDF5_VOL_URL${vol_idx_fixed})
      set (HDF5_VOL_SOURCE "${HDF5_VOL_URL${vol_idx_fixed}}")
    elseif(HDF5_VOL_ALLOW_EXTERNAL MATCHES "LOCAL_DIR")
      set (HDF5_VOL_PATH${vol_idx_fixed} "" CACHE STRING "Path to the source directory of an external HDF5 VOL connector to build")
      mark_as_advanced (HDF5_VOL_PATH${vol_idx_fixed})
      set (HDF5_VOL_SOURCE "${HDF5_VOL_PATH${vol_idx_fixed}}")
    endif()

    if (NOT "${HDF5_VOL_SOURCE}" STREQUAL "")
      # Deal with trailing slash in path for LOCAL_DIR case
      if (HDF5_VOL_ALLOW_EXTERNAL MATCHES "LOCAL_DIR")
        # Erase trailing slash
        string (REGEX REPLACE "/$" "" HDF5_VOL_SOURCE ${HDF5_VOL_SOURCE})
      endif()

      # Extract the name of the VOL connector
      string (FIND "${HDF5_VOL_SOURCE}" "/" hdf5_vol_name_pos REVERSE)
      if (hdf5_vol_name_pos EQUAL -1)
        if (HDF5_VOL_ALLOW_EXTERNAL MATCHES "GIT")
          message (SEND_ERROR "Invalid URL '${HDF5_VOL_SOURCE}' specified for HDF5_VOL_URL${vol_idx_fixed}")
        elseif (HDF5_VOL_ALLOW_EXTERNAL MATCHES "LOCAL_DIR")
          message (SEND_ERROR "Invalid source path '${HDF5_VOL_SOURCE}' specified for HDF5_VOL_PATH${vol_idx_fixed}")
        endif()
      endif ()

      math (EXPR hdf5_vol_name_pos "${hdf5_vol_name_pos}+1")

      string (SUBSTRING "${HDF5_VOL_SOURCE}" ${hdf5_vol_name_pos} -1 hdf5_vol_name)
      string (REPLACE ".git" "" hdf5_vol_name "${hdf5_vol_name}")
      string (STRIP "${hdf5_vol_name}" hdf5_vol_name)
      string (TOUPPER "${hdf5_vol_name}" hdf5_vol_name_upper)
      string (TOLOWER "${hdf5_vol_name}" hdf5_vol_name_lower)

      message (VERBOSE "Building VOL connector '${hdf5_vol_name}' with FetchContent from source ${HDF5_VOL_SOURCE}")

      # Set some cache variables that can be set by users when building
      if (HDF5_VOL_ALLOW_EXTERNAL MATCHES "GIT")
        set ("HDF5_VOL_${hdf5_vol_name_upper}_BRANCH" "main" CACHE STRING "Git branch (or tag) to use when building VOL connector '${hdf5_vol_name}'")
        mark_as_advanced ("HDF5_VOL_${hdf5_vol_name_upper}_BRANCH")
      endif()

      set ("HDF5_VOL_${hdf5_vol_name_upper}_CMAKE_PACKAGE_NAME"
        "${hdf5_vol_name_lower}"
        CACHE
        STRING
        "CMake package name used by find_package(...) calls for VOL connector '${hdf5_vol_name}'"
      )

      set ("HDF5_VOL_${hdf5_vol_name_upper}_NAME" "" CACHE STRING "Name of VOL connector to set for the HDF5_VOL_CONNECTOR environment variable")
      option ("HDF5_VOL_${hdf5_vol_name_upper}_TEST_PARALLEL" "Whether to test VOL connector '${hdf5_vol_name}' against the parallel API tests" OFF)

      mark_as_advanced ("HDF5_VOL_${hdf5_vol_name_upper}_NAME")
      mark_as_advanced ("HDF5_VOL_${hdf5_vol_name_upper}_TEST_PARALLEL")

      if (HDF5_TEST_API)
        if ("${HDF5_VOL_${hdf5_vol_name_upper}_NAME}" STREQUAL "")
          message (SEND_ERROR "HDF5_VOL_${hdf5_vol_name_upper}_NAME must be set to a valid connector name to use VOL connector '${hdf5_vol_name}' for testing")
        endif ()
      endif ()

      if ((HDF5_VOL_ALLOW_EXTERNAL MATCHES "GIT") AND ("${HDF5_VOL_${hdf5_vol_name_upper}_BRANCH}" STREQUAL ""))
        message (SEND_ERROR "HDF5_VOL_${hdf5_vol_name_upper}_BRANCH must be set to a valid git branch name (or git tag) to build VOL connector '${hdf5_vol_name}'")
      endif ()

      if ((HDF5_VOL_ALLOW_EXTERNAL MATCHES "LOCAL_DIR")
        AND NOT (EXISTS ${HDF5_VOL_SOURCE} AND IS_DIRECTORY ${HDF5_VOL_SOURCE}))
          message (FATAL_ERROR "HDF5_VOL_PATH${vol_idx_fixed} must be an absolute path to a valid directory")
      endif ()

      # Set internal convenience variables for FetchContent dependency name
      set (hdf5_vol_depname "${HDF5_VOL_${hdf5_vol_name_upper}_CMAKE_PACKAGE_NAME}")
      string (TOLOWER "${hdf5_vol_depname}" hdf5_vol_depname_lower)

      if (${CMAKE_VERSION} VERSION_GREATER_EQUAL "3.24")
        set("OVERRIDE_FIND_PACKAGE_OPT" "OVERRIDE_FIND_PACKAGE")
      endif()

      if (HDF5_VOL_ALLOW_EXTERNAL MATCHES "GIT")
        FetchContent_Declare (${hdf5_vol_depname}
            GIT_REPOSITORY "${HDF5_VOL_SOURCE}"
            GIT_TAG "${HDF5_VOL_${hdf5_vol_name_upper}_BRANCH}"
            "${OVERRIDE_FIND_PACKAGE_OPT}"
        )
      elseif(HDF5_VOL_ALLOW_EXTERNAL MATCHES "LOCAL_DIR")
        FetchContent_Declare (${hdf5_vol_depname}
          SOURCE_DIR "${HDF5_VOL_SOURCE}"
        )
      endif()

      FetchContent_GetProperties(${hdf5_vol_depname})
      if (NOT ${hdf5_vol_depname}_POPULATED)
        FetchContent_Populate(${hdf5_vol_depname})

        # Now that content has been populated, set other internal
        # convenience variables for FetchContent dependency
        set (hdf5_vol_depname_source_dir "${${hdf5_vol_depname_lower}_SOURCE_DIR}")
        set (hdf5_vol_depname_binary_dir "${${hdf5_vol_depname_lower}_BINARY_DIR}")

        if (NOT EXISTS "${hdf5_vol_depname_source_dir}/CMakeLists.txt")
          if (HDF5_VOL_ALLOW_EXTERNAL MATCHES "GIT")
            message (SEND_ERROR "The git repository branch '${HDF5_VOL_${hdf5_vol_name_upper}_BRANCH}' for VOL connector '${hdf5_vol_name}' does not appear to contain a CMakeLists.txt file")
          elseif (HDF5_VOL_ALLOW_EXTERNAL MATCHES "LOCAL_DIR")
            message(SEND_ERROR "The local directory '${HDF5_VOL_SOURCE}' for VOL connector '${hdf5_vol_name}' does not appear to contain a CMakeLists.txt file")
          endif()
        endif ()

        # If there are any calls to find_package(HDF5) in the connector's
        # CMakeLists.txt files, remove those since any found HDF5 targets
        # will conflict with targets being generated by this build of HDF5
        if (EXISTS "${hdf5_vol_depname_source_dir}/CMakeLists.txt")
          file (READ "${hdf5_vol_depname_source_dir}/CMakeLists.txt" vol_cmake_contents)
          string (REGEX REPLACE "[ \t]*find_package[ \t]*\\([ \t]*HDF5[^\r\n\\)]*\\)[ \t]*[\r\n]+" "" vol_cmake_contents "${vol_cmake_contents}")

InsightSoftwareConsortium/ITK Modules/ThirdParty/HDF5/src/itkhdf5/CMakeVOL.cmake :135

string (TOLOWER "${hdf5_vol_name}" hdf5_vol_name_lower)

InsightSoftwareConsortium/ITK Modules/ThirdParty/HDF5/src/itkhdf5/config/cmake/HDF5PluginMacros.cmake :38

string(TOLOWER ${plname} PLUGIN_NAME)

KhronosGroup/KTX CMakeLists.txt :1451

string(TOLOWER "${processor_name}" processor_name)

KhronosGroup/KTX external/astc-encoder/CMakeLists.txt :154

string(TOLOWER "macOS" ASTCENC_PKG_OS)

lammps/lammps cmake/CMakeLists.txt :716

string(TOLOWER "${PKG_LIB}" PKG_LIB)

lammps/lammps cmake/Modules/LAMMPSUtils.cmake :12

string(TOLOWER ${${name}} needle_lower)

lammps/lammps cmake/Modules/Testing.cmake :121

string(TOLOWER ${ENABLE_SANITIZER} ENABLE_SANITIZER)

lammps/lammps lib/kokkos/algorithms/unit_tests/CMakeLists.txt :11

string(TOLOWER ${Tag} dir)

lammps/lammps lib/kokkos/cmake/gnu.cmake :3

string(TOLOWER ${int_standard} INT_LC_STANDARD)

lammps/lammps lib/kokkos/containers/performance_tests/CMakeLists.txt :7

string(TOLOWER ${Tag} dir)

lammps/lammps lib/kokkos/containers/unit_tests/CMakeLists.txt :8

string(TOLOWER ${Tag} dir)

rui314/mold third-party/tbb/CMakeLists.txt :187

string(TOLOWER ${CMAKE_CXX_COMPILER_ID}_${_tbb_compiler_version_short}_cxx${CMAKE_CXX_STANDARD}_${TBB_ARCH}${_tbb_msvc_runtime}${_tbb_win_store} TBB_OUTPUT_DIR_BASE)

rui314/mold third-party/tbb/CMakeLists.txt :203

string(TOLOWER ${suffix} _tbb_suffix_lower)

neocmakelsp/neocmakelsp experiment_assets/nheko.cmake :97

string(TOLOWER ${contentName} contentNameLower)

neovim/neovim cmake/ConvertPo.cmake :2

string(TOLOWER ${INPUT_ENC} lowerInputEnc)

YosysHQ/nextpnr 3rdparty/sanitizers-cmake/cmake/sanitize-helpers.cmake :121

string(TOLOWER ${PREFIX} PREFIX_lower)

tpaviot/oce CMakeLists.txt :1147

string (TOLOWER "${OCCT_CONFIGURATION}" OCCT_CONFIGURATION_LOWER)

uxlfoundation/oneTBB CMakeLists.txt :210

string(TOLOWER ${CMAKE_BUILD_TYPE} _tbb_build_type_lower)

uxlfoundation/oneTBB CMakeLists.txt :218

string(TOLOWER ${suffix} _tbb_suffix_lower)

open62541/open62541 tools/cmake/Findcodecov.cmake :144

string(TOLOWER "${FILE_EXT}" FILE_EXT)

OpenMathLib/OpenBLAS driver/level3/CMakeLists.txt :117

string(TOLOWER ${gemm_define} gemm_define_LC)

OpenMathLib/OpenBLAS lapack-netlib/CMAKE/Findcodecov.cmake :98

string(TOLOWER "${FILE_EXT}" FILE_EXT)

OpenMathLib/OpenBLAS lapack-netlib/CMAKE/PreventInBuildInstalls.cmake :1

string(TOLOWER "${CMAKE_INSTALL_PREFIX}" _PREFIX)

opencv/opencv cmake/OpenCVCompilerOptimizations.cmake :719

string(TOLOWER "${fname}" fname_LOWER)

opencv/opencv cmake/OpenCVCompilerOptimizations.cmake :751

string(TOLOWER "${OPT2}" OPT2_LOWER)

opencv/opencv modules/dnn/cmake/init.cmake :11

string(TOLOWER "${DNN_PLUGIN_LIST}" DNN_PLUGIN_LIST)

opencv/opencv modules/videoio/CMakeLists.txt :11

string(TOLOWER "${VIDEOIO_PLUGIN_LIST}" VIDEOIO_PLUGIN_LIST)

AcademySoftwareFoundation/OpenImageIO src/cmake/dependency_utils.cmake :71

string (TOLOWER ${_var} _var_lower)

uclouvain/openjpeg CMakeLists.txt :17

#string(TOLOWER ${OPENJPEG_NAMESPACE} OPENJPEG_LIBRARY_NAME)

uclouvain/openjpeg CMakeLists.txt :104

string(TOLOWER ${PROJECT_NAME} PROJECT_NAME)

AcademySoftwareFoundation/OpenShadingLanguage CMakeLists.txt :19

string (TOLOWER ${PROJ_NAME} PROJ_NAME_LOWER)  # short name lower case

AcademySoftwareFoundation/OpenShadingLanguage src/cmake/dependency_utils.cmake :62

string (TOLOWER ${pattern} _pattern_lower)

AcademySoftwareFoundation/OpenShadingLanguage src/cmake/dependency_utils.cmake :307

# string (TOLOWER "${_pkg_BUILD_LOCAL}" _pkg_BUILD_LOCAL)

AcademySoftwareFoundation/openvdb openvdb_houdini/openvdb_houdini/CMakeLists.txt :68

string(TOLOWER ${OPENVDB_HOUDINI_OPHIDE_POLICY} OPENVDB_HOUDINI_OPHIDE_POLICY)

PDAL/PDAL cmake/pluginmacros.cmake :8

string(TOLOWER ${PDAL_CREATE_PLUGIN_TYPE} TYPE)

PDAL/PDAL cmake/pluginmacros.cmake :9

string(TOLOWER ${PDAL_CREATE_PLUGIN_NAME} NAME)

podofo/podofo test/common/cmake/ParseAndAddCatchTests.cmake :137

        string(REGEX MATCH "(CATCH_)?(TEMPLATE_)?(TEST_CASE_METHOD|SCENARIO|TEST_CASE)[ \t]*\\([^,^\"]*" TestTypeAndFixture "${TestName}")
        string(REGEX MATCH "(CATCH_)?(TEMPLATE_)?(TEST_CASE_METHOD|SCENARIO|TEST_CASE)" TestType "${TestTypeAndFixture}")
        string(REGEX REPLACE "${TestType}\\([ \t]*" "" TestFixture "${TestTypeAndFixture}")

        # Get string parts of test definition
        string(REGEX MATCHALL "\"+([^\\^\"]|\\\\\")+\"+" TestStrings "${TestName}")

        # Strip wrapping quotation marks
        string(REGEX REPLACE "^\"(.*)\"$" "\\1" TestStrings "${TestStrings}")
        string(REPLACE "\";\"" ";" TestStrings "${TestStrings}")

        # Validate that a test name and tags have been provided
        list(LENGTH TestStrings TestStringsLength)
        if(TestStringsLength GREATER 2 OR TestStringsLength LESS 1)
            message(FATAL_ERROR "You must provide a valid test name and tags for all tests in ${SourceFile}")
        endif()

        # Assign name and tags
        list(GET TestStrings 0 Name)
        if("${TestType}" STREQUAL "SCENARIO")
            set(Name "Scenario: ${Name}")
        endif()
        if(PARSE_CATCH_TESTS_ADD_FIXTURE_IN_TEST_NAME AND "${TestType}" MATCHES "(CATCH_)?TEST_CASE_METHOD" AND TestFixture )
            set(CTestName "${TestFixture}:${Name}")
        else()
            set(CTestName "${Name}")
        endif()
        if(PARSE_CATCH_TESTS_ADD_TARGET_IN_TEST_NAME)
            set(CTestName "${TestTarget}:${CTestName}")
        endif()
        # add target to labels to enable running all tests added from this target
        set(Labels ${TestTarget})
        if(TestStringsLength EQUAL 2)
            list(GET TestStrings 1 Tags)
            string(TOLOWER "${Tags}" Tags)
            # remove target from labels if the test is hidden
            if("${Tags}" MATCHES ".*\\[!?(hide|\\.)\\].*")
                list(REMOVE_ITEM Labels ${TestTarget})
            endif()
            string(REPLACE "]" ";" Tags "${Tags}")
            string(REPLACE "[" "" Tags "${Tags}")
        else()
          # unset tags variable from previous loop
          unset(Tags)
        endif()

        list(APPEND Labels ${Tags})

        set(HiddenTagFound OFF)
        foreach(label ${Labels})
            string(REGEX MATCH "^!hide|^\\." result ${label})
            if(result)
                set(HiddenTagFound ON)
                break()
            endif(result)
        endforeach(label)
        if(PARSE_CATCH_TESTS_NO_HIDDEN_TESTS AND ${HiddenTagFound} AND ${CMAKE_VERSION} VERSION_LESS "3.9")
            ParseAndAddCatchTests_PrintDebugMessage("Skipping test \"${CTestName}\" as it has [!hide], [.] or [.foo] label")
        else()
            ParseAndAddCatchTests_PrintDebugMessage("Adding test \"${CTestName}\"")
            if(Labels)
                ParseAndAddCatchTests_PrintDebugMessage("Setting labels to ${Labels}")
            endif()

            # Escape commas in the test spec
            string(REPLACE "," "\\," Name ${Name})

            # Work around CMake 3.18.0 change in `add_test()`, before the escaped quotes were necessary,
            # only with CMake 3.18.0 the escaped double quotes confuse the call. This change is reverted in 3.18.1
            # And properly introduced in 3.19 with the CMP0110 policy
            if(_cmp0110_value STREQUAL "NEW" OR ${CMAKE_VERSION} VERSION_EQUAL "3.18")
                ParseAndAddCatchTests_PrintDebugMessage("CMP0110 set to NEW, no need for add_test(\"\") workaround")
            else()
                ParseAndAddCatchTests_PrintDebugMessage("CMP0110 set to OLD adding \"\" for add_test() workaround")
                set(CTestName "\"${CTestName}\"")
            endif()

            # Handle template test cases
            if("${TestTypeAndFixture}" MATCHES ".*TEMPLATE_.*")
              set(Name "${Name} - *")
            endif()

            # Add the test and set its properties
            add_test(NAME "${CTestName}" COMMAND ${OptionalCatchTestLauncher} $<TARGET_FILE:${TestTarget}> ${Name} ${AdditionalCatchParameters})
            # Old CMake versions do not document VERSION_GREATER_EQUAL, so we use VERSION_GREATER with 3.8 instead
            if(PARSE_CATCH_TESTS_NO_HIDDEN_TESTS AND ${HiddenTagFound} AND ${CMAKE_VERSION} VERSION_GREATER "3.8")
                ParseAndAddCatchTests_PrintDebugMessage("Setting DISABLED test property")
                set_tests_properties("${CTestName}" PROPERTIES DISABLED ON)
            else()
                set_tests_properties("${CTestName}" PROPERTIES FAIL_REGULAR_EXPRESSION "No tests ran"
                                                        LABELS "${Labels}")
            endif()
            set_property(
              TARGET ${TestTarget}
              APPEND
              PROPERTY ParseAndAddCatchTests_TESTS "${CTestName}")
            set_property(
              SOURCE ${SourceFile}
              APPEND
              PROPERTY ParseAndAddCatchTests_TESTS "${CTestName}")
        endif()


    endforeach()
endfunction()

# entry point
function(ParseAndAddCatchTests TestTarget)
    message(DEPRECATION "ParseAndAddCatchTest: function deprecated because of possibility of missed test cases. Consider using 'catch_discover_tests' from 'Catch.cmake'")
    ParseAndAddCatchTests_PrintDebugMessage("Started parsing ${TestTarget}")
    get_target_property(SourceFiles ${TestTarget} SOURCES)
    ParseAndAddCatchTests_PrintDebugMessage("Found the following sources: ${SourceFiles}")
    foreach(SourceFile ${SourceFiles})
        ParseAndAddCatchTests_ParseFile(${SourceFile} ${TestTarget})
    endforeach()
    ParseAndAddCatchTests_PrintDebugMessage("Finished parsing ${TestTarget}")
endfunction()

podofo/podofo test/common/cmake/ParseAndAddCatchTests.cmake :139

        string(REGEX REPLACE "${TestType}\\([ \t]*" "" TestFixture "${TestTypeAndFixture}")

        # Get string parts of test definition
        string(REGEX MATCHALL "\"+([^\\^\"]|\\\\\")+\"+" TestStrings "${TestName}")

        # Strip wrapping quotation marks
        string(REGEX REPLACE "^\"(.*)\"$" "\\1" TestStrings "${TestStrings}")
        string(REPLACE "\";\"" ";" TestStrings "${TestStrings}")

        # Validate that a test name and tags have been provided
        list(LENGTH TestStrings TestStringsLength)
        if(TestStringsLength GREATER 2 OR TestStringsLength LESS 1)
            message(FATAL_ERROR "You must provide a valid test name and tags for all tests in ${SourceFile}")
        endif()

        # Assign name and tags
        list(GET TestStrings 0 Name)
        if("${TestType}" STREQUAL "SCENARIO")
            set(Name "Scenario: ${Name}")
        endif()
        if(PARSE_CATCH_TESTS_ADD_FIXTURE_IN_TEST_NAME AND "${TestType}" MATCHES "(CATCH_)?TEST_CASE_METHOD" AND TestFixture )
            set(CTestName "${TestFixture}:${Name}")
        else()
            set(CTestName "${Name}")
        endif()
        if(PARSE_CATCH_TESTS_ADD_TARGET_IN_TEST_NAME)
            set(CTestName "${TestTarget}:${CTestName}")
        endif()
        # add target to labels to enable running all tests added from this target
        set(Labels ${TestTarget})
        if(TestStringsLength EQUAL 2)
            list(GET TestStrings 1 Tags)
            string(TOLOWER "${Tags}" Tags)
            # remove target from labels if the test is hidden
            if("${Tags}" MATCHES ".*\\[!?(hide|\\.)\\].*")
                list(REMOVE_ITEM Labels ${TestTarget})
            endif()
            string(REPLACE "]" ";" Tags "${Tags}")
            string(REPLACE "[" "" Tags "${Tags}")
        else()
          # unset tags variable from previous loop
          unset(Tags)
        endif()

        list(APPEND Labels ${Tags})

        set(HiddenTagFound OFF)
        foreach(label ${Labels})
            string(REGEX MATCH "^!hide|^\\." result ${label})
            if(result)
                set(HiddenTagFound ON)
                break()
            endif(result)
        endforeach(label)
        if(PARSE_CATCH_TESTS_NO_HIDDEN_TESTS AND ${HiddenTagFound} AND ${CMAKE_VERSION} VERSION_LESS "3.9")
            ParseAndAddCatchTests_PrintDebugMessage("Skipping test \"${CTestName}\" as it has [!hide], [.] or [.foo] label")
        else()
            ParseAndAddCatchTests_PrintDebugMessage("Adding test \"${CTestName}\"")
            if(Labels)
                ParseAndAddCatchTests_PrintDebugMessage("Setting labels to ${Labels}")
            endif()

            # Escape commas in the test spec
            string(REPLACE "," "\\," Name ${Name})

            # Work around CMake 3.18.0 change in `add_test()`, before the escaped quotes were necessary,
            # only with CMake 3.18.0 the escaped double quotes confuse the call. This change is reverted in 3.18.1
            # And properly introduced in 3.19 with the CMP0110 policy
            if(_cmp0110_value STREQUAL "NEW" OR ${CMAKE_VERSION} VERSION_EQUAL "3.18")
                ParseAndAddCatchTests_PrintDebugMessage("CMP0110 set to NEW, no need for add_test(\"\") workaround")
            else()
                ParseAndAddCatchTests_PrintDebugMessage("CMP0110 set to OLD adding \"\" for add_test() workaround")
                set(CTestName "\"${CTestName}\"")
            endif()

            # Handle template test cases
            if("${TestTypeAndFixture}" MATCHES ".*TEMPLATE_.*")
              set(Name "${Name} - *")
            endif()

            # Add the test and set its properties
            add_test(NAME "${CTestName}" COMMAND ${OptionalCatchTestLauncher} $<TARGET_FILE:${TestTarget}> ${Name} ${AdditionalCatchParameters})
            # Old CMake versions do not document VERSION_GREATER_EQUAL, so we use VERSION_GREATER with 3.8 instead
            if(PARSE_CATCH_TESTS_NO_HIDDEN_TESTS AND ${HiddenTagFound} AND ${CMAKE_VERSION} VERSION_GREATER "3.8")
                ParseAndAddCatchTests_PrintDebugMessage("Setting DISABLED test property")
                set_tests_properties("${CTestName}" PROPERTIES DISABLED ON)
            else()
                set_tests_properties("${CTestName}" PROPERTIES FAIL_REGULAR_EXPRESSION "No tests ran"
                                                        LABELS "${Labels}")
            endif()
            set_property(
              TARGET ${TestTarget}
              APPEND
              PROPERTY ParseAndAddCatchTests_TESTS "${CTestName}")
            set_property(
              SOURCE ${SourceFile}
              APPEND
              PROPERTY ParseAndAddCatchTests_TESTS "${CTestName}")
        endif()


    endforeach()
endfunction()

# entry point
function(ParseAndAddCatchTests TestTarget)
    message(DEPRECATION "ParseAndAddCatchTest: function deprecated because of possibility of missed test cases. Consider using 'catch_discover_tests' from 'Catch.cmake'")
    ParseAndAddCatchTests_PrintDebugMessage("Started parsing ${TestTarget}")
    get_target_property(SourceFiles ${TestTarget} SOURCES)
    ParseAndAddCatchTests_PrintDebugMessage("Found the following sources: ${SourceFiles}")
    foreach(SourceFile ${SourceFiles})
        ParseAndAddCatchTests_ParseFile(${SourceFile} ${TestTarget})
    endforeach()
    ParseAndAddCatchTests_PrintDebugMessage("Finished parsing ${TestTarget}")
endfunction()

precice/precice cmake/CTestConfig.cmake :79

string(TOLOWER ${PAT_LANG_A} PAT_LANG_A)

OSGeo/PROJ CMakeLists.txt :342

string(TOLOWER "${PROJECT_NAME}" PROJECT_NAME)

OSGeo/PROJ cmake/CMakeLists.txt :3

string (TOLOWER "${PROJECT_NAME}" PROJECT_NAME_LOWER)

OSGeo/PROJ cmake/CMakeLists.txt :97

string (TOLOWER "${PROJECT_VARIANT_NAME}" PROJECT_VARIANT_LOWER)

qtwebkit/qtwebkit CMakeLists.txt :56

string(TOLOWER ${PORT} WEBKIT_PORT_DIR)

qtwebkit/qtwebkit Source/ThirdParty/libwebrtc/Source/third_party/gflags/src/CMakeLists.txt :307

string (TOLOWER "${TYPE}" type)

ossia/score cmake/ScoreExternalAddon.developer.cmake :133

string(TOLOWER "${_lib}" _lib_lc)

simdjson/simdjson cmake/simdjson-props.cmake :14

string(TOLOWER "${value}" value)

SOCI/soci src/backends/CMakeLists.txt :16

string(TOLOWER "${CURRENT_BACKEND}" CURRENT_BACKEND_LOWER)

ThePhD/sol2 cmake/Packages/FindLuaBuild.cmake :59

STRING(TOLOWER ${LUA_BUILD_LIBNAME} LUA_BUILD_NORMALIZED_LIBNAME)

LLNL/sundials cmake/SundialsSetupTesting.cmake :105

string(TOLOWER "${precision}" precision_)

apple/swift CMakeLists.txt :1135

string(TOLOWER "${elt_package}" elt_package)

apple/swift cmake/modules/SwiftConfigureSDK.cmake :293

string(TOLOWER ${name} platform)

apple/swift cmake/modules/SwiftConfigureSDK.cmake :500

string(TOLOWER ${name} platform)

texus/TGUI cmake/Dependencies.cmake :25

string(TOLOWER ${component} lowercase_component)

fallahn/tmxlite SFML3Example/SFMLExample/cmake/modules/FindSFML.cmake :121

string(TOLOWER ${FIND_SFML_COMPONENT} FIND_SFML_COMPONENT_LOWER)

transmission/transmission CMakeLists.txt :721

string(TOLOWER "${CACHE_ID}" CACHE_ID)

trilinos/Trilinos commonTools/build_stats/BuildStatsWrappers.cmake :340

string(TOLOWER "${op_name}" op_lc)