Skip to content

Commit 6a340ac

Browse files
committed
Base of CMake build scripts and client application.
1 parent c3c19f5 commit 6a340ac

File tree

4 files changed

+36
-0
lines changed

4 files changed

+36
-0
lines changed

CMakeLists.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
cmake_minimum_required(VERSION 3.0)
2+
3+
project(Snippet)
4+
5+
add_subdirectory(Source)

Source/CMakeLists.txt

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
set(CMAKE_CXX_STANDARD 17)
2+
3+
set(CMAKE_COMPILE_WARNING_AS_ERROR ON)
4+
if(MSVC)
5+
add_compile_options(/W4 /WX)
6+
else()
7+
add_compile_options(-Wall -Wextra -pedantic -Werror)
8+
endif()
9+
10+
if(BUILD_CLIENT)
11+
add_subdirectory(Client)
12+
endif()

Source/Client/CMakeLists.txt

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
set(TARGET CLIENT)
2+
3+
add_executable(${TARGET} Main.cpp)
4+
5+
set_target_properties(
6+
${TARGET}
7+
PROPERTIES
8+
RUNTIME_OUTPUT_NAME Snippet
9+
)

Source/Client/Main.cpp

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
#include <cstdio>
2+
3+
int main(int argc, char** argv)
4+
{
5+
(void)argc;
6+
(void)argv;
7+
8+
printf("Hello Snippet\n");
9+
return 0;
10+
}

0 commit comments

Comments
 (0)