c00c2c71ac
* scratch adding histogram to image views Histograms should come from some sort of histogram service. This is currently just a POC. * custom logger implementation w/o spdlog * missing cmake file * fix tests * use operator<< over direct stream exposure * rm print header * add threading test + refactor towards interface libraries omits the need for =target_include_directories= calls /everywhere/ * rm print header * rm constexpr * templated thread_pool * fix doxyfile * default enable doc building * czi reader refactor * rm erroneous include expression * clang-format * single lib include with PUBLIC visibility * compile imgui stdlib * clang format * documentation update centralize `LogLevelToString` to `ILog.hpp` update docs and examples
94 lines
2.9 KiB
CMake
94 lines
2.9 KiB
CMake
cmake_minimum_required(VERSION 3.23)
|
|
|
|
project(pixelarium VERSION 0.0.12)
|
|
|
|
list(APPEND CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake)
|
|
|
|
set(CMAKE_VERBOSE_MAKEFILE ON)
|
|
set(CMAKE_CXX_STANDARD 23)
|
|
set(CMAKE_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(pfd_DIR ${PROJECT_SOURCE_DIR}/modules/portable-file-dialogs)
|
|
set(spdlog_DIR ${PROJECT_SOURCE_DIR}/modules/spdlog)
|
|
|
|
message(STATUS "GLFW:\t" ${glfw3_module_DIR})
|
|
message(STATUS "PFD:\t\t" ${pfd_DIR})
|
|
message(STATUS "SPDLOG:\t" ${spdlog_DIR})
|
|
|
|
#====================
|
|
# Options
|
|
option(PIXELARIUM_BUILD_UNITTESTS "Generate Unittests" ON)
|
|
option(PIXELARIUM_BUILD_DOCS "Generate Documentation" ON)
|
|
option(PIXELARIUM_BUILD_DOCS_ONLY "Build only Documentation (no compilation)" OFF)
|
|
option(PIXELARIUM_BUILD_EXAMPLES "Build example projects" ON)
|
|
#====================
|
|
|
|
string(TOUPPER "${CMAKE_PROJECT_NAME}" PIXELARIUM_TITLE)
|
|
|
|
if(PIXELARIUM_BUILD_DOCS OR PIXELARIUM_BUILD_DOCS_ONLY)
|
|
find_package(Doxygen REQUIRED)
|
|
include(awesomeDoxygen)
|
|
set(MAINPAGE_FILE "${PROJECT_SOURCE_DIR}/doc/index.md")
|
|
|
|
set(DOXYGEN_IN ${PROJECT_SOURCE_DIR}/doc/Doxyfile.in)
|
|
set(DOXYGEN_OUT ${CMAKE_BINARY_DIR}/Doxyfile)
|
|
|
|
configure_file(${DOXYGEN_IN} ${DOXYGEN_OUT} @ONLY)
|
|
message(STATUS "Building Docs")
|
|
|
|
add_custom_target(doxygen ALL
|
|
COMMAND ${DOXYGEN_EXECUTABLE} ${DOXYGEN_OUT}
|
|
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
|
|
COMMENT "Generating Docs")
|
|
|
|
if(PIXELARIUM_BUILD_DOCS_ONLY)
|
|
message(STATUS "Documentation Generated successful")
|
|
list(APPEND CMAKE_MESSAGE_INDENT " ")
|
|
message(STATUS "PIXELARIUM_BUILD_DOCS_ONLY was set to ON. Thus, no compilation will follow.")
|
|
message(STATUS "If compilation shall occur, set '-DPIXELARIUM_BUILD_DOCS_ONLY=OFF'.")
|
|
list(POP_BACK CMAKE_MESSAGE_INDENT)
|
|
|
|
return()
|
|
endif()
|
|
endif()
|
|
|
|
find_package(OpenGL REQUIRED)
|
|
|
|
if(WIN32)
|
|
set(CMAKE_MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>")
|
|
if (CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")
|
|
set(CMAKE_CXX_FLAGS "/Zi /EHsc")
|
|
else()
|
|
set(CMAKE_CXX_FLAGS "-Wall -Wextra -g")
|
|
endif()
|
|
endif()
|
|
if(UNIX)
|
|
set(CMAKE_CXX_FLAGS "-Wall -Wextra -g")
|
|
endif()
|
|
|
|
add_subdirectory(${pfd_DIR})
|
|
add_subdirectory(${spdlog_DIR})
|
|
add_subdirectory(${glfw3_module_DIR})
|
|
add_subdirectory(lib)
|
|
|
|
#====================
|
|
# 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>")
|
|
#====================
|
|
|
|
if(PIXELARIUM_BUILD_EXAMPLES)
|
|
add_subdirectory(examples)
|
|
endif()
|
|
|
|
if(PIXELARIUM_BUILD_UNITTESTS)
|
|
include(CTest)
|
|
enable_testing()
|
|
add_subdirectory(tests)
|
|
endif()
|