some decouplings (#2)

* logger business

* code review

* rm c-style array

* extract image rendering to view

* missing view files

* init view abstractions

* leverage concepts and provide a templateized Enumerate function

* RVO

* get rid of some warnings

* logger business

* code review

* rm c-style array

* extract image rendering to view

* missing view files

* init view abstractions

* leverage concepts and provide a templateized Enumerate function

* RVO

* get rid of some warnings

* logger business

* code review

* rm c-style array

* init view abstractions

* leverage concepts and provide a templateized Enumerate function

* RVO

* get rid of some warnings

* logger business

* code review

* rm c-style array

* init view abstractions

* leverage concepts and provide a templateized Enumerate function

* RVO

* get rid of some warnings

* Factor out AppGLFW base class

The intention here is to get rid of scaffolding in the consumer
application class and allow to focus on the "important bits".

* Some cleanup

* dump unnecessary dependency

* link stuff where needed & use only what's needed

* remove deprecation warnings

* add gallery toggle

* make some includes private

* add presets

* remove dir locals, use presets instead

`projectile-configure-project' in conjunction with CMakePresets.json
will allow to configure the project.
`projectile-compile-project' does sth similar for the compile command.

This is equivalent to something like
~cmake --preset clang-debug && cmake --build build --preset clang-debug~

* use presets in pipeline

---------

Co-authored-by: m-aXimilian <keuffnermax@gmail.com>
This commit is contained in:
m-aXimilian
2025-08-18 22:39:43 +00:00
committed by GitHub
parent 566dd112ff
commit d71f4168fb
30 changed files with 548 additions and 259 deletions
+13 -36
View File
@@ -6,15 +6,16 @@ set(CMAKE_VERBOSE_MAKEFILE ON)
set(CXX_STANDARD 20)
set(CXX_STANDARD_REQUIRED true)
# setting global module directories
set(glfw3_module_DIR ${PROJECT_SOURCE_DIR}/modules/glfw)
set(glfw3_DIR "${glfw3_module_DIR}/CMake")
set(imgui_DIR ${PROJECT_SOURCE_DIR}/modules/imgui)
set(glfw_DIR ${PROJECT_SOURCE_DIR}/modules/glfw)
set(pfd_DIR ${PROJECT_SOURCE_DIR}/modules/portable-file-dialogs)
set(spdlog_DIR ${PROJECT_SOURCE_DIR}/modules/spdlog)
find_package(OpenGL REQUIRED)
message(STATUS "IMGUI:\t" ${imgui_DIR})
message(STATUS "GLFW:\t" ${glfw_DIR})
message(STATUS "GLFW:\t" ${glfw3_module_DIR})
message(STATUS "PFD:\t\t" ${pfd_DIR})
message(STATUS "SPDLOG:\t" ${spdlog_DIR})
@@ -33,23 +34,18 @@ set(CMAKE_RUNTIME_OUTPUT_DIRECTORY_RELEASE ${CMAKE_BINARY_DIR}/bin/Release)
add_subdirectory(${pfd_DIR})
add_subdirectory(${spdlog_DIR})
add_subdirectory(${glfw_DIR})
add_subdirectory(${glfw3_module_DIR})
add_subdirectory(src)
add_subdirectory(lib)
set(SRC
src/AppGLFW.cpp
src/main.cpp
${imgui_DIR}/imgui.cpp
${imgui_DIR}/imgui_demo.cpp
${imgui_DIR}/imgui_draw.cpp
${imgui_DIR}/imgui_tables.cpp
${imgui_DIR}/imgui_widgets.cpp
${imgui_DIR}/backends/imgui_impl_opengl3.cpp
${imgui_DIR}/backends/imgui_impl_glfw.cpp)
src/MyApp.cpp
src/views/PixelariumImageView.cpp
src/viewmodels/ImageViewFactory.cpp
src/main.cpp)
#====================
# needed for the spdlogger implemntation
# needed for the spdlogger implementation
# this is not nice, but it won't work when, e.g. doing it from lower level cmake files
add_compile_options("$<$<C_COMPILER_ID:MSVC>:/utf-8>")
add_compile_options("$<$<CXX_COMPILER_ID:MSVC>:/utf-8>")
@@ -61,38 +57,19 @@ target_link_libraries(${PROJECT_NAME}
PRIVATE pixelariumimagelib
PRIVATE pixelariumrenderlib
PRIVATE pixelariumutilslib
PRIVATE pixelariumresourcelib)
PRIVATE pixelariumresourcelib
PUBLIC pixelariumapplicationlib)
target_include_directories(${PROJECT_NAME}
PUBLIC ${PROJECT_SOURCE_DIR}/src
PUBLIC ${PROJECT_SOURCE_DIR}/lib
PUBLIC ${PROJECT_SOURCE_DIR}/lib/imaging
PUBLIC ${PROJECT_SOURCE_DIR}/lib/app
PUBLIC ${spdlog_DIR}/include
PUBLIC ${imgui_DIR}
PUBLIC ${imgui_DIR}/backends
PUBLIC ${glfw_INCLUDE_DIR}
PUBLIC ${pfd_DIR}
PUBLIC ${LIBCZI_INCLUDE_DIR}
PUBLIC ${CMAKE_CURRENT_BINARY_DIR})
if(WIN32)
target_link_libraries(${PROJECT_NAME}
PRIVATE opengl32.lib
PRIVATE glfw
PRIVATE OpenGL::GL)
endif()
if(LINUX)
target_link_libraries(${PROJECT_NAME}
PRIVATE glfw GL)
endif()
if(APPLE)
target_link_libraries(${PROJECT_NAME}
PUBLIC glfw
PUBLIC "-framework OpenGL")
endif()
option(PIXELARIUM_BUILD_UNITTESTS "Generate Unittests" ON)