Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 7 additions & 6 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ else()
endif()

add_subdirectory(third_party/tracy)
add_subdirectory(lib lib)
add_subdirectory(scene scene)
add_subdirectory(linalg linalg)
add_subdirectory(gl_render gl_render)

Expand All @@ -36,7 +36,7 @@ add_executable(native index.cpp events.cpp)
target_link_libraries(native PRIVATE
linalg
gl_render
lib
scene
SDL3::SDL3
${OPENGL_LIBRARIES}
Tracy::TracyClient
Expand All @@ -46,18 +46,19 @@ target_link_libraries(native PRIVATE
target_include_directories(native PUBLIC include)


# shaders copy on configure
# assets copy on configure
file(COPY assets DESTINATION ${CMAKE_BINARY_DIR}) # only runs on configure

# shaders copy on configure
add_custom_command(
TARGET native POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy_directory
${CMAKE_SOURCE_DIR}/lib/shaders ${CMAKE_BINARY_DIR}/shaders
${CMAKE_SOURCE_DIR}/gl_render/shaders ${CMAKE_BINARY_DIR}/shaders
COMMENT "Copying shaders to build directory" VERBATIM
)


######################## tests ##############
####################### tests ##############


# executable
Expand All @@ -71,7 +72,7 @@ add_executable(tests

target_link_libraries(tests PRIVATE
linalg
lib
scene
)

target_include_directories(tests PUBLIC tests/include)
Expand Down
4 changes: 2 additions & 2 deletions gl_render/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ project(GlRenderer)
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)

find_package(OpenGL REQUIRED)
add_subdirectory(../lib lib)
add_subdirectory(../scene scene)

add_library(gl_render SHARED
basic_color_render_program.cpp
Expand All @@ -15,5 +15,5 @@ add_library(gl_render SHARED
)

target_include_directories(gl_render PUBLIC include)
target_link_libraries(gl_render PUBLIC lib)
target_link_libraries(gl_render PUBLIC scene)

File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
8 changes: 4 additions & 4 deletions lib/CMakeLists.txt → scene/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
include_guard(GLOBAL)
cmake_minimum_required(VERSION 3.24)
project(NativeRendererLib)
project(3DScene)

set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
set (CMAKE_CXX_STANDARD 20)
Expand All @@ -21,7 +21,7 @@ add_subdirectory(../third_party/assimp assimp)
add_subdirectory(../linalg linalg)

# lib (include is for templates)
add_library(lib SHARED
add_library(scene SHARED
camera.cpp
scene.cpp
raycast.cpp
Expand All @@ -30,9 +30,9 @@ add_library(lib SHARED
include/arena.hpp
)

target_include_directories(lib PUBLIC include)
target_include_directories(scene PUBLIC include)

target_link_libraries(lib
target_link_libraries(scene
linalg
SDL3::SDL3
assimp::assimp
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Loading