summaryrefslogtreecommitdiffstats
path: root/Tests
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2022-09-01 13:57:58 (GMT)
committerKitware Robot <kwrobot@kitware.com>2022-09-01 13:58:16 (GMT)
commit85d29b7de1240268d8f820dd2f56a959da1ccf45 (patch)
tree567cc193b8fa6f3a59be486ac132e4256755c409 /Tests
parent3aebeb1b5539b6696c50950dd4b2c817f0da3d68 (diff)
parentf5a441a616c03739962b52fd8dd0deb48cc9083b (diff)
downloadCMake-85d29b7de1240268d8f820dd2f56a959da1ccf45.zip
CMake-85d29b7de1240268d8f820dd2f56a959da1ccf45.tar.gz
CMake-85d29b7de1240268d8f820dd2f56a959da1ccf45.tar.bz2
Merge topic 'Link-MACOSX_BUNDLE' into release-3.24
f5a441a616 Xcode: Fix erroneous MACOSX_BUNDLE link Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !7624
Diffstat (limited to 'Tests')
-rw-r--r--Tests/RunCMake/XcodeProject/BundleLinkBundle.cmake14
-rw-r--r--Tests/RunCMake/XcodeProject/RunCMakeTest.cmake10
-rw-r--r--Tests/RunCMake/XcodeProject/lib_bundle/CMakeLIsts.txt5
-rw-r--r--Tests/RunCMake/XcodeProject/lib_bundle/lib_bundle.cpp6
-rw-r--r--Tests/RunCMake/XcodeProject/main_bundle.cpp9
5 files changed, 44 insertions, 0 deletions
diff --git a/Tests/RunCMake/XcodeProject/BundleLinkBundle.cmake b/Tests/RunCMake/XcodeProject/BundleLinkBundle.cmake
new file mode 100644
index 0000000..1f3c19d
--- /dev/null
+++ b/Tests/RunCMake/XcodeProject/BundleLinkBundle.cmake
@@ -0,0 +1,14 @@
+cmake_minimum_required(VERSION 3.23)
+
+project(BundleLinkBundle CXX)
+
+add_subdirectory(lib_bundle)
+
+add_executable(MainBundle MACOSX_BUNDLE main_bundle.cpp)
+
+target_link_libraries(MainBundle PRIVATE LibBundle)
+
+set_target_properties(MainBundle PROPERTIES
+ MACOSX_BUNDLE "YES"
+ XCODE_LINK_BUILD_PHASE_MODE BUILT_ONLY
+)
diff --git a/Tests/RunCMake/XcodeProject/RunCMakeTest.cmake b/Tests/RunCMake/XcodeProject/RunCMakeTest.cmake
index 80c6b73..d20f5a6 100644
--- a/Tests/RunCMake/XcodeProject/RunCMakeTest.cmake
+++ b/Tests/RunCMake/XcodeProject/RunCMakeTest.cmake
@@ -151,6 +151,16 @@ endfunction()
XcodeXCConfig()
+function(BundleLinkBundle)
+ set(RunCMake_TEST_BINARY_DIR ${RunCMake_BINARY_DIR}/BundleLinkBundle-build)
+ run_cmake(BundleLinkBundle)
+ set(RunCMake_TEST_NO_CLEAN 1)
+ run_cmake_command(BundleLinkBundle-build ${CMAKE_COMMAND} --build .)
+endfunction()
+
+BundleLinkBundle()
+
+
# Isolate device tests from host architecture selection.
unset(ENV{CMAKE_OSX_ARCHITECTURES})
diff --git a/Tests/RunCMake/XcodeProject/lib_bundle/CMakeLIsts.txt b/Tests/RunCMake/XcodeProject/lib_bundle/CMakeLIsts.txt
new file mode 100644
index 0000000..7a50ce8
--- /dev/null
+++ b/Tests/RunCMake/XcodeProject/lib_bundle/CMakeLIsts.txt
@@ -0,0 +1,5 @@
+
+add_library(LibBundle lib_bundle.cpp)
+
+set_target_properties(LibBundle PROPERTIES
+ MACOSX_BUNDLE YES)
diff --git a/Tests/RunCMake/XcodeProject/lib_bundle/lib_bundle.cpp b/Tests/RunCMake/XcodeProject/lib_bundle/lib_bundle.cpp
new file mode 100644
index 0000000..9f74584
--- /dev/null
+++ b/Tests/RunCMake/XcodeProject/lib_bundle/lib_bundle.cpp
@@ -0,0 +1,6 @@
+#include <iostream>
+
+void foo()
+{
+ std::cout << "foobar" << std::endl;
+}
diff --git a/Tests/RunCMake/XcodeProject/main_bundle.cpp b/Tests/RunCMake/XcodeProject/main_bundle.cpp
new file mode 100644
index 0000000..11834ac
--- /dev/null
+++ b/Tests/RunCMake/XcodeProject/main_bundle.cpp
@@ -0,0 +1,9 @@
+
+extern void foo();
+
+int main()
+{
+
+ foo();
+ return 0;
+}