diff --git a/CMakeLists.txt b/CMakeLists.txt index e16b91a..b313eb9 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -20,8 +20,20 @@ set(GLFW_BUILD_DOCS OFF CACHE BOOL "" FORCE) set(GLFW_BUILD_TESTS OFF CACHE BOOL "" FORCE) set(GLFW_BUILD_EXAMPLES OFF CACHE BOOL "" FORCE) -add_library(NBEvents ./src/NBEvents/Events.cpp) +set(BUILD_TESTS) -add_subdirectory(./src/NBCoreUtils) -add_subdirectory(./src/NBWindow ./NBWindows) -add_subdirectory(./tests ./tests) \ No newline at end of file +if (BUILD_TESTS) + include(FetchContent) + FetchContent_Declare( + gtest + URL https://github.com/google/googletest/archive/refs/tags/release-1.12.1.zip + ) + if (WIN32) + set(gtest_force_shared_crt ON CACHE BOOL "" FORCE) + FetchContent_MakeAvailable(gtest) + endif() + include(GoogleTest) + set(GTEST_COLOR ON) +endif() + +add_subdirectory(./engine) diff --git a/engine/CMakeLists.txt b/engine/CMakeLists.txt new file mode 100644 index 0000000..0dd808e --- /dev/null +++ b/engine/CMakeLists.txt @@ -0,0 +1,3 @@ +add_subdirectory(./NBCoreUtils) +add_subdirectory(./NBEvents) +add_subdirectory(./NBWindow) \ No newline at end of file diff --git a/engine/NBCoreUtils/CMakeLists.txt b/engine/NBCoreUtils/CMakeLists.txt new file mode 100644 index 0000000..efd9e30 --- /dev/null +++ b/engine/NBCoreUtils/CMakeLists.txt @@ -0,0 +1,7 @@ +include_directories(./.) + +add_library(NBCore + ./src/Errors.cpp +) + +add_subdirectory(./tests) \ No newline at end of file diff --git a/include/DataSink.hpp b/engine/NBCoreUtils/DataSink.hpp similarity index 100% rename from include/DataSink.hpp rename to engine/NBCoreUtils/DataSink.hpp diff --git a/include/Errors.hpp b/engine/NBCoreUtils/Errors.hpp similarity index 100% rename from include/Errors.hpp rename to engine/NBCoreUtils/Errors.hpp diff --git a/include/Logger.hpp b/engine/NBCoreUtils/Logger.hpp similarity index 100% rename from include/Logger.hpp rename to engine/NBCoreUtils/Logger.hpp diff --git a/include/SmartStreams.hpp b/engine/NBCoreUtils/SmartStreams.hpp similarity index 100% rename from include/SmartStreams.hpp rename to engine/NBCoreUtils/SmartStreams.hpp diff --git a/include/ThreadsafeQueue.hpp b/engine/NBCoreUtils/ThreadsafeQueue.hpp similarity index 100% rename from include/ThreadsafeQueue.hpp rename to engine/NBCoreUtils/ThreadsafeQueue.hpp diff --git a/src/NBCoreUtils/Errors.cpp b/engine/NBCoreUtils/src/Errors.cpp similarity index 100% rename from src/NBCoreUtils/Errors.cpp rename to engine/NBCoreUtils/src/Errors.cpp diff --git a/engine/NBCoreUtils/tests/CMakeLists.txt b/engine/NBCoreUtils/tests/CMakeLists.txt new file mode 100644 index 0000000..6536cab --- /dev/null +++ b/engine/NBCoreUtils/tests/CMakeLists.txt @@ -0,0 +1,5 @@ +cmake_minimum_required(VERSION 3.26.0) +project(gtest_Graphics VERSION 0.1.0 LANGUAGES C CXX) + +add_subdirectory(./ErrorTest) +add_subdirectory(./SmartStreamTest) \ No newline at end of file diff --git a/tests/ErrorTest/CMakeLists.txt b/engine/NBCoreUtils/tests/ErrorTest/CMakeLists.txt similarity index 100% rename from tests/ErrorTest/CMakeLists.txt rename to engine/NBCoreUtils/tests/ErrorTest/CMakeLists.txt diff --git a/tests/ErrorTest/main.cpp b/engine/NBCoreUtils/tests/ErrorTest/main.cpp similarity index 100% rename from tests/ErrorTest/main.cpp rename to engine/NBCoreUtils/tests/ErrorTest/main.cpp diff --git a/tests/SmartStreamTest/CMakeLists.txt b/engine/NBCoreUtils/tests/SmartStreamTest/CMakeLists.txt similarity index 100% rename from tests/SmartStreamTest/CMakeLists.txt rename to engine/NBCoreUtils/tests/SmartStreamTest/CMakeLists.txt diff --git a/tests/SmartStreamTest/main.cpp b/engine/NBCoreUtils/tests/SmartStreamTest/main.cpp similarity index 100% rename from tests/SmartStreamTest/main.cpp rename to engine/NBCoreUtils/tests/SmartStreamTest/main.cpp diff --git a/engine/NBEvents/CMakeLists.txt b/engine/NBEvents/CMakeLists.txt new file mode 100644 index 0000000..9bc882a --- /dev/null +++ b/engine/NBEvents/CMakeLists.txt @@ -0,0 +1,5 @@ +include_directories(./.) + +add_library(NBEvents + ./src/Events.cpp +) \ No newline at end of file diff --git a/include/Events.h b/engine/NBEvents/Events.h similarity index 100% rename from include/Events.h rename to engine/NBEvents/Events.h diff --git a/src/NBEvents/Events.cpp b/engine/NBEvents/src/Events.cpp similarity index 100% rename from src/NBEvents/Events.cpp rename to engine/NBEvents/src/Events.cpp diff --git a/engine/NBWindow/CMakeLists.txt b/engine/NBWindow/CMakeLists.txt new file mode 100644 index 0000000..a500676 --- /dev/null +++ b/engine/NBWindow/CMakeLists.txt @@ -0,0 +1,8 @@ +include_directories(./.) + + +add_library(NBWindow + ./src/Window.cpp + ./../../../glad/src/glad.c +) +target_link_libraries(NBWindow glfw) diff --git a/include/GLLoad.h b/engine/NBWindow/GLLoad.h similarity index 100% rename from include/GLLoad.h rename to engine/NBWindow/GLLoad.h diff --git a/include/Window.h b/engine/NBWindow/Window.h similarity index 100% rename from include/Window.h rename to engine/NBWindow/Window.h diff --git a/src/NBWindow/Window.cpp b/engine/NBWindow/src/Window.cpp similarity index 100% rename from src/NBWindow/Window.cpp rename to engine/NBWindow/src/Window.cpp diff --git a/src/NBCoreUtils/CMakeLists.txt b/src/NBCoreUtils/CMakeLists.txt deleted file mode 100644 index c7b8376..0000000 --- a/src/NBCoreUtils/CMakeLists.txt +++ /dev/null @@ -1,3 +0,0 @@ -add_library(NBCore - Errors.cpp -) \ No newline at end of file diff --git a/src/NBEvents/CMakeLists.txt b/src/NBEvents/CMakeLists.txt deleted file mode 100644 index e69de29..0000000 diff --git a/src/NBWindow/CMakeLists.txt b/src/NBWindow/CMakeLists.txt deleted file mode 100644 index b3e5648..0000000 --- a/src/NBWindow/CMakeLists.txt +++ /dev/null @@ -1,3 +0,0 @@ - -add_library(NBWindow Window.cpp ./../../../glad/src/glad.c) -target_link_libraries(NBWindow glfw) diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt deleted file mode 100644 index 9c349e2..0000000 --- a/tests/CMakeLists.txt +++ /dev/null @@ -1,17 +0,0 @@ -cmake_minimum_required(VERSION 3.26.0) -project(gtest_Graphics VERSION 0.1.0 LANGUAGES C CXX) - -include(FetchContent) -FetchContent_Declare( - gtest - URL https://github.com/google/googletest/archive/refs/tags/release-1.12.1.zip -) -if (WIN32) - set(gtest_force_shared_crt ON CACHE BOOL "" FORCE) - FetchContent_MakeAvailable(gtest) -endif() -include(GoogleTest) -set(GTEST_COLOR ON) - -add_subdirectory(./ErrorTest) -add_subdirectory(./SmartStreamTest) \ No newline at end of file