summaryrefslogtreecommitdiffstats
path: root/Tests
diff options
context:
space:
mode:
authorhalx99 <halx99@live.com>2023-07-31 01:08:10 (GMT)
committerhalx99 <halx99@live.com>2023-07-31 01:08:10 (GMT)
commite40d2cb3afe44ba3f47aecf38db7a56b8ad36a16 (patch)
tree3671ea24a98081556dc2a828c40a1a9a4fb8b728 /Tests
parentd747bc18e1010e71482478b4a9bc60c49f7e2044 (diff)
downloadCMake-e40d2cb3afe44ba3f47aecf38db7a56b8ad36a16.zip
CMake-e40d2cb3afe44ba3f47aecf38db7a56b8ad36a16.tar.gz
CMake-e40d2cb3afe44ba3f47aecf38db7a56b8ad36a16.tar.bz2
Xcode: Add embed resources support
Diffstat (limited to 'Tests')
-rw-r--r--Tests/RunCMake/XcodeProject-Embed/EmbedPlugIns-macOS-check.cmake1
-rw-r--r--Tests/RunCMake/XcodeProject-Embed/EmbedPlugIns.cmake2
-rw-r--r--Tests/RunCMake/XcodeProject-Embed/EmbedResources-iOS-check.cmake3
-rw-r--r--Tests/RunCMake/XcodeProject-Embed/EmbedResources-iOS.cmake1
-rw-r--r--Tests/RunCMake/XcodeProject-Embed/EmbedResources-macOS-check.cmake3
-rw-r--r--Tests/RunCMake/XcodeProject-Embed/EmbedResources-macOS.cmake1
-rw-r--r--Tests/RunCMake/XcodeProject-Embed/EmbedResources.cmake18
-rw-r--r--Tests/RunCMake/XcodeProject-Embed/RunCMakeTest.cmake22
8 files changed, 49 insertions, 2 deletions
diff --git a/Tests/RunCMake/XcodeProject-Embed/EmbedPlugIns-macOS-check.cmake b/Tests/RunCMake/XcodeProject-Embed/EmbedPlugIns-macOS-check.cmake
index 576be11..66db44e 100644
--- a/Tests/RunCMake/XcodeProject-Embed/EmbedPlugIns-macOS-check.cmake
+++ b/Tests/RunCMake/XcodeProject-Embed/EmbedPlugIns-macOS-check.cmake
@@ -1,4 +1,3 @@
include(${CMAKE_CURRENT_LIST_DIR}/findAttribute.cmake)
-findAttribute(${test} "RemoveHeadersOnCopy" TRUE)
findAttribute(${test} "CodeSignOnCopy" FALSE)
diff --git a/Tests/RunCMake/XcodeProject-Embed/EmbedPlugIns.cmake b/Tests/RunCMake/XcodeProject-Embed/EmbedPlugIns.cmake
index 1bd1bd0..f5c9364 100644
--- a/Tests/RunCMake/XcodeProject-Embed/EmbedPlugIns.cmake
+++ b/Tests/RunCMake/XcodeProject-Embed/EmbedPlugIns.cmake
@@ -1,4 +1,4 @@
-add_executable(plug_in MACOS_BUNDLE Empty.txt)
+add_executable(plug_in MACOSX_BUNDLE Empty.txt)
set_target_properties(plug_in PROPERTIES
LINKER_LANGUAGE CXX
XCODE_ATTRIBUTE_CODE_SIGNING_ALLOWED "NO"
diff --git a/Tests/RunCMake/XcodeProject-Embed/EmbedResources-iOS-check.cmake b/Tests/RunCMake/XcodeProject-Embed/EmbedResources-iOS-check.cmake
new file mode 100644
index 0000000..75aaa91
--- /dev/null
+++ b/Tests/RunCMake/XcodeProject-Embed/EmbedResources-iOS-check.cmake
@@ -0,0 +1,3 @@
+include(${CMAKE_CURRENT_LIST_DIR}/findAttribute.cmake)
+
+findAttribute(${test} "Embed Resources" TRUE)
diff --git a/Tests/RunCMake/XcodeProject-Embed/EmbedResources-iOS.cmake b/Tests/RunCMake/XcodeProject-Embed/EmbedResources-iOS.cmake
new file mode 100644
index 0000000..54f9fc8
--- /dev/null
+++ b/Tests/RunCMake/XcodeProject-Embed/EmbedResources-iOS.cmake
@@ -0,0 +1 @@
+include(${CMAKE_CURRENT_LIST_DIR}/EmbedResources.cmake)
diff --git a/Tests/RunCMake/XcodeProject-Embed/EmbedResources-macOS-check.cmake b/Tests/RunCMake/XcodeProject-Embed/EmbedResources-macOS-check.cmake
new file mode 100644
index 0000000..75aaa91
--- /dev/null
+++ b/Tests/RunCMake/XcodeProject-Embed/EmbedResources-macOS-check.cmake
@@ -0,0 +1,3 @@
+include(${CMAKE_CURRENT_LIST_DIR}/findAttribute.cmake)
+
+findAttribute(${test} "Embed Resources" TRUE)
diff --git a/Tests/RunCMake/XcodeProject-Embed/EmbedResources-macOS.cmake b/Tests/RunCMake/XcodeProject-Embed/EmbedResources-macOS.cmake
new file mode 100644
index 0000000..54f9fc8
--- /dev/null
+++ b/Tests/RunCMake/XcodeProject-Embed/EmbedResources-macOS.cmake
@@ -0,0 +1 @@
+include(${CMAKE_CURRENT_LIST_DIR}/EmbedResources.cmake)
diff --git a/Tests/RunCMake/XcodeProject-Embed/EmbedResources.cmake b/Tests/RunCMake/XcodeProject-Embed/EmbedResources.cmake
new file mode 100644
index 0000000..0638037
--- /dev/null
+++ b/Tests/RunCMake/XcodeProject-Embed/EmbedResources.cmake
@@ -0,0 +1,18 @@
+add_executable(app MACOSX_BUNDLE main.m)
+
+set(EMBED_RESOURCES_FOLDER ${CMAKE_BINARY_DIR}/runtime/shaders)
+
+# ensure embed resources folder exists
+if (NOT (IS_DIRECTORY ${EMBED_RESOURCES_FOLDER}))
+ file(MAKE_DIRECTORY ${EMBED_RESOURCES_FOLDER})
+endif()
+
+set_target_properties(app PROPERTIES
+ XCODE_EMBED_RESOURCES_PATH ${EMBED_RESOURCES_FOLDER}
+)
+
+set_target_properties(app PROPERTIES
+ XCODE_ATTRIBUTE_CODE_SIGNING_ALLOWED "NO"
+ XCODE_ATTRIBUTE_CODE_SIGN_IDENTITY ""
+ MACOSX_BUNDLE_GUI_IDENTIFIER "com.example.app"
+)
diff --git a/Tests/RunCMake/XcodeProject-Embed/RunCMakeTest.cmake b/Tests/RunCMake/XcodeProject-Embed/RunCMakeTest.cmake
index a7bccee..3798ddc 100644
--- a/Tests/RunCMake/XcodeProject-Embed/RunCMakeTest.cmake
+++ b/Tests/RunCMake/XcodeProject-Embed/RunCMakeTest.cmake
@@ -83,6 +83,25 @@ function(TestExtensionKitExtension platform)
)
endfunction()
+function(TestEmbedCommon what platform)
+ set(testName Embed${what}-${platform})
+ if(NOT platform STREQUAL "macOS")
+ set(RunCMake_TEST_OPTIONS -DCMAKE_SYSTEM_NAME=${platform})
+ endif()
+ set(RunCMake_TEST_NO_CLEAN 1)
+ set(RunCMake_TEST_BINARY_DIR ${RunCMake_BINARY_DIR}/${testName}-build)
+
+ file(REMOVE_RECURSE "${RunCMake_TEST_BINARY_DIR}")
+ file(MAKE_DIRECTORY "${RunCMake_TEST_BINARY_DIR}")
+
+ run_cmake(${testName})
+ run_cmake_command(${testName}-build
+ ${CMAKE_COMMAND} --build ${RunCMake_TEST_BINARY_DIR}
+ --config Debug
+ --target app
+ )
+endfunction()
+
# Isolate device tests from host architecture selection.
unset(ENV{CMAKE_OSX_ARCHITECTURES})
@@ -100,4 +119,7 @@ if(XCODE_VERSION VERSION_GREATER_EQUAL 14.1)
# defaults, which is to remove headers on copy, but not code sign.
TestAppExtension(macOS)
TestAppExtension(iOS)
+ TestEmbedCommon(Resources macOS)
+ TestEmbedCommon(Resources iOS)
+ TestEmbedCommon(PlugIns macOS)
endif()