summaryrefslogtreecommitdiff
path: root/Tests/Framework
diff options
context:
space:
mode:
Diffstat (limited to 'Tests/Framework')
-rw-r--r--Tests/Framework/CMakeLists.txt80
-rw-r--r--Tests/Framework/bar.cxx6
-rw-r--r--Tests/Framework/foo.cxx10
-rw-r--r--Tests/Framework/foo.h1
-rw-r--r--Tests/Framework/foo2.h1
-rw-r--r--Tests/Framework/fooBoth.h1
-rw-r--r--Tests/Framework/fooDeepPublic.h1
-rw-r--r--Tests/Framework/fooExtensionlessResource1
-rw-r--r--Tests/Framework/fooNeither.h1
-rw-r--r--Tests/Framework/fooPrivate.h1
-rw-r--r--Tests/Framework/fooPrivateExtensionlessHeader1
-rw-r--r--Tests/Framework/fooPublic.h1
-rw-r--r--Tests/Framework/fooPublicExtensionlessHeader1
-rw-r--r--Tests/Framework/test.lua1
14 files changed, 107 insertions, 0 deletions
diff --git a/Tests/Framework/CMakeLists.txt b/Tests/Framework/CMakeLists.txt
new file mode 100644
index 000000000..29f983810
--- /dev/null
+++ b/Tests/Framework/CMakeLists.txt
@@ -0,0 +1,80 @@
+cmake_minimum_required (VERSION 2.6)
+project(Framework)
+
+add_library(foo SHARED
+ foo.cxx
+ foo.h
+ foo2.h
+ fooExtensionlessResource
+ fooPublic.h
+ fooPublicExtensionlessHeader
+ fooPrivate.h
+ fooPrivateExtensionlessHeader
+ fooNeither.h
+ fooBoth.h
+ test.lua
+ fooDeepPublic.h
+)
+set_property(SOURCE fooDeepPublic.h
+ PROPERTY MACOSX_PACKAGE_LOCATION Headers/Deep
+ )
+set(foo_ver ver4)
+
+set_target_properties(foo PROPERTIES
+ FRAMEWORK TRUE
+ FRAMEWORK_VERSION ${foo_ver}
+ PRIVATE_HEADER "fooPrivate.h;fooBoth.h;fooPrivateExtensionlessHeader"
+ PUBLIC_HEADER "foo.h;foo2.h;fooPublic.h;fooBoth.h;fooPublicExtensionlessHeader"
+ RESOURCE "fooExtensionlessResource;test.lua"
+ INSTALL_NAME_DIR "@executable_path/../../../Library/Frameworks"
+ DEBUG_POSTFIX -d
+)
+# fooBoth.h is listed as both public and private... (private wins...)
+# fooNeither.h is listed as neither public nor private...
+
+add_executable(bar bar.cxx)
+target_link_libraries(bar foo)
+install(TARGETS foo bar
+ RUNTIME DESTINATION Applications/CMakeTestsFramework/bin
+ FRAMEWORK DESTINATION Library/Frameworks
+ LIBRARY DESTINATION lib
+ ARCHIVE DESTINATION lib
+
+ # These are ignored on the Mac... and things are automatically placed in
+ # their appropriate Framework sub-folder at build time. (And then the built
+ # framework is copied recursively when it is installed.)
+ PRIVATE_HEADER DESTINATION share/foo-${foo_ver}/PrivateHeaders
+ PUBLIC_HEADER DESTINATION include/foo-${foo_ver}
+ RESOURCE DESTINATION share/foo-${foo_ver}/Resources
+ # But they are required to be present so that installing a framework on other
+ # other platforms will install the pieces of the framework without having to
+ # duplicate install rules for the pieces of the framework.
+)
+
+# Make a static library and apply the framework properties to it to verify
+# that everything still builds correctly, but it will not actually produce
+# a framework... The framework properties only apply when the library type
+# is SHARED.
+#
+add_library(fooStatic STATIC
+ foo.cxx
+ foo.h
+ foo2.h
+ fooExtensionlessResource
+ fooPublic.h
+ fooPublicExtensionlessHeader
+ fooPrivate.h
+ fooPrivateExtensionlessHeader
+ fooNeither.h
+ fooBoth.h
+ test.lua
+ fooDeepPublic.h
+)
+set_target_properties(fooStatic PROPERTIES
+ FRAMEWORK TRUE
+ FRAMEWORK_VERSION none
+)
+add_executable(barStatic bar.cxx)
+target_link_libraries(barStatic fooStatic)
+
+include(CPack)
diff --git a/Tests/Framework/bar.cxx b/Tests/Framework/bar.cxx
new file mode 100644
index 000000000..37c132a0f
--- /dev/null
+++ b/Tests/Framework/bar.cxx
@@ -0,0 +1,6 @@
+void foo();
+int main()
+{
+ foo();
+ return 0;
+}
diff --git a/Tests/Framework/foo.cxx b/Tests/Framework/foo.cxx
new file mode 100644
index 000000000..b249ce348
--- /dev/null
+++ b/Tests/Framework/foo.cxx
@@ -0,0 +1,10 @@
+#include <stdio.h>
+#if defined(_WIN32) && defined(foo_EXPORTS)
+# define CM_TEST_LIB_EXPORT __declspec( dllexport )
+#else
+# define CM_TEST_LIB_EXPORT
+#endif
+CM_TEST_LIB_EXPORT void foo()
+{
+ printf("foo\n");
+}
diff --git a/Tests/Framework/foo.h b/Tests/Framework/foo.h
new file mode 100644
index 000000000..d959c813f
--- /dev/null
+++ b/Tests/Framework/foo.h
@@ -0,0 +1 @@
+fooh
diff --git a/Tests/Framework/foo2.h b/Tests/Framework/foo2.h
new file mode 100644
index 000000000..2431d7980
--- /dev/null
+++ b/Tests/Framework/foo2.h
@@ -0,0 +1 @@
+foo2h
diff --git a/Tests/Framework/fooBoth.h b/Tests/Framework/fooBoth.h
new file mode 100644
index 000000000..5a0f33095
--- /dev/null
+++ b/Tests/Framework/fooBoth.h
@@ -0,0 +1 @@
+fooBothh
diff --git a/Tests/Framework/fooDeepPublic.h b/Tests/Framework/fooDeepPublic.h
new file mode 100644
index 000000000..3fc410878
--- /dev/null
+++ b/Tests/Framework/fooDeepPublic.h
@@ -0,0 +1 @@
+fooDeepPublic
diff --git a/Tests/Framework/fooExtensionlessResource b/Tests/Framework/fooExtensionlessResource
new file mode 100644
index 000000000..5122750ee
--- /dev/null
+++ b/Tests/Framework/fooExtensionlessResource
@@ -0,0 +1 @@
+fooExtensionlessResource
diff --git a/Tests/Framework/fooNeither.h b/Tests/Framework/fooNeither.h
new file mode 100644
index 000000000..04736a1b1
--- /dev/null
+++ b/Tests/Framework/fooNeither.h
@@ -0,0 +1 @@
+fooNeitherh
diff --git a/Tests/Framework/fooPrivate.h b/Tests/Framework/fooPrivate.h
new file mode 100644
index 000000000..dc8cb34dc
--- /dev/null
+++ b/Tests/Framework/fooPrivate.h
@@ -0,0 +1 @@
+fooPrivateh
diff --git a/Tests/Framework/fooPrivateExtensionlessHeader b/Tests/Framework/fooPrivateExtensionlessHeader
new file mode 100644
index 000000000..ac97b929e
--- /dev/null
+++ b/Tests/Framework/fooPrivateExtensionlessHeader
@@ -0,0 +1 @@
+fooPrivateExtensionlessHeader
diff --git a/Tests/Framework/fooPublic.h b/Tests/Framework/fooPublic.h
new file mode 100644
index 000000000..f0469de6f
--- /dev/null
+++ b/Tests/Framework/fooPublic.h
@@ -0,0 +1 @@
+fooPublich
diff --git a/Tests/Framework/fooPublicExtensionlessHeader b/Tests/Framework/fooPublicExtensionlessHeader
new file mode 100644
index 000000000..972d9898d
--- /dev/null
+++ b/Tests/Framework/fooPublicExtensionlessHeader
@@ -0,0 +1 @@
+fooPublicExtensionlessHeader
diff --git a/Tests/Framework/test.lua b/Tests/Framework/test.lua
new file mode 100644
index 000000000..ce5c3eb84
--- /dev/null
+++ b/Tests/Framework/test.lua
@@ -0,0 +1 @@
+test.lua