1ea83d9d11
* add dimension selector sliders to czi view * version doc & version bump * cosmetic * fix build? * multi-dimension selection enabled in czi view * remove the parameterized reset function of the renderer it is not and is conceptually questionable doc updates & some minor improvements auto-update CZI-view when sliders are moved set initial window size fix windows build and msvc build For reasons I don not comprehend, on Windows, we must include =opencv2/core/mat.hpp= as the very last header in the =CvMatRender.hpp=. If this is at any other position building on Windows, compilation will break w/ all kinds of cryptic errors regarding OpenCV. When building w/ msvc =__PRETTY_FUNCTION__= is not defined. =ILog.hpp= now defines it. This should be revised to only be set when the compiler is msvc. For the time being, it is considered sufficient though.
103 lines
2.9 KiB
CMake
103 lines
2.9 KiB
CMake
cmake_minimum_required(VERSION 3.23)
|
|
|
|
project(pixelarium VERSION 0.0.4)
|
|
|
|
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(pfd_DIR ${PROJECT_SOURCE_DIR}/modules/portable-file-dialogs)
|
|
set(spdlog_DIR ${PROJECT_SOURCE_DIR}/modules/spdlog)
|
|
|
|
find_package(OpenGL REQUIRED)
|
|
|
|
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)
|
|
#====================
|
|
|
|
if(WIN32)
|
|
set(CMAKE_MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>")
|
|
if (CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")
|
|
set(CMAKE_CXX_FLAGS "/std:c++20 /Zi /EHsc")
|
|
else()
|
|
set(CMAKE_CXX_FLAGS "-Wall -Wextra -g --std=c++20")
|
|
endif()
|
|
endif()
|
|
if(UNIX)
|
|
set(CMAKE_CXX_FLAGS "-Wall -Wextra -g --std=c++20")
|
|
endif()
|
|
|
|
string(TOUPPER "${CMAKE_PROJECT_NAME}" PIXELARIUM_TITLE)
|
|
|
|
add_subdirectory(${pfd_DIR})
|
|
add_subdirectory(${spdlog_DIR})
|
|
add_subdirectory(${glfw3_module_DIR})
|
|
add_subdirectory(lib)
|
|
|
|
set(SRC
|
|
src/main.cpp)
|
|
|
|
#====================
|
|
# 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>")
|
|
#====================
|
|
|
|
add_executable(${PROJECT_NAME} ${SRC})
|
|
|
|
target_link_libraries(${PROJECT_NAME}
|
|
PRIVATE pixelariumimagelib
|
|
PRIVATE pixelariumrenderlib
|
|
PRIVATE pixelariumutilslib
|
|
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 ${LIBCZI_INCLUDE_DIR}
|
|
PUBLIC ${CMAKE_CURRENT_BINARY_DIR})
|
|
|
|
|
|
if(PIXELARIUM_BUILD_UNITTESTS)
|
|
include(CTest)
|
|
enable_testing()
|
|
add_subdirectory(tests)
|
|
endif()
|
|
|
|
if(PIXELARIUM_BUILD_DOCS)
|
|
include(${PROJECT_SOURCE_DIR}/cmake/awesomeDoxygen.cmake)
|
|
set(MAINPAGE_FILE "doc/index.md")
|
|
find_package(Doxygen)
|
|
if (DOXYGEN_FOUND)
|
|
|
|
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")
|
|
|
|
else (DOXYGEN_FOUND)
|
|
message(FATAL_ERROR "Doxygen need to be installed to generate the doxygen documentation")
|
|
endif (DOXYGEN_FOUND)
|
|
endif()
|