mirror of
https://github.com/Kitware/CMake.git
synced 2026-05-20 14:58:38 -05:00
df58dbb0e9
Add all cmake input files to the `ZERO_CHECK` project. Place files under `CMAKE_SOURCE_DIR` in a folder structure matching the directory structure. This way they are easier to find, and Visual Studio does not close them when reloading the project. Fixes: #24557
26 lines
821 B
CMake
26 lines
821 B
CMake
set(vcProjectFile "${RunCMake_TEST_BINARY_DIR}/ZERO_CHECK.vcxproj")
|
|
if(NOT EXISTS "${vcProjectFile}")
|
|
set(RunCMake_TEST_FAILED "Project file ${vcProjectFile} does not exist.")
|
|
return()
|
|
endif()
|
|
|
|
set(found_CMakeInputs 0)
|
|
file(STRINGS "${vcProjectFile}" lines)
|
|
foreach(line IN LISTS lines)
|
|
if(line MATCHES "<([A-Za-z0-9_]+) +Include=.*CMakeInputs.cmake")
|
|
set(rule "${CMAKE_MATCH_1}")
|
|
if(NOT rule STREQUAL "None")
|
|
set(RunCMake_TEST_FAILED "CMakeInputs.cmake referenced as ${rule} instead of None")
|
|
return()
|
|
endif()
|
|
if(found_CMakeInputs)
|
|
set(RunCMake_TEST_FAILED "CMakeInputs.cmake referenced multiple times")
|
|
return()
|
|
endif()
|
|
set(found_CMakeInputs 1)
|
|
endif()
|
|
endforeach()
|
|
if(NOT found_CMakeInputs)
|
|
set(RunCMake_TEST_FAILED "CMakeInputs.cmake not referenced")
|
|
endif()
|