Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AnalyzeView: Add Exiv2 for writing exif data #11906

Merged
merged 1 commit into from
Sep 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/macos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ jobs:
- name: Install Dependencies
run: |
brew update
brew install cmake ninja ccache geographiclib SDL2
brew install cmake ninja ccache geographiclib SDL2 exiv2

- name: Install Gstreamer
run: |
Expand Down
18 changes: 9 additions & 9 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -85,16 +85,16 @@ elseif(WIN32)
message(STATUS "Using SCCache")
set(CMAKE_C_COMPILER_LAUNCHER ${SCCACHE_PROGRAM})
set(CMAKE_CXX_COMPILER_LAUNCHER ${SCCACHE_PROGRAM})
if(MSVC)
if(CMAKE_BUILD_TYPE STREQUAL "Debug")
string(REPLACE "/Zi" "/Z7" CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG}")
string(REPLACE "/Zi" "/Z7" CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG}")
elseif(CMAKE_BUILD_TYPE STREQUAL "Release")
string(REPLACE "/Zi" "/Z7" CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE}")
string(REPLACE "/Zi" "/Z7" CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE}")
endif()
set(CMAKE_MSVC_DEBUG_INFORMATION_FORMAT Embedded)
endif()
if(MSVC)
if(CMAKE_BUILD_TYPE STREQUAL "Debug")
string(REPLACE "/Zi" "/Z7" CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG}")
string(REPLACE "/Zi" "/Z7" CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG}")
elseif(CMAKE_BUILD_TYPE STREQUAL "Release")
string(REPLACE "/Zi" "/Z7" CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE}")
string(REPLACE "/Zi" "/Z7" CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE}")
endif()
set(CMAKE_MSVC_DEBUG_INFORMATION_FORMAT Embedded)
endif()
endif()

Expand Down
60 changes: 59 additions & 1 deletion src/AnalyzeView/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,64 @@ target_link_libraries(AnalyzeView
QmlControls
)

set(MINIMUM_EXIV2_VERSION 0.28.3)

if(NOT QGC_BUILD_DEPENDENCIES)
find_package(Exiv2 ${MINIMUM_EXIV2_VERSION} CONFIG)
if(Exiv2_FOUND)
message(STATUS "Found Exiv2 ${Exiv2_VERSION_STRING}")
target_link_libraries(AnalyzeView PRIVATE Exiv2::exiv2lib)
else()
find_package(PkgConfig)
if(PkgConfig_FOUND)
pkg_check_modules(Exiv2 IMPORTED_TARGET exiv2>=${MINIMUM_EXIV2_VERSION})
if(Exiv2_FOUND)
message(STATUS "Found Exiv2 ${Exiv2_VERSION}")
target_link_libraries(AnalyzeView PRIVATE PkgConfig::Exiv2)
endif()
endif()
endif()
endif()

if(NOT Exiv2_FOUND)
message(STATUS "Building Exiv2")
include(FetchContent)
FetchContent_Declare(EXIV2
GIT_REPOSITORY https://github.com/Exiv2/exiv2.git
GIT_TAG v0.28.3
GIT_SHALLOW TRUE
GIT_PROGRESS TRUE
)
set(EXIV2_ENABLE_XMP OFF CACHE INTERNAL "" FORCE)
set(EXIV2_ENABLE_EXTERNAL_XMP OFF CACHE INTERNAL "" FORCE)
set(EXIV2_ENABLE_PNG OFF CACHE INTERNAL "" FORCE)
set(EXIV2_ENABLE_NLS OFF CACHE INTERNAL "" FORCE)
set(EXIV2_ENABLE_LENSDATA OFF CACHE INTERNAL "" FORCE)
set(EXIV2_ENABLE_DYNAMIC_RUNTIME ON CACHE INTERNAL "" FORCE)
set(EXIV2_ENABLE_WEBREADY OFF CACHE INTERNAL "" FORCE)
set(EXIV2_ENABLE_CURL OFF CACHE INTERNAL "" FORCE)
set(EXIV2_ENABLE_BMFF OFF CACHE INTERNAL "" FORCE)
set(EXIV2_ENABLE_BROTLI OFF CACHE INTERNAL "" FORCE)
set(EXIV2_ENABLE_VIDEO OFF CACHE INTERNAL "" FORCE)
set(EXIV2_ENABLE_INIH OFF CACHE INTERNAL "" FORCE)
set(EXIV2_ENABLE_FILESYSTEM_ACCESS ON CACHE INTERNAL "" FORCE)
set(EXIV2_BUILD_SAMPLES OFF CACHE INTERNAL "" FORCE)
set(EXIV2_BUILD_EXIV2_COMMAND OFF CACHE INTERNAL "" FORCE)
set(EXIV2_BUILD_UNIT_TESTS OFF CACHE INTERNAL "" FORCE)
set(EXIV2_BUILD_FUZZ_TESTS OFF CACHE INTERNAL "" FORCE)
set(EXIV2_BUILD_DOC OFF CACHE INTERNAL "" FORCE)
set(BUILD_WITH_CCACHE ON CACHE INTERNAL "" FORCE)
FetchContent_MakeAvailable(EXIV2)

target_link_libraries(AnalyzeView PRIVATE exiv2lib)
target_include_directories(AnalyzeView
PRIVATE
${CMAKE_BINARY_DIR}
${exiv2_SOURCE_DIR}/include
${exiv2_SOURCE_DIR}/include/exiv2
)
endif()

include(FetchContent)
FetchContent_Declare(easyexif
GIT_REPOSITORY https://github.com/mayanklahiri/easyexif.git
Expand All @@ -69,7 +127,7 @@ target_sources(AnalyzeView
${easyexif_SOURCE_DIR}/exif.h
)

target_include_directories(AnalyzeView
target_include_directories(AnalyzeView
PUBLIC
${CMAKE_CURRENT_SOURCE_DIR}
${easyexif_SOURCE_DIR}
Expand Down
Loading
Loading