mirror of
https://github.com/Kitware/CMake.git
synced 2026-08-12 22:17:06 +00:00
Xcode: Propagate add_custom_command COMMENT to generated projects
Propagate the COMMENT section of add_custom_command(OUTPUT) as Xcode Build Phase, if present. Otherwise fallback to the current behavior Fixes: #27910
This commit is contained in:
@@ -0,0 +1,18 @@
|
||||
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()
|
||||
Reference in New Issue
Block a user