Skip to content

Commit 2e759a8

Browse files
committed
initial commit
0 parents  commit 2e759a8

File tree

3 files changed

+41
-0
lines changed

3 files changed

+41
-0
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
/build*

CMakeLists.txt

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
cmake_minimum_required(VERSION 3.14 FATAL_ERROR)
2+
3+
# ---- Project ----
4+
5+
project(Playground LANGUAGES CXX)
6+
7+
# ---- Fetch CPM ----
8+
9+
set(CPM_DOWNLOAD_LOCATION "${CMAKE_BINARY_DIR}/cmake/CPM.cmake")
10+
set(CPM_VERSION 0.18)
11+
12+
if(NOT EXISTS ${CPM_DOWNLOAD_LOCATION})
13+
message(STATUS "Downloading CPM.cmake")
14+
file(DOWNLOAD https://github.com/TheLartians/CPM.cmake/releases/download/v${CPM_VERSION}/CPM.cmake ${CPM_DOWNLOAD_LOCATION})
15+
endif(NOT EXISTS ${CPM_DOWNLOAD_LOCATION})
16+
17+
include(${CPM_DOWNLOAD_LOCATION})
18+
19+
# ---- Add dependencies via CPM ----
20+
21+
CPMAddPackage(
22+
NAME Greeter
23+
GITHUB_REPOSITORY TheLartians/ModernCppStarter
24+
VERSION 0.9
25+
)
26+
27+
# ---- Create executable ----
28+
29+
add_executable(Playground main.cpp)
30+
set_target_properties(Playground PROPERTIES CXX_STANDARD 17)
31+
32+
target_link_libraries(Playground Greeter)

main.cpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
#include <iostream>
2+
#include <greeter.h>
3+
4+
int main() {
5+
greeter::Greeter greeter("World");
6+
std::cout << greeter.greet() << std::endl;
7+
return 0;
8+
}

0 commit comments

Comments
 (0)