diff options
author | Brad King <brad.king@kitware.com> | 2013-10-21 13:48:04 (GMT) |
---|---|---|
committer | CMake Topic Stage <kwrobot@kitware.com> | 2013-10-21 13:48:04 (GMT) |
commit | bf02e750796c6b42b0e9d39ba322cd5191489a0e (patch) | |
tree | 53a4ff8a20cfa3603d8b1da3acfa4a14b6e4a969 /Tests | |
parent | 6d1444feacb1c2d621b776ac61412f92ff0a1c34 (diff) | |
parent | b04f3b9a2a116b1956d5342637cda1348a5ee07b (diff) | |
download | CMake-bf02e750796c6b42b0e9d39ba322cd5191489a0e.zip CMake-bf02e750796c6b42b0e9d39ba322cd5191489a0e.tar.gz CMake-bf02e750796c6b42b0e9d39ba322cd5191489a0e.tar.bz2 |
Merge topic 'INTERFACE_LIBRARY-build-targets'
b04f3b9 Create make rules for INTERFACE_LIBRARY targets.
dba4962 Makefile: Always create clean target command
Diffstat (limited to 'Tests')
-rw-r--r-- | Tests/CMakeLists.txt | 17 | ||||
-rw-r--r-- | Tests/InterfaceBuildTargets/CMakeLists.txt | 13 | ||||
-rw-r--r-- | Tests/InterfaceBuildTargets/main.cxx | 5 | ||||
-rw-r--r-- | Tests/InterfaceBuildTargets/testlib.cxx | 5 |
4 files changed, 40 insertions, 0 deletions
diff --git a/Tests/CMakeLists.txt b/Tests/CMakeLists.txt index 2f6a456..198ce04 100644 --- a/Tests/CMakeLists.txt +++ b/Tests/CMakeLists.txt @@ -261,6 +261,23 @@ if(BUILD_TESTING) PASS_REGULAR_EXPRESSION "(file is not of required architecture|does not match cputype|not the architecture being linked)") endif() + if(CMAKE_TEST_GENERATOR MATCHES Make) + set(InterfaceBuildTargets_libname testlib) + if (CMAKE_TEST_GENERATOR MATCHES "Borland|Watcom") + set(InterfaceBuildTargets_libname testlib.lib) + endif() + add_test(InterfaceBuildTargets ${CMAKE_CTEST_COMMAND} + --build-and-test + "${CMake_SOURCE_DIR}/Tests/InterfaceBuildTargets" + "${CMake_BINARY_DIR}/Tests/InterfaceBuildTargets" + --build-two-config + ${build_generator_args} + --build-project InterfaceBuildTargets + --test-command ${CMAKE_CMAKE_COMMAND} -E touch_nocreate ${InterfaceBuildTargets_libname} + ) + list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/InterfaceBuildTargets") + endif() + list(APPEND TEST_BUILD_DIRS ${CMake_TEST_INSTALL_PREFIX}) if(NOT QT4_FOUND) diff --git a/Tests/InterfaceBuildTargets/CMakeLists.txt b/Tests/InterfaceBuildTargets/CMakeLists.txt new file mode 100644 index 0000000..a00e5d5 --- /dev/null +++ b/Tests/InterfaceBuildTargets/CMakeLists.txt @@ -0,0 +1,13 @@ +project(InterfaceBuildTargets) + +add_library(testlib EXCLUDE_FROM_ALL testlib.cxx) +set_property(TARGET testlib PROPERTY PREFIX "") +if(CMAKE_GENERATOR MATCHES "Borland|Watcom") + # These librarians add the .lib suffix anyway. + set_property(TARGET testlib PROPERTY SUFFIX ".lib") +else() + set_property(TARGET testlib PROPERTY SUFFIX "") +endif() + +add_library(iface INTERFACE) +target_link_libraries(iface INTERFACE testlib) diff --git a/Tests/InterfaceBuildTargets/main.cxx b/Tests/InterfaceBuildTargets/main.cxx new file mode 100644 index 0000000..e9ad257 --- /dev/null +++ b/Tests/InterfaceBuildTargets/main.cxx @@ -0,0 +1,5 @@ + +int main(int, char**) +{ + return 0; +} diff --git a/Tests/InterfaceBuildTargets/testlib.cxx b/Tests/InterfaceBuildTargets/testlib.cxx new file mode 100644 index 0000000..02bd6b0 --- /dev/null +++ b/Tests/InterfaceBuildTargets/testlib.cxx @@ -0,0 +1,5 @@ + +void testlib(void) +{ + +} |