mirror of
https://github.com/Kitware/CMake.git
synced 2026-02-14 02:59:53 -06:00
See https://github.com/codespell-project/codespell#readme The following command was used: ``` codespell -q6 --skip="\ .git,\ *.json,\ ./Copyright.txt,\ ./Help/command/foreach.rst,\ ./Help/prop_test/REQUIRED_FILES.rst,\ ./Help/variable/CTEST_COVERAGE_COMMAND.rst,\ ./Modules/CMakeCheckCompilerFlagCommonPatterns.cmake,\ ./Modules/CMakeRCInformation.cmake,\ ./Modules/Internal/CPack/NSIS.template.in,\ ./Modules/FindMatlab.cmake,\ ./Modules/MatlabTestsRedirect.cmake,\ ./Modules/Platform/Windows-Clang.cmake,\ ./Modules/Platform/Windows-Intel-Fortran.cmake,\ ./Modules/Platform/Windows-MSVC.cmake,\ ./Source/CMakeVersion.cmake,\ ./Source/cmConvertMSBuildXMLToJSON.py,\ ./Source/cmCreateTestSourceList.cxx,\ ./Source/cmGlobalVisualStudio10Generator.cxx,\ ./Source/cmExportBuildFileGenerator.cxx,\ ./Source/cmExportInstallAndroidMKGenerator.cxx,\ ./Source/cmExportInstallFileGenerator.cxx,\ ./Source/cmExportSet.cxx,\ ./Source/cmExportTryCompileFileGenerator.cxx,\ ./Source/cmFindPackageCommand.cxx,\ ./Source/cmInstallCommand.cxx,\ ./Source/cmGeneratorExpressionLexer.cxx,\ ./Source/cmLocalVisualStudio7Generator.cxx,\ ./Source/cmOrderDirectories.cxx,\ ./Source/cmTarget.cxx,\ ./Source/kwsys/*,\ ./Source/QtDialog/CMakeSetupDialog.ui,\ ./Source/CPack/WiX/cmWIXRichTextFormatWriter.cxx,\ ./Source/CTest/cmParseCoberturaCoverage.h,\ ./Tests/CMakeTests/ImplicitLinkInfoTest.cmake.in,\ ./Tests/RunCMake/CPack/tests/DMG_SLA/English.license.rtf,\ ./Tests/RunCMake/CPack/tests/DMG_SLA/German.license.txt,\ ./Tests/RunCMake/CPack/tests/DMG_SLA/German.menu.txt,\ ./Tests/RunCMake/GoogleTest/xml_output.cpp,\ ./Tests/RunCMake/Make/TargetMessages*,\ ./Utilities/*,\ " \ -L "\ dependees,\ endwhile,\ fo,\ filetest,\ helpfull,\ nd,\ objext,\ stoll,\ supercedes,\ superceded,\ vas,\ varn,\ " ```
31 lines
892 B
CMake
31 lines
892 B
CMake
function(checkPackageURL FILE TAG EXPECTED_URL)
|
|
getPackageInfo("${FILE}" "_file_info")
|
|
string(REPLACE "\n" ";" _file_info "${_file_info}")
|
|
|
|
set(_seen_url FALSE)
|
|
foreach(_line IN LISTS _file_info)
|
|
if(_line MATCHES "${TAG}: (.*)")
|
|
set(_seen_url TRUE)
|
|
if(NOT CMAKE_MATCH_1 STREQUAL EXPECTED_URL)
|
|
message(FATAL_ERROR "Unexpected `Homepage` URL: `${CMAKE_MATCH_1}` != `${EXPECTED_URL}`")
|
|
endif()
|
|
break()
|
|
endif()
|
|
endforeach()
|
|
if(NOT _seen_url)
|
|
message(FATAL_ERROR "The package `${FILE}` do not have URL as expected")
|
|
endif()
|
|
endfunction()
|
|
|
|
if(GENERATOR_TYPE STREQUAL DEB)
|
|
set(_tag " Homepage") # NOTE The leading space
|
|
elseif(GENERATOR_TYPE STREQUAL RPM)
|
|
set(_tag "URL.*")
|
|
else()
|
|
message(FATAL_ERROR "Unexpected CPack generator")
|
|
endif()
|
|
|
|
checkPackageURL("${FOUND_FILE_1}" "${_tag}" "https://meta.test.info")
|
|
|
|
# kate: indent-width 2;
|