mirror of
https://github.com/Kitware/CMake.git
synced 2026-01-07 14:20:06 -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,\ " ```
37 lines
1.1 KiB
CMake
37 lines
1.1 KiB
CMake
macro(ReadPlatformToolset tgt outvar)
|
|
set(vcProjectFile "${RunCMake_TEST_BINARY_DIR}/${tgt}.vcxproj")
|
|
if(NOT EXISTS "${vcProjectFile}")
|
|
set(RunCMake_TEST_FAILED "Project file ${tgt}.vcxproj does not exist.")
|
|
return()
|
|
endif()
|
|
|
|
set(HAVE_PlatformToolset 0)
|
|
|
|
file(STRINGS "${vcProjectFile}" lines)
|
|
foreach(line IN LISTS lines)
|
|
if(line MATCHES "^ *<PlatformToolset>([^<>]+)</PlatformToolset>")
|
|
set(${outvar} "${CMAKE_MATCH_1}")
|
|
set(HAVE_PlatformToolset 1)
|
|
break()
|
|
endif()
|
|
endforeach()
|
|
|
|
if(NOT HAVE_PlatformToolset)
|
|
set(RunCMake_TEST_FAILED "Project file ${tgt}.vcxproj does not have a <PlatformToolset> field.")
|
|
return()
|
|
endif()
|
|
endmacro()
|
|
|
|
ReadPlatformToolset(NormalPlatformToolset NORMAL_TOOLSET)
|
|
ReadPlatformToolset(OverridenPlatformToolset OVERRIDEN_TOOLSET)
|
|
|
|
if (NOT "${OVERRIDEN_TOOLSET}" STREQUAL "MyCustomToolset")
|
|
set(RunCMake_TEST_FAILED "Failed to override the platform toolset")
|
|
return()
|
|
endif()
|
|
|
|
if ("${NORMAL_TOOLSET}" STREQUAL "MyCustomToolset")
|
|
set(RunCMake_TEST_FAILED "Main toolset was overridden (it shouldn't)")
|
|
return()
|
|
endif()
|