summaryrefslogtreecommitdiffstats
path: root/Tests/BundleTest
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2019-04-10 12:04:15 (GMT)
committerBrad King <brad.king@kitware.com>2019-04-11 14:35:14 (GMT)
commit428c1e429ffb320b64c19d3da32e0822ff1b1b8d (patch)
tree8531fbe7e3b256ed5216cf02a065a5a18673ecab /Tests/BundleTest
parentb4385d5ccc0241f8adcb012ad645d3696bcc544c (diff)
downloadCMake-428c1e429ffb320b64c19d3da32e0822ff1b1b8d.zip
CMake-428c1e429ffb320b64c19d3da32e0822ff1b1b8d.tar.gz
CMake-428c1e429ffb320b64c19d3da32e0822ff1b1b8d.tar.bz2
Xcode: Avoid mutating App Bundle targets during generation
For `MACOSX_BUNDLE` targets we generate an `Info.plist` automatically and add it to the sources presented to Xcode. Avoid mutating the original target's list of sources to achieve this. Otherwise when we generate the same target again (e.g. in a sub-project's Xcode file) it will look different than the first time and possibly break invariants. Fixes: #19114
Diffstat (limited to 'Tests/BundleTest')
-rw-r--r--Tests/BundleTest/BundleSubDir/CMakeLists.txt7
1 files changed, 7 insertions, 0 deletions
diff --git a/Tests/BundleTest/BundleSubDir/CMakeLists.txt b/Tests/BundleTest/BundleSubDir/CMakeLists.txt
index 43c366a..2f7f2c4 100644
--- a/Tests/BundleTest/BundleSubDir/CMakeLists.txt
+++ b/Tests/BundleTest/BundleSubDir/CMakeLists.txt
@@ -1,3 +1,5 @@
+project(BundleSubDir)
+
add_custom_command(
OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/randomResourceFile.plist"
COMMAND /bin/cp
@@ -34,3 +36,8 @@ install(TARGETS SecondBundle DESTINATION Applications)
# bundle does not respect the name. Also the executable will not be found by
# the test driver if this does not work.
set_target_properties(SecondBundle PROPERTIES OUTPUT_NAME SecondBundleExe)
+
+# Express one app bundle in terms of another's SOURCES to verify that
+# the generators do not expose the Info.plist of one to the other.
+add_executable(SubdirBundle1 MACOSX_BUNDLE EXCLUDE_FROM_ALL ../BundleTest.cxx)
+add_executable(SubdirBundle2 MACOSX_BUNDLE EXCLUDE_FROM_ALL $<TARGET_PROPERTY:SubdirBundle1,SOURCES>)