summaryrefslogtreecommitdiffstats
path: root/Tests
diff options
context:
space:
mode:
authorAndy Cedilnik <andy.cedilnik@kitware.com>2006-03-28 13:54:01 (GMT)
committerAndy Cedilnik <andy.cedilnik@kitware.com>2006-03-28 13:54:01 (GMT)
commit40272a16bd99b2a099cb3ef910f6d70c7c3a6f65 (patch)
tree3834eae44422f7342369ae285f2daa99e66eb0bc /Tests
parent5d722df21f76087d80603b1df3a6be628c3e1693 (diff)
downloadCMake-40272a16bd99b2a099cb3ef910f6d70c7c3a6f65.zip
CMake-40272a16bd99b2a099cb3ef910f6d70c7c3a6f65.tar.gz
CMake-40272a16bd99b2a099cb3ef910f6d70c7c3a6f65.tar.bz2
ENH: Add support for adding content to bundles
Diffstat (limited to 'Tests')
-rw-r--r--Tests/BundleTest/CMakeLists.txt29
-rw-r--r--Tests/BundleTest/SomeRandomFile.txt0
-rw-r--r--Tests/BundleTest/randomResourceFile.plist.in9
3 files changed, 37 insertions, 1 deletions
diff --git a/Tests/BundleTest/CMakeLists.txt b/Tests/BundleTest/CMakeLists.txt
index 9e8cb20..1e90566 100644
--- a/Tests/BundleTest/CMakeLists.txt
+++ b/Tests/BundleTest/CMakeLists.txt
@@ -1,9 +1,36 @@
PROJECT(BundleTest)
SET(MACOSX_BUNDLE_INFO_STRING "bundle_info_string")
+SET(CMAKE_MacOSX_Content_COMPILE_OBJECT "\"${CMAKE_COMMAND}\" -E copy_if_different <SOURCE> <OBJECT>")
+
+ADD_CUSTOM_COMMAND(
+ OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/randomResourceFile.plist"
+ COMMAND /bin/cp
+ ARGS "${CMAKE_CURRENT_SOURCE_DIR}/randomResourceFile.plist.in"
+ "${CMAKE_CURRENT_BINARY_DIR}/randomResourceFile.plist")
+
+SET_SOURCE_FILES_PROPERTIES(
+ "${CMAKE_CURRENT_BINARY_DIR}/randomResourceFile.plist"
+ PROPERTIES
+ MACOSX_PACKAGE_LOCATION Resources
+ )
+
+SET_SOURCE_FILES_PROPERTIES(
+ SomeRandomFile.txt
+ PROPERTIES
+ MACOSX_PACKAGE_LOCATION MacOS
+ )
+
+SET(EXECUTABLE_OUTPUT_PATH "${CMAKE_CURRENT_BINARY_DIR}/foobar")
# Test building a bundle linking to a shared library.
ADD_LIBRARY(BundleTestLib SHARED BundleLib.cxx)
-ADD_EXECUTABLE(BundleTest MACOSX_BUNDLE BundleTest.cxx)
+ADD_EXECUTABLE(BundleTest
+ MACOSX_BUNDLE
+ BundleTest.cxx
+ SomeRandomFile.txt
+ "${CMAKE_CURRENT_BINARY_DIR}/randomResourceFile.plist"
+ )
+
TARGET_LINK_LIBRARIES(BundleTest BundleTestLib)
# Test bundle installation.
diff --git a/Tests/BundleTest/SomeRandomFile.txt b/Tests/BundleTest/SomeRandomFile.txt
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/Tests/BundleTest/SomeRandomFile.txt
diff --git a/Tests/BundleTest/randomResourceFile.plist.in b/Tests/BundleTest/randomResourceFile.plist.in
new file mode 100644
index 0000000..cfe3222
--- /dev/null
+++ b/Tests/BundleTest/randomResourceFile.plist.in
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+ <key>Package</key>
+ <string>CMake</string>
+</dict>
+</plist>
+