diff options
author | Andy Cedilnik <andy.cedilnik@kitware.com> | 2006-03-28 08:54:01 -0500 |
---|---|---|
committer | Andy Cedilnik <andy.cedilnik@kitware.com> | 2006-03-28 08:54:01 -0500 |
commit | 40272a16bd99b2a099cb3ef910f6d70c7c3a6f65 (patch) | |
tree | 3834eae44422f7342369ae285f2daa99e66eb0bc /Tests/BundleTest | |
parent | 5d722df21f76087d80603b1df3a6be628c3e1693 (diff) | |
download | cmake-40272a16bd99b2a099cb3ef910f6d70c7c3a6f65.tar.gz |
ENH: Add support for adding content to bundles
Diffstat (limited to 'Tests/BundleTest')
-rw-r--r-- | Tests/BundleTest/CMakeLists.txt | 29 | ||||
-rw-r--r-- | Tests/BundleTest/SomeRandomFile.txt | 0 | ||||
-rw-r--r-- | Tests/BundleTest/randomResourceFile.plist.in | 9 |
3 files changed, 37 insertions, 1 deletions
diff --git a/Tests/BundleTest/CMakeLists.txt b/Tests/BundleTest/CMakeLists.txt index 9e8cb2045e..1e905664b4 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 0000000000..e69de29bb2 --- /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 0000000000..cfe3222b68 --- /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> + |