diff --git a/course/4/CMakeLists.txt b/course/4/CMakeLists.txt new file mode 100644 index 0000000..dccc9c6 --- /dev/null +++ b/course/4/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.12) + +project(HelloWorldProject VERSION 1.0.0) + +add_subdirectory(libs) +add_subdirectory(app) + diff --git a/course/4/app/CMakeLists.txt b/course/4/app/CMakeLists.txt new file mode 100644 index 0000000..1f4361c --- /dev/null +++ b/course/4/app/CMakeLists.txt @@ -0,0 +1,3 @@ +add_executable(HelloApp main.cpp) + +target_link_libraries(HelloApp PRIVATE HelloLibrary) \ No newline at end of file diff --git a/course/4/app/main.cpp b/course/4/app/main.cpp new file mode 100644 index 0000000..50cfeb3 --- /dev/null +++ b/course/4/app/main.cpp @@ -0,0 +1,8 @@ +#include +#include + +int main() +{ + HelloLibrary::showHello(); + return 0; +} \ No newline at end of file diff --git a/course/4/build/.gitignore b/course/4/build/.gitignore new file mode 100644 index 0000000..c96a04f --- /dev/null +++ b/course/4/build/.gitignore @@ -0,0 +1,2 @@ +* +!.gitignore \ No newline at end of file diff --git a/course/4/libs/CMakeLists.txt b/course/4/libs/CMakeLists.txt new file mode 100644 index 0000000..c59a476 --- /dev/null +++ b/course/4/libs/CMakeLists.txt @@ -0,0 +1,9 @@ +add_library( + HelloLibrary + "${CMAKE_CURRENT_SOURCE_DIR}/hello/hello-library.hpp" + "${CMAKE_CURRENT_SOURCE_DIR}/hello/hello-library.cpp" +) + +target_include_directories(HelloLibrary PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}") + +target_compile_definitions(HelloLibrary PRIVATE HELLO_VERSION=1.1) \ No newline at end of file diff --git a/course/4/libs/hello/hello-library.cpp b/course/4/libs/hello/hello-library.cpp new file mode 100644 index 0000000..2170cbe --- /dev/null +++ b/course/4/libs/hello/hello-library.cpp @@ -0,0 +1,7 @@ +#include "hello-library.hpp" +#include + +void HelloLibrary::showHello() +{ + std::cout<<"Hello world version: "<