From 7b46d443b0418b4b7a4b66e046a3dc28585821d0 Mon Sep 17 00:00:00 2001 From: Egor Tensin Date: Wed, 8 Jan 2020 03:32:39 +0300 Subject: cmake/examples: more distinct output --- cmake/examples/dynamic/CMakeLists.txt | 8 ++++---- cmake/examples/dynamic/bar.cpp | 7 ------- cmake/examples/dynamic/bar.hpp | 6 ------ cmake/examples/dynamic/baz.cpp | 7 +++++++ cmake/examples/dynamic/baz.hpp | 6 ++++++ cmake/examples/dynamic/foo.cpp | 4 ++-- 6 files changed, 19 insertions(+), 19 deletions(-) delete mode 100644 cmake/examples/dynamic/bar.cpp delete mode 100644 cmake/examples/dynamic/bar.hpp create mode 100644 cmake/examples/dynamic/baz.cpp create mode 100644 cmake/examples/dynamic/baz.hpp (limited to 'cmake/examples/dynamic') diff --git a/cmake/examples/dynamic/CMakeLists.txt b/cmake/examples/dynamic/CMakeLists.txt index 013cde1..1a602d6 100644 --- a/cmake/examples/dynamic/CMakeLists.txt +++ b/cmake/examples/dynamic/CMakeLists.txt @@ -4,10 +4,10 @@ project(example_dynamic) include(../../common.cmake) -add_library(bar SHARED bar.cpp) -target_include_directories(bar PUBLIC .) +add_library(baz SHARED baz.cpp) +target_include_directories(baz PUBLIC .) add_executable(foo foo.cpp) -target_link_libraries(foo PRIVATE bar) +target_link_libraries(foo PRIVATE baz) -install(TARGETS foo bar RUNTIME DESTINATION bin LIBRARY DESTINATION lib) +install(TARGETS foo baz RUNTIME DESTINATION bin LIBRARY DESTINATION lib) diff --git a/cmake/examples/dynamic/bar.cpp b/cmake/examples/dynamic/bar.cpp deleted file mode 100644 index 37aa9b5..0000000 --- a/cmake/examples/dynamic/bar.cpp +++ /dev/null @@ -1,7 +0,0 @@ -#include "bar.hpp" - -#include - -void bar() { - std::cout << "bar\n"; -} diff --git a/cmake/examples/dynamic/bar.hpp b/cmake/examples/dynamic/bar.hpp deleted file mode 100644 index cf838ca..0000000 --- a/cmake/examples/dynamic/bar.hpp +++ /dev/null @@ -1,6 +0,0 @@ -#pragma once - -#ifdef _MSC_VER -__declspec(dllexport) -#endif -void bar(); diff --git a/cmake/examples/dynamic/baz.cpp b/cmake/examples/dynamic/baz.cpp new file mode 100644 index 0000000..d108ae3 --- /dev/null +++ b/cmake/examples/dynamic/baz.cpp @@ -0,0 +1,7 @@ +#include "baz.hpp" + +#include + +void baz() { + std::cout << "baz\n"; +} diff --git a/cmake/examples/dynamic/baz.hpp b/cmake/examples/dynamic/baz.hpp new file mode 100644 index 0000000..505a3c4 --- /dev/null +++ b/cmake/examples/dynamic/baz.hpp @@ -0,0 +1,6 @@ +#pragma once + +#ifdef _MSC_VER +__declspec(dllexport) +#endif +void baz(); diff --git a/cmake/examples/dynamic/foo.cpp b/cmake/examples/dynamic/foo.cpp index c6355a2..b7d9986 100644 --- a/cmake/examples/dynamic/foo.cpp +++ b/cmake/examples/dynamic/foo.cpp @@ -1,6 +1,6 @@ -#include +#include int main() { - bar(); + baz(); return 0; } -- cgit v1.2.3