diff --git a/CMakeLists.txt b/CMakeLists.txt index 78d6de5..a9adb1b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -2,3 +2,7 @@ cmake_minimum_required(VERSION 3.20) project(nf) + +add_subdirectory(NothinFancy) + +add_subdirectory(TestGame) diff --git a/NothinFancy/CMakeLists.txt b/NothinFancy/CMakeLists.txt new file mode 100644 index 0000000..ab0e7c2 --- /dev/null +++ b/NothinFancy/CMakeLists.txt @@ -0,0 +1,5 @@ +# NF library CMakeLists.txt +add_library(NothinFancy STATIC "src/Engine.cpp" "src/include/nf.h") + +# Use C++20 +set_property(TARGET NothinFancy PROPERTY CXX_STANDARD 20) diff --git a/NothinFancy/src/Engine.cpp b/NothinFancy/src/Engine.cpp new file mode 100644 index 0000000..91c9df4 --- /dev/null +++ b/NothinFancy/src/Engine.cpp @@ -0,0 +1,9 @@ +// NF startup +#include + +namespace nf { + void test() { + std::cout << "NothinFancy\n"; + std::cin.get(); + } +} diff --git a/NothinFancy/src/include/nf.h b/NothinFancy/src/include/nf.h new file mode 100644 index 0000000..7f847df --- /dev/null +++ b/NothinFancy/src/include/nf.h @@ -0,0 +1,6 @@ +// NF main public header +#pragma once + +namespace nf { + void test(); +} diff --git a/TestGame/CMakeLists.txt b/TestGame/CMakeLists.txt new file mode 100644 index 0000000..fe14112 --- /dev/null +++ b/TestGame/CMakeLists.txt @@ -0,0 +1,9 @@ +# TestGame app CMakeLists.txt +add_executable(TestGame "src/TestGame.cpp") + +# Use C++20 +set_property(TARGET TestGame PROPERTY CXX_STANDARD 20) + +# Link to NF library +target_link_libraries(TestGame NothinFancy) +target_include_directories(TestGame PUBLIC "${CMAKE_SOURCE_DIR}/NothinFancy/src/include") diff --git a/TestGame/src/TestGame.cpp b/TestGame/src/TestGame.cpp new file mode 100644 index 0000000..aeba065 --- /dev/null +++ b/TestGame/src/TestGame.cpp @@ -0,0 +1,7 @@ +// TestGame main file +#include "nf.h" + +int main(int argc, char* argv[]) { + nf::test(); + return 0; +}