Warning, /graphics/digikam/core/tests/rawengine/CMakeLists.txt is written in an unsupported language. File is not indexed.

0001 #
0002 # SPDX-FileCopyrightText: 2010-2024, Gilles Caulier, <caulier dot gilles at gmail dot com>
0003 #
0004 # SPDX-License-Identifier: BSD-3-Clause
0005 #
0006 
0007 APPLY_COMMON_POLICIES()
0008 
0009 include_directories(${CMAKE_SOURCE_DIR}/core/libs/rawengine/libraw
0010                     $<TARGET_PROPERTY:Qt${QT_VERSION_MAJOR}::Core,INTERFACE_INCLUDE_DIRECTORIES>
0011                     $<TARGET_PROPERTY:Qt${QT_VERSION_MAJOR}::Gui,INTERFACE_INCLUDE_DIRECTORIES>
0012 )
0013 
0014 set(raw2png_cli_SRCS ${CMAKE_CURRENT_SOURCE_DIR}/raw2png_cli.cpp)
0015 add_executable(raw2png_cli ${raw2png_cli_SRCS})
0016 target_link_libraries(raw2png_cli
0017 
0018                       digikamcore
0019 
0020                       ${COMMON_TEST_LINK}
0021 )
0022 
0023 set(librawinfo_cli_SRCS ${CMAKE_CURRENT_SOURCE_DIR}/librawinfo_cli.cpp)
0024 add_executable(librawinfo_cli ${librawinfo_cli_SRCS})
0025 target_link_libraries(librawinfo_cli
0026 
0027                       digikamcore
0028 
0029                       ${COMMON_TEST_LINK}
0030 )
0031 
0032 # -- LibRaw CLI Samples Compilation --------------------------------------------------------------------------------
0033 
0034 # A small macro so that this is a bit cleaner
0035 
0036 macro(LIBRAW_BUILD_SAMPLES)
0037 
0038     set(_filename ${ARGV0})
0039     string(REPLACE "." ";" _temp ${_filename})
0040     list(GET _temp 0 _target)
0041     list(GET _temp 1 _ext)
0042 
0043     set(${_target}_SRCS ${CMAKE_SOURCE_DIR}/core/libs/rawengine/libraw/samples/${_filename})
0044 
0045     if (_ext STREQUAL "c")
0046 
0047         while(CMAKE_C_FLAGS MATCHES "-std=iso9899:1990")
0048 
0049             string(REPLACE "-std=iso9899:1990" "" CMAKE_C_FLAGS "${CMAKE_C_FLAGS}")
0050 
0051         endwhile()
0052 
0053     endif()
0054 
0055     if(WIN32 AND MSVC)
0056         set_source_files_properties(${${_target}_SRCS} PROPERTIES COMPILE_FLAGS /w)
0057     else()
0058         set_source_files_properties(${${_target}_SRCS} PROPERTIES COMPILE_FLAGS "-w")
0059     endif()
0060 
0061     add_executable(${_target}_cli ${${_target}_SRCS})
0062 
0063     target_link_libraries(${_target}_cli
0064 
0065                           libraw
0066                           libdng
0067                           PNG::PNG                          # For zlib
0068 
0069                           ${COMMON_TEST_LINK}
0070     )
0071 
0072     if(WIN32)
0073 
0074         target_compile_definitions(${_target}_cli
0075                                    PRIVATE
0076                                    -DWIN32
0077         )
0078 
0079     endif()
0080 
0081 
0082 endmacro()
0083 
0084 LIBRAW_BUILD_SAMPLES(4channels.cpp)
0085 LIBRAW_BUILD_SAMPLES(dcraw_emu.cpp)
0086 LIBRAW_BUILD_SAMPLES(mem_image_sample.cpp)
0087 LIBRAW_BUILD_SAMPLES(multirender_test.cpp)
0088 LIBRAW_BUILD_SAMPLES(openbayer_sample.cpp)
0089 LIBRAW_BUILD_SAMPLES(postprocessing_benchmark.cpp)
0090 LIBRAW_BUILD_SAMPLES(raw-identify.cpp)
0091 LIBRAW_BUILD_SAMPLES(rawtextdump.cpp)
0092 LIBRAW_BUILD_SAMPLES(simple_dcraw.cpp)
0093 LIBRAW_BUILD_SAMPLES(unprocessed_raw.cpp)
0094 
0095 # C sample files which must be compiled only if LCMS v2 is detected, to prevent broken compilation
0096 
0097 if(LCMS2_FOUND)
0098 
0099    if(MSVC)
0100 
0101         LIBRAW_BUILD_SAMPLES(half_mt_win32.c)
0102 
0103    else()
0104 
0105         LIBRAW_BUILD_SAMPLES(dcraw_half.c)
0106         LIBRAW_BUILD_SAMPLES(half_mt.c)
0107 
0108    endif()
0109 
0110 endif()