Skip to content

Commit 145c113

Browse files
authored
Merge pull request #673 from edymtt/prefer_plutil_to_defaults
Enhance fixup target to use plutil and get correct xctest path
2 parents 0816cf5 + a85c4ca commit 145c113

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

perftests/Xcode/PerfTests/CMakeLists.txt

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -42,11 +42,16 @@ target_link_libraries(XcodePerfTests PRIVATE
4242
# Run a custom command to fixup CMake's broken bundle CFBundleExecutable.
4343
#
4444
# http://www.cmake.org/Bug/view.php?id=15485
45+
#
46+
# It seems this is no longer an issue in Xcode 11.4/CMake 3.16.3, but leaving this
47+
# workaround in place for good measure
48+
get_target_property(xcode_perf_tests_output_directory XcodePerfTests LIBRARY_OUTPUT_DIRECTORY)
4549
add_custom_command(
46-
COMMAND defaults write ${CMAKE_CURRENT_BINARY_DIR}/XcodePerfTests.xctest/Contents/Info.plist CFBundleExecutable XcodePerfTests && touch ${CMAKE_CURRENT_BINARY_DIR}/fixup-has-run
50+
COMMAND plutil -replace CFBundleExecutable -string XcodePerfTests ${xcode_perf_tests_output_directory}/XcodePerfTests.xctest/Contents/Info.plist && touch ${CMAKE_CURRENT_BINARY_DIR}/fixup-has-run
4751
COMMENT "Fixing up XcodePerfTests.xctest CFBundleExecutable..."
48-
OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/XcodePerfTests.xctest/Contents/Info.plist)
52+
OUTPUT ${xcode_perf_tests_output_directory}/XcodePerfTests.xctest/Contents/Info.plist)
4953
add_custom_target(fixup-XcodePerfTests-bundle
5054
ALL
51-
DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/XcodePerfTests.xctest/Contents/Info.plist)
52-
55+
DEPENDS ${xcode_perf_tests_output_directory}/XcodePerfTests.xctest/Contents/Info.plist)
56+
# Declare this dependency explicitly to avoid plutil failing because Info.plist is missing
57+
add_dependencies(fixup-XcodePerfTests-bundle XcodePerfTests)

0 commit comments

Comments
 (0)