diff options
author | MyungJoo Ham <myungjoo.ham@samsung.com> | 2017-10-11 15:16:57 +0900 |
---|---|---|
committer | MyungJoo Ham <myungjoo.ham@samsung.com> | 2017-10-11 15:16:57 +0900 |
commit | 915c76ded744c0f5f151402b9fa69f3fd8452573 (patch) | |
tree | ca6a387466543248890f346847acaa8343989b22 /Tests/Framework | |
parent | 317dbdb79761ef65e45c7358cfc7571c6afa54ad (diff) | |
download | cmake-915c76ded744c0f5f151402b9fa69f3fd8452573.tar.gz cmake-915c76ded744c0f5f151402b9fa69f3fd8452573.tar.bz2 cmake-915c76ded744c0f5f151402b9fa69f3fd8452573.zip |
Imported Upstream version 3.9.4upstream/3.9.4
Diffstat (limited to 'Tests/Framework')
-rw-r--r-- | Tests/Framework/CMakeLists.txt | 52 | ||||
-rw-r--r-- | Tests/Framework/foo.cxx | 4 |
2 files changed, 31 insertions, 25 deletions
diff --git a/Tests/Framework/CMakeLists.txt b/Tests/Framework/CMakeLists.txt index 29f983810..a313c2c03 100644 --- a/Tests/Framework/CMakeLists.txt +++ b/Tests/Framework/CMakeLists.txt @@ -51,30 +51,36 @@ install(TARGETS foo bar # duplicate install rules for the pieces of the framework. ) +# test that framework post-build commands run +add_custom_command(TARGET foo POST_BUILD COMMAND ${CMAKE_COMMAND} -E touch foo-post-build) +add_custom_target(fooCustom ALL COMMAND ${CMAKE_COMMAND} -E copy foo-post-build foo-custom) +add_dependencies(fooCustom foo) + # 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. +# that everything still builds correctly. Xcode prior to version 5 does not +# support static Frameworks. # -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) +if(NOT XCODE OR NOT XCODE_VERSION VERSION_LESS 5) + 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) +endif() include(CPack) diff --git a/Tests/Framework/foo.cxx b/Tests/Framework/foo.cxx index e5c19738c..c3520c1dd 100644 --- a/Tests/Framework/foo.cxx +++ b/Tests/Framework/foo.cxx @@ -1,8 +1,8 @@ #include <stdio.h> #if defined(_WIN32) && defined(foo_EXPORTS) -# define CM_TEST_LIB_EXPORT __declspec( dllexport ) +#define CM_TEST_LIB_EXPORT __declspec(dllexport) #else -# define CM_TEST_LIB_EXPORT +#define CM_TEST_LIB_EXPORT #endif CM_TEST_LIB_EXPORT void foo() { |