diff options
author | Stephen Kelly <steveire@gmail.com> | 2013-10-30 12:21:53 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2013-11-02 16:48:48 (GMT) |
commit | 0e06788c0a5bd2a85db4b1559d13ead30ea5be0e (patch) | |
tree | ebdf63c31cb456484df386abfeb9ab2296e1463e /Tests/CMakeCommands/target_link_libraries | |
parent | c0f4a6107412dc7bdbd810b86407016af723cb79 (diff) | |
download | CMake-0e06788c0a5bd2a85db4b1559d13ead30ea5be0e.zip CMake-0e06788c0a5bd2a85db4b1559d13ead30ea5be0e.tar.gz CMake-0e06788c0a5bd2a85db4b1559d13ead30ea5be0e.tar.bz2 |
CMP0022: Add test for target_link_libraries plain signature
Diffstat (limited to 'Tests/CMakeCommands/target_link_libraries')
6 files changed, 56 insertions, 0 deletions
diff --git a/Tests/CMakeCommands/target_link_libraries/cmp0022/CMakeLists.txt b/Tests/CMakeCommands/target_link_libraries/cmp0022/CMakeLists.txt index 33757b6..818b8c9 100644 --- a/Tests/CMakeCommands/target_link_libraries/cmp0022/CMakeLists.txt +++ b/Tests/CMakeCommands/target_link_libraries/cmp0022/CMakeLists.txt @@ -28,3 +28,10 @@ endif() add_executable(staticlib_exe staticlib_exe.cpp) target_link_libraries(staticlib_exe staticlib1) + +add_library(onlyplainlib1 SHARED onlyplainlib1.cpp) +add_library(onlyplainlib2 SHARED onlyplainlib2.cpp) +target_link_libraries(onlyplainlib2 onlyplainlib1) + +add_executable(onlyplainlib_user onlyplainlib_user.cpp) +target_link_libraries(onlyplainlib_user onlyplainlib2) diff --git a/Tests/CMakeCommands/target_link_libraries/cmp0022/onlyplainlib1.cpp b/Tests/CMakeCommands/target_link_libraries/cmp0022/onlyplainlib1.cpp new file mode 100644 index 0000000..41dc3ce --- /dev/null +++ b/Tests/CMakeCommands/target_link_libraries/cmp0022/onlyplainlib1.cpp @@ -0,0 +1,13 @@ + +#include "onlyplainlib1.h" + +OnlyPlainLib1::OnlyPlainLib1() + : result(0) +{ + +} + +int OnlyPlainLib1::GetResult() +{ + return result; +} diff --git a/Tests/CMakeCommands/target_link_libraries/cmp0022/onlyplainlib1.h b/Tests/CMakeCommands/target_link_libraries/cmp0022/onlyplainlib1.h new file mode 100644 index 0000000..c0373ce --- /dev/null +++ b/Tests/CMakeCommands/target_link_libraries/cmp0022/onlyplainlib1.h @@ -0,0 +1,14 @@ + +struct +#ifdef _WIN32 +__declspec(dllexport) +#endif +OnlyPlainLib1 +{ + OnlyPlainLib1(); + + int GetResult(); + +private: + int result; +}; diff --git a/Tests/CMakeCommands/target_link_libraries/cmp0022/onlyplainlib2.cpp b/Tests/CMakeCommands/target_link_libraries/cmp0022/onlyplainlib2.cpp new file mode 100644 index 0000000..2865ae9 --- /dev/null +++ b/Tests/CMakeCommands/target_link_libraries/cmp0022/onlyplainlib2.cpp @@ -0,0 +1,8 @@ + +#include "onlyplainlib2.h" + +OnlyPlainLib1 onlyPlainLib2() +{ + OnlyPlainLib1 opl1; + return opl1; +} diff --git a/Tests/CMakeCommands/target_link_libraries/cmp0022/onlyplainlib2.h b/Tests/CMakeCommands/target_link_libraries/cmp0022/onlyplainlib2.h new file mode 100644 index 0000000..74b18a0 --- /dev/null +++ b/Tests/CMakeCommands/target_link_libraries/cmp0022/onlyplainlib2.h @@ -0,0 +1,7 @@ + +#include "onlyplainlib1.h" + +#ifdef _WIN32 +__declspec(dllexport) +#endif +OnlyPlainLib1 onlyPlainLib2(); diff --git a/Tests/CMakeCommands/target_link_libraries/cmp0022/onlyplainlib_user.cpp b/Tests/CMakeCommands/target_link_libraries/cmp0022/onlyplainlib_user.cpp new file mode 100644 index 0000000..0fb7b0a --- /dev/null +++ b/Tests/CMakeCommands/target_link_libraries/cmp0022/onlyplainlib_user.cpp @@ -0,0 +1,7 @@ + +#include "onlyplainlib2.h" + +int main(int argc, char **argv) +{ + return onlyPlainLib2().GetResult(); +} |