-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
a9be5d2
commit ffa7f90
Showing
7 changed files
with
45 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
cmake_minimum_required(VERSION 3.12) | ||
|
||
project(HelloWorldProject VERSION 1.0.0) | ||
|
||
add_subdirectory(libs) | ||
add_subdirectory(app) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
add_executable(HelloApp main.cpp) | ||
|
||
target_link_libraries(HelloApp PRIVATE HelloLibrary) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
#include <iostream> | ||
#include <hello/hello-library.hpp> | ||
|
||
int main() | ||
{ | ||
HelloLibrary::showHello(); | ||
return 0; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
* | ||
!.gitignore |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
#include "hello-library.hpp" | ||
#include <iostream> | ||
|
||
void HelloLibrary::showHello() | ||
{ | ||
std::cout<<"Hello world version: "<<HELLO_VERSION<<std::endl; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
#ifndef HELLO_LIBRARY_HPP | ||
#define HELLO_LIBRARY_HPP 1 | ||
|
||
namespace HelloLibrary | ||
{ | ||
void showHello(); | ||
} | ||
|
||
#endif |