- Add CLAUDE.md with project overview, tech stack, build commands, architecture description, coding standards, and sample images section - Add full directory structure: src/, docs/, tests/, import/ - Add CMakeLists.txt with C++20, OpenCV/LibRaw/Qt6 dependencies, converter_core static lib, optional GUI, and GTest tests - Add architecture documentation: ARCHITECTURE.md, PIPELINE.md, MODULES.md - Add source skeletons for all pipeline stages: RawLoader, Preprocessor, NegativeDetector, Inverter, ColorCorrector, CropProcessor, OutputWriter, Pipeline, MainWindow, CliRunner, main.cpp - Add initial test stubs for pipeline and rawloader - Add sample ARW files in import/ for integration testing Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
105 lines
3.9 KiB
CMake
105 lines
3.9 KiB
CMake
cmake_minimum_required(VERSION 3.20)
|
|
project(photo-converter
|
|
VERSION 0.1.0
|
|
DESCRIPTION "Analog film negative to digital positive converter"
|
|
LANGUAGES CXX
|
|
)
|
|
|
|
# ──────────────────────────────────────────────
|
|
# C++ Standard
|
|
# ──────────────────────────────────────────────
|
|
set(CMAKE_CXX_STANDARD 23)
|
|
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
|
set(CMAKE_CXX_EXTENSIONS OFF)
|
|
|
|
# ──────────────────────────────────────────────
|
|
# Build options
|
|
# ──────────────────────────────────────────────
|
|
option(BUILD_TESTS "Build unit tests" ON)
|
|
option(BUILD_GUI "Build GUI (requires Qt 6)" ON)
|
|
|
|
# ──────────────────────────────────────────────
|
|
# Dependencies
|
|
# ──────────────────────────────────────────────
|
|
find_package(OpenCV 4.10 REQUIRED COMPONENTS core imgproc imgcodecs)
|
|
find_package(PkgConfig REQUIRED)
|
|
pkg_check_modules(LIBRAW REQUIRED IMPORTED_TARGET libraw)
|
|
|
|
if(BUILD_GUI)
|
|
find_package(Qt6 6.8 REQUIRED COMPONENTS Widgets)
|
|
qt_standard_project_setup()
|
|
endif()
|
|
|
|
# ──────────────────────────────────────────────
|
|
# Core converter library (no Qt dependency)
|
|
# ──────────────────────────────────────────────
|
|
add_library(converter_core STATIC
|
|
src/converter/pipeline/Pipeline.cpp
|
|
src/converter/rawloader/RawLoader.cpp
|
|
src/converter/preprocess/Preprocessor.cpp
|
|
src/converter/negative/NegativeDetector.cpp
|
|
src/converter/invert/Inverter.cpp
|
|
src/converter/color/ColorCorrector.cpp
|
|
src/converter/crop/CropProcessor.cpp
|
|
src/converter/output/OutputWriter.cpp
|
|
src/cli/CliRunner.cpp
|
|
)
|
|
|
|
target_include_directories(converter_core PUBLIC
|
|
${CMAKE_CURRENT_SOURCE_DIR}/src
|
|
)
|
|
|
|
target_link_libraries(converter_core PUBLIC
|
|
${OpenCV_LIBS}
|
|
PkgConfig::LIBRAW
|
|
)
|
|
|
|
target_compile_options(converter_core PRIVATE
|
|
$<$<CXX_COMPILER_ID:GNU>:-Wall -Wextra -Wpedantic>
|
|
$<$<CXX_COMPILER_ID:Clang>:-Wall -Wextra -Wpedantic>
|
|
$<$<CXX_COMPILER_ID:MSVC>:/W4>
|
|
)
|
|
|
|
# ──────────────────────────────────────────────
|
|
# Main executable
|
|
# ──────────────────────────────────────────────
|
|
if(BUILD_GUI)
|
|
qt_add_executable(photo-converter
|
|
src/main.cpp
|
|
src/gui/MainWindow.cpp
|
|
src/gui/MainWindow.h
|
|
)
|
|
|
|
target_link_libraries(photo-converter PRIVATE
|
|
converter_core
|
|
Qt6::Widgets
|
|
)
|
|
|
|
target_include_directories(photo-converter PRIVATE
|
|
${CMAKE_CURRENT_SOURCE_DIR}/src
|
|
)
|
|
else()
|
|
# CLI-only build (no Qt)
|
|
add_executable(photo-converter
|
|
src/main.cpp
|
|
)
|
|
|
|
target_link_libraries(photo-converter PRIVATE
|
|
converter_core
|
|
)
|
|
|
|
target_compile_definitions(photo-converter PRIVATE NO_GUI=1)
|
|
|
|
target_include_directories(photo-converter PRIVATE
|
|
${CMAKE_CURRENT_SOURCE_DIR}/src
|
|
)
|
|
endif()
|
|
|
|
# ──────────────────────────────────────────────
|
|
# Tests
|
|
# ──────────────────────────────────────────────
|
|
if(BUILD_TESTS)
|
|
enable_testing()
|
|
add_subdirectory(tests)
|
|
endif()
|