diff options
Diffstat (limited to 'cmake/examples')
-rw-r--r-- | cmake/examples/boost/foo.cpp | 2 | ||||
-rw-r--r-- | cmake/examples/dynamic/CMakeLists.txt | 8 | ||||
-rw-r--r-- | cmake/examples/dynamic/bar.cpp | 7 | ||||
-rw-r--r-- | cmake/examples/dynamic/baz.cpp | 7 | ||||
-rw-r--r-- | cmake/examples/dynamic/baz.hpp (renamed from cmake/examples/dynamic/bar.hpp) | 2 | ||||
-rw-r--r-- | cmake/examples/dynamic/foo.cpp | 4 | ||||
-rw-r--r-- | cmake/examples/simple/foo.cpp | 2 |
7 files changed, 16 insertions, 16 deletions
diff --git a/cmake/examples/boost/foo.cpp b/cmake/examples/boost/foo.cpp index b5db3b5..e5b7704 100644 --- a/cmake/examples/boost/foo.cpp +++ b/cmake/examples/boost/foo.cpp @@ -3,6 +3,6 @@ #include <iostream> int main(int argc, char* argv[]) { - std::cout << boost::filesystem::absolute(boost::filesystem::path{argv[0]}).string() << "\n"; + std::cout << "Hello from " << boost::filesystem::absolute(boost::filesystem::path{argv[0]}).string() << "!\n"; return 0; } 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 <iostream> - -void bar() { - std::cout << "bar\n"; -} 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 <iostream> + +void baz() { + std::cout << "baz\n"; +} diff --git a/cmake/examples/dynamic/bar.hpp b/cmake/examples/dynamic/baz.hpp index cf838ca..505a3c4 100644 --- a/cmake/examples/dynamic/bar.hpp +++ b/cmake/examples/dynamic/baz.hpp @@ -3,4 +3,4 @@ #ifdef _MSC_VER __declspec(dllexport) #endif -void bar(); +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 <bar.hpp> +#include <baz.hpp> int main() { - bar(); + baz(); return 0; } diff --git a/cmake/examples/simple/foo.cpp b/cmake/examples/simple/foo.cpp index 8b6a1d7..b9d3132 100644 --- a/cmake/examples/simple/foo.cpp +++ b/cmake/examples/simple/foo.cpp @@ -1,6 +1,6 @@ #include <iostream> int main() { - std::cout << "Hello, world!\n"; + std::cout << "foo\n"; return 0; } |