summaryrefslogtreecommitdiffstats
path: root/Tests/BundleTest
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2006-03-03 17:58:48 (GMT)
committerBrad King <brad.king@kitware.com>2006-03-03 17:58:48 (GMT)
commit93c95f1cc5207d043b4bfaa617a611d1dffc7016 (patch)
tree2fffa0b6b63b2cdf104d6425e213b076c7a84450 /Tests/BundleTest
parentea8c278cd63010f00d12ded3cdde316c5188cd01 (diff)
downloadCMake-93c95f1cc5207d043b4bfaa617a611d1dffc7016.zip
CMake-93c95f1cc5207d043b4bfaa617a611d1dffc7016.tar.gz
CMake-93c95f1cc5207d043b4bfaa617a611d1dffc7016.tar.bz2
BUG: Fixed installation of MacOSX Bundle executables and the corresponding install_name remapping support. Extended the BundleTest test to check that this all works. Part of these fixes required changing the signature of AppendDirectoryForConfig in all generators. It now accepts prefix and suffix strings to deal with whether leading or trailing slashes should be included with the configuration subdirectory.
Diffstat (limited to 'Tests/BundleTest')
-rw-r--r--Tests/BundleTest/BundleLib.cxx1
-rw-r--r--Tests/BundleTest/BundleTest.cxx4
-rw-r--r--Tests/BundleTest/CMakeLists.txt22
3 files changed, 26 insertions, 1 deletions
diff --git a/Tests/BundleTest/BundleLib.cxx b/Tests/BundleTest/BundleLib.cxx
new file mode 100644
index 0000000..9fe07f8
--- /dev/null
+++ b/Tests/BundleTest/BundleLib.cxx
@@ -0,0 +1 @@
+int foo() { return 0; }
diff --git a/Tests/BundleTest/BundleTest.cxx b/Tests/BundleTest/BundleTest.cxx
index 59c0f1e..c879be1 100644
--- a/Tests/BundleTest/BundleTest.cxx
+++ b/Tests/BundleTest/BundleTest.cxx
@@ -1,4 +1,6 @@
+extern int foo();
+
int main()
{
-return 0;
+ return foo();
}
diff --git a/Tests/BundleTest/CMakeLists.txt b/Tests/BundleTest/CMakeLists.txt
index dcc6798..4bab24e 100644
--- a/Tests/BundleTest/CMakeLists.txt
+++ b/Tests/BundleTest/CMakeLists.txt
@@ -1,4 +1,26 @@
PROJECT(BundleTest)
SET(MACOSX_BUNDLE_INFO_STRING "bundle_info_string")
+
+# Test building a bundle linking to a shared library.
+ADD_LIBRARY(BundleTestLib SHARED BundleLib.cxx)
ADD_EXECUTABLE(BundleTest MACOSX_BUNDLE BundleTest.cxx)
+TARGET_LINK_LIBRARIES(BundleTest BundleTestLib)
+
+# Test bundle installation.
+INSTALL(TARGETS BundleTestLib DESTINATION Application/BundleTestExe.app/Contents/Plugins)
+INSTALL(TARGETS BundleTest DESTINATION Application)
+
+# Test whether bundles respect the output name. Since the library is
+# installed into a location that uses this output name this will fail if the
+# 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(BundleTest PROPERTIES OUTPUT_NAME BundleTestExe)
+
+# Test executable versioning if it is supported.
+IF(NOT XCODE)
+ SET_TARGET_PROPERTIES(BundleTest PROPERTIES VERSION 1)
+ENDIF(NOT XCODE)
+# Make sure the executable can find its installed library.
+SET_TARGET_PROPERTIES(BundleTestLib PROPERTIES
+ INSTALL_NAME_DIR "@executable_path/../Plugins")