CMake/project reorg

This commit is contained in:
NaifBanana 2025-12-27 03:45:07 -06:00
parent 6134a66c71
commit de686e7daa
25 changed files with 44 additions and 27 deletions

View File

@ -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)
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)

3
engine/CMakeLists.txt Normal file
View File

@ -0,0 +1,3 @@
add_subdirectory(./NBCoreUtils)
add_subdirectory(./NBEvents)
add_subdirectory(./NBWindow)

View File

@ -0,0 +1,7 @@
include_directories(./.)
add_library(NBCore
./src/Errors.cpp
)
add_subdirectory(./tests)

View File

@ -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)

View File

@ -0,0 +1,5 @@
include_directories(./.)
add_library(NBEvents
./src/Events.cpp
)

View File

@ -0,0 +1,8 @@
include_directories(./.)
add_library(NBWindow
./src/Window.cpp
./../../../glad/src/glad.c
)
target_link_libraries(NBWindow glfw)

View File

@ -1,3 +0,0 @@
add_library(NBCore
Errors.cpp
)

View File

@ -1,3 +0,0 @@
add_library(NBWindow Window.cpp ./../../../glad/src/glad.c)
target_link_libraries(NBWindow glfw)

View File

@ -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)