mirror of
https://github.com/Kitware/CMake.git
synced 2026-08-09 17:18:18 +00:00
Propagate the COMMENT section of add_custom_command(OUTPUT) as Xcode Build Phase, if present. Otherwise fallback to the current behavior Fixes: #27910
19 lines
576 B
CMake
19 lines
576 B
CMake
set(xcProjectFile "${RunCMake_TEST_BINARY_DIR}/XcodeCustomCommandComment.xcodeproj/project.pbxproj")
|
|
if(NOT EXISTS "${xcProjectFile}")
|
|
set(RunCMake_TEST_FAILED "Project file ${xcProjectFile} does not exist.")
|
|
return()
|
|
endif()
|
|
|
|
set(foundComment 0)
|
|
file(STRINGS "${xcProjectFile}" lines)
|
|
foreach(line IN LISTS lines)
|
|
if(line MATCHES [[name = "My Custom Command Build Phase Name Debug";]])
|
|
set(foundComment 1)
|
|
break()
|
|
endif()
|
|
endforeach()
|
|
|
|
if(NOT foundComment)
|
|
set(RunCMake_TEST_FAILED "Did not find expected custom command comment in project.pbxproj")
|
|
endif()
|