Commit 828dd10e authored by Camilo Higuita's avatar Camilo Higuita

work on database and pix interface for handling data and introduce exiv2 for metadata reading

parent 8f142d37
QT += qml quick quickcontrols2
QT += qml quick quickcontrols2 sql widgets
#android:
#{
......@@ -19,7 +19,10 @@ DEFINES += QT_DEPRECATED_WARNINGS
# You can also select to disable deprecated APIs only up to a certain version of Qt.
#DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000 # disables all the APIs deprecated before Qt 6.0.0
SOURCES += main.cpp
SOURCES += main.cpp \
src/utils/utils.cpp \
src/db/collectionDB.cpp \
src/utils/pix.cpp
# Additional import path used to resolve QML modules in Qt Creator's code model
QML_IMPORT_PATH =
......@@ -41,3 +44,9 @@ RESOURCES += \
DISTFILES += \
src/qtquickcontrols2.conf \
HEADERS += \
src/utils/pix.h \
src/utils/utils.h \
src/db/collectionDB.h \
src/db/fileloader.h
This diff is collapsed.
language: cpp
sudo: false
addons:
apt:
packages:
- cmake
- zlib1g-dev
- libssh-dev
- libssh
- libcurl4-openssl-dev
- gettext
sources:
- kalakris-cmake
compiler:
- gcc
- clang
before_install:
- echo $LANG
- echo $LC_ALL
- if [ $TRAVIS_OS_NAME == osx ]; then brew update && brew install libssh curl; fi
- rvm use $RVM --install --binary --fuzzy
- gem update --system
# - gem --version
script:
- cmake -DCMAKE_INSTALL_PREFIX=..\dist -EXIV2_ENABLE_NLS=ON -DEXIV2_ENABLE_CURL=OFF -DEXIV2_ENABLE_SSH=OFF .
- cmake --build . && cmake --build . --target install
- cmake -DCMAKE_INSTALL_PREFIX=..\dist2 -EXIV2_ENABLE_NLS=ON -DEXIV2_ENABLE_CURL=ON -DEXIV2_ENABLE_SSH=ON -DEXIV2_ENABLE_WEBREADY=ON .
- cmake --build . && cmake --build . --target install
notifications:
email: false
os:
- linux
- osx
\ No newline at end of file
See doc/ChangeLog. Authors and other contributors are mentioned there.
# CMake build system for exiv2 library and executables
# Copyright 2015- Daniel Kaneider <danielkaneider@users.sf.net>
# Copyright 2010-2012 Gilles Caulier <caulier dot gilles at gmail dot com>
# Copyright 2008 Patrick Spendrin <ps_ml at gmx dot de>
# Redistribution and use is allowed according to the terms of the BSD license.
# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
##
# Running cmake in a tree in which we have run ./configure ; make
# creates include/exiv2/exv_conf.h which conflicts with cmake's own exv_conf.h
# This causes incorrect compilation and linking errors.
#
# It's OK to delete this as it will be recreated on demand by <exiv2-dir>/Makefile
if( EXISTS "${CMAKE_SOURCE_DIR}/include/exiv2/exv_conf.h" )
file(REMOVE "${CMAKE_SOURCE_DIR}/include/exiv2/exv_conf.h")
endif()
##
CMAKE_MINIMUM_REQUIRED( VERSION 3.1.0 )
PROJECT( exiv2 )
if( POLICY CMP0042 )
cmake_policy(SET CMP0042 NEW) # enable MACOSX_RPATH support
else()
SET(CMAKE_MACOSX_RPATH 1)
endif()
SET( PACKAGE_COPYRIGHT "Andreas Huggel" )
SET( PACKAGE_BUGREPORT "ahuggel@gmx.net" )
SET( PACKAGE "exiv2" )
SET( PACKAGE_NAME "exiv2" )
SET( PACKAGE_STRING "exiv2 0.26" )
SET( PACKAGE_TARNAME "exiv2" )
SET( PACKAGE_VERSION "0.26" )
SET( PACKAGE_URL "http://www.exiv2.org" )
SET( GENERIC_LIB_VERSION "26.0.0" )
SET( GENERIC_LIB_SOVERSION "26" )
# options and their default values
OPTION( EXIV2_ENABLE_SHARED "Build exiv2 as a shared library (dll)" ON )
OPTION( EXIV2_ENABLE_XMP "Build with XMP metadata support" ON )
OPTION( EXIV2_ENABLE_LIBXMP "Build a static convenience Library for XMP" ON )
OPTION( EXIV2_ENABLE_PNG "Build with png support (requires libz)" ON )
OPTION( EXIV2_ENABLE_NLS "Build native language support (requires gettext)" ON )
OPTION( EXIV2_ENABLE_PRINTUCS2 "Build with Printucs2" ON )
OPTION( EXIV2_ENABLE_LENSDATA "Build including lens data" ON )
OPTION( EXIV2_ENABLE_COMMERCIAL "Build with the EXV_COMMERCIAL_VERSION symbol set" OFF )
OPTION( EXIV2_ENABLE_BUILD_SAMPLES "Build the unit tests" ON )
OPTION( EXIV2_ENABLE_BUILD_PO "Build translations files" OFF )
OPTION( EXIV2_ENABLE_VIDEO "Build video support into library" OFF )
OPTION( EXIV2_ENABLE_WEBREADY "Build webready support into library" OFF )
IF (WIN32)
OPTION( EXIV2_ENABLE_DYNAMIC_RUNTIME "Use dynamic runtime (used for static libs)" OFF )
OPTION( EXIV2_ENABLE_WIN_UNICODE "Use Unicode paths (wstring) on Windows" OFF )
OPTION( EXIV2_ENABLE_CURL "USE Libcurl for HttpIo" OFF )
OPTION( EXIV2_ENABLE_SSH "USE Libssh for SshIo" OFF )
ELSE()
OPTION( EXIV2_ENABLE_CURL "USE Libcurl for HttpIo" ON )
OPTION( EXIV2_ENABLE_SSH "USE Libssh for SshIo" ON )
SET ( EXIV2_ENABLE_DYNAMIC_RUNTIME OFF )
ENDIF()
# set include path for FindXXX.cmake files
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/config/")
IF( MINGW OR UNIX )
IF ( CMAKE_CXX_COMPILER STREQUAL "g++" OR CMAKE_C_COMPILER STREQUAL "gcc" )
ADD_DEFINITIONS(-Wall
-Wcast-align
-Wpointer-arith
-Wformat-security
-Wmissing-format-attribute
-Woverloaded-virtual
-W
)
ENDIF()
execute_process(COMMAND ${CMAKE_CXX_COMPILER} --version OUTPUT_VARIABLE COMPILER_VERSION)
string(REGEX MATCHALL "[a-z\+]+" GCC_COMPILER_COMPONENTS ${COMPILER_VERSION})
list(GET GCC_COMPILER_COMPONENTS 0 COMPILER)
execute_process(COMMAND ${CMAKE_CXX_COMPILER} -dumpversion OUTPUT_VARIABLE GCC_VERSION)
string(REGEX MATCHALL "[0-9]+" GCC_VERSION_COMPONENTS ${GCC_VERSION})
list(GET GCC_VERSION_COMPONENTS 0 GCC_MAJOR)
list(GET GCC_VERSION_COMPONENTS 1 GCC_MINOR)
message(STATUS Compiler: ${COMPILER} " Major:" ${GCC_MAJOR} " Minor:" ${GCC_MINOR})
IF ( CYGWIN OR ( ${GCC_MAJOR} GREATER 5 ))
ADD_DEFINITIONS( -std=gnu++98 ) # to support snprintf
ELSE()
ADD_DEFINITIONS( -std=c++98 )
ENDIF()
ENDIF( MINGW OR UNIX )
IF( EXIV2_ENABLE_COMMERCIAL )
SET (EXIV2_ENABLE_LENSDATA OFF)
SET (EXIV2_ENABLE_NLS OFF)
ENDIF()
set (PRIVATE_VAR)
if(${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION} GREATER 2.8)
set (PRIVATE_VAR PRIVATE)
endif()
# binary as first, since it workarounds old VS solution compatibility problems
INCLUDE_DIRECTORIES( ${CMAKE_SOURCE_DIR}/src/ ${CMAKE_SOURCE_DIR}/include/ ${CMAKE_SOURCE_DIR}/include/exiv2/)
if( MSVC )
# cmake_policy(SET CMP0008)
ADD_DEFINITIONS(-DPSAPI_VERSION=1) # to be compatible with <= WinVista (#905)
set(CMAKE_DEBUG_POSTFIX "d")
endif( MSVC )
IF( EXIV2_ENABLE_XMP )
SET( HAVE_XMP_TOOLKIT ON )
SET( XMPLIB "do" )
IF (NOT MINGW)
set(THREADS_PREFER_PTHREAD_FLAG ON)
ENDIF()
find_package(Threads REQUIRED)
ENDIF( EXIV2_ENABLE_XMP )
INCLUDE( config/CMakeChecks.txt )
SET( INSTALL_TARGET_STANDARD_ARGS
RUNTIME DESTINATION bin
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
)
##
# add sources from XMPSDK directory
# this needs to be done here to be visible to xmpsdk, src and sample sub directories
SET( XMPSRC ${CMAKE_CURRENT_SOURCE_DIR}/xmpsdk/src/ExpatAdapter.cpp
${CMAKE_CURRENT_SOURCE_DIR}/xmpsdk/src/MD5.cpp
${CMAKE_CURRENT_SOURCE_DIR}/xmpsdk/src/ParseRDF.cpp
${CMAKE_CURRENT_SOURCE_DIR}/xmpsdk/src/UnicodeConversions.cpp
${CMAKE_CURRENT_SOURCE_DIR}/xmpsdk/src/WXMPIterator.cpp
${CMAKE_CURRENT_SOURCE_DIR}/xmpsdk/src/WXMPMeta.cpp
${CMAKE_CURRENT_SOURCE_DIR}/xmpsdk/src/WXMPUtils.cpp
${CMAKE_CURRENT_SOURCE_DIR}/xmpsdk/src/XML_Node.cpp
${CMAKE_CURRENT_SOURCE_DIR}/xmpsdk/src/XMPCore_Impl.cpp
${CMAKE_CURRENT_SOURCE_DIR}/xmpsdk/src/XMPIterator.cpp
${CMAKE_CURRENT_SOURCE_DIR}/xmpsdk/src/XMPMeta-GetSet.cpp
${CMAKE_CURRENT_SOURCE_DIR}/xmpsdk/src/XMPMeta-Parse.cpp
${CMAKE_CURRENT_SOURCE_DIR}/xmpsdk/src/XMPMeta-Serialize.cpp
${CMAKE_CURRENT_SOURCE_DIR}/xmpsdk/src/XMPMeta.cpp
${CMAKE_CURRENT_SOURCE_DIR}/xmpsdk/src/XMPUtils-FileInfo.cpp
${CMAKE_CURRENT_SOURCE_DIR}/xmpsdk/src/XMPUtils.cpp
)
# the following lines need to be added to circumvent the error in xmpsdk\src\MD5.h
IF( ${EXV_HAVE_STDINT_H} )
ADD_DEFINITIONS( -DEXV_HAVE_STDINT_H )
ENDIF( ${EXV_HAVE_STDINT_H} )
##
# MacOS-X default svn is /usr/bin/svn which is protected with System Integrity Protection
# Apple reset it to version 1.7.22 when the OS is upgraded
# http://osxdaily.com/2015/10/05/disable-rootless-system-integrity-protection-mac-os-x/
IF(EXISTS "/usr/local/bin/svn")
SET(Subversion_SVN_EXECUTABLE /usr/local/bin/svn)
ENDIF()
SET(SVN_REVISION "0")
IF(EXISTS "${CMAKE_SOURCE_DIR}/.svn")
IF(NOT MINGW)
FIND_PACKAGE(Subversion QUIET)
IF(SUBVERSION_FOUND)
Subversion_WC_INFO(${PROJECT_SOURCE_DIR} svnExiv2)
SET(SVN_REVISION "${svnExiv2_WC_REVISION}")
ENDIF()
ENDIF()
ENDIF()
CONFIGURE_FILE( ${CMAKE_CURRENT_SOURCE_DIR}/src/svn_version.h.in
${CMAKE_CURRENT_SOURCE_DIR}/src/svn_version.h @ONLY)
MESSAGE(STATUS "SVN version: ${SVN_REVISION}")
IF( NOT MSVC )
IF ( NOT MINGW )
# Issue #722: out of source builds compiled against standard include files such as /usr/local/lib/include/exiv2
# do not use CREATE_SYMLINK or CMAKE_CAN_SYMLINK as they don't work on CYGWIN
EXECUTE_PROCESS( WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} COMMAND ln -sf ${CMAKE_CURRENT_SOURCE_DIR}/src exiv2)
IF( EXIV2_ENABLE_BUILD_SAMPLES )
EXECUTE_PROCESS( WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/samples COMMAND ln -sf ${CMAKE_CURRENT_SOURCE_DIR}/src exiv2)
ENDIF( EXIV2_ENABLE_BUILD_SAMPLES )
IF( EXIV2_ENABLE_BUILD_PO )
EXECUTE_PROCESS( WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/po COMMAND ln -sf ${CMAKE_CURRENT_SOURCE_DIR}/src exiv2)
ENDIF( EXIV2_ENABLE_BUILD_PO )
ENDIF()
ENDIF()
ADD_SUBDIRECTORY( xmpsdk )
ADD_SUBDIRECTORY( src )
IF( EXIV2_ENABLE_BUILD_SAMPLES )
ADD_SUBDIRECTORY( samples )
ENDIF( EXIV2_ENABLE_BUILD_SAMPLES )
IF( EXIV2_ENABLE_BUILD_PO )
ADD_SUBDIRECTORY( po )
ENDIF( EXIV2_ENABLE_BUILD_PO )
##
# tests
ADD_CUSTOM_TARGET(tests COMMAND env EXIV2_BINDIR="${CMAKE_BINARY_DIR}"/bin make tests WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}" )
ADD_CUSTOM_TARGET(geotag-test COMMAND env EXIV2_BINDIR="${CMAKE_BINARY_DIR}"/bin make geotag-test WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}" )
##
# http://dev.exiv2.org/boards/3/topics/1364
# effectively does a make doc on the root directory
# has to run 'make config' and './configure'
# and copy bin/taglist to <exiv2dir>/bin/taglist for use by 'make doc'
IF( MINGW OR UNIX OR APPLE)
ADD_CUSTOM_TARGET(doc
WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}/doc"
COMMAND chmod +x ./cmake_doc.sh
COMMAND ./cmake_doc.sh "${CMAKE_BINARY_DIR}"
)
ENDIF()
# That's all Folks!
##
#if (MSVC)
# set_property(TARGET tgt PROPERTY CXX_STANDARD 11)
#endif()
##
# msvc tuning macros
macro(msvc_runtime_set_static_ignores bDynamic bDynamicRuntime)
if(MSVC)
# don't link msvcrt for .exe which use shared libraries (use default libcmt)
if ( ${bDynamic} STREQUAL "OFF" AND ${bDynamicRuntime} STREQUAL "OFF")
set(CMAKE_EXE_LINKER_FLAGS_DEBUG "/NODEFAULTLIB:MSVCRTD")
set(CMAKE_EXE_LINKER_FLAGS_RELEASE "/NODEFAULTLIB:MSVCRT")
set(CMAKE_EXE_LINKER_FLAGS_MINSIZEREL "/NODEFAULTLIB:MSVCRT")
set(CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO "/NODEFAULTLIB:MSVCRT")
endif()
endif()
endmacro()
# http://stackoverflow.com/questions/10113017/setting-the-msvc-runtime-in-cmake
macro(msvc_runtime_configure bDynamic bDynamicRuntime)
if(MSVC)
set(variables
CMAKE_C_FLAGS_DEBUG
CMAKE_C_FLAGS_MINSIZEREL
CMAKE_C_FLAGS_RELEASE
CMAKE_C_FLAGS_RELWITHDEBINFO
CMAKE_CXX_FLAGS_DEBUG
CMAKE_CXX_FLAGS_MINSIZEREL
CMAKE_CXX_FLAGS_RELEASE
CMAKE_CXX_FLAGS_RELWITHDEBINFO
)
if( ${bDynamic} STREQUAL "ON" OR ${bDynamicRuntime} STREQUAL "ON")
message(STATUS "MSVC -> forcing use of dynamically-linked runtime." )
foreach(variable ${variables})
if(${variable} MATCHES "/MT")
string(REGEX REPLACE "/MT" "/MD" ${variable} "${${variable}}")
endif()
endforeach()
else()
message(STATUS "MSVC -> forcing use of statically-linked runtime." )
foreach(variable ${variables})
if(${variable} MATCHES "/MD")
string(REGEX REPLACE "/MD" "/MT" ${variable} "${${variable}}")
endif()
set(${variable} "${${variable}} /DXML_STATIC /D_LIB")
endforeach()
endif()
# remove /Ob2 and /Ob1 - they cause linker issues
set(obs /Ob2 /Ob1)
foreach(ob ${obs})
foreach(variable ${variables})
if(${variable} MATCHES ${ob} )
string(REGEX REPLACE ${ob} "" ${variable} "${${variable}}")
endif()
endforeach()
endforeach()
msvc_runtime_set_static_ignores(${bDynamic} ${bDynamicRuntime})
endif()
endmacro()
macro(msvc_runtime_report)
if(MSVC)
set(variables
CMAKE_C_FLAGS_DEBUG
CMAKE_C_FLAGS_MINSIZEREL
CMAKE_C_FLAGS_RELEASE
CMAKE_C_FLAGS_RELWITHDEBINFO
CMAKE_CXX_FLAGS_DEBUG
CMAKE_CXX_FLAGS_MINSIZEREL
CMAKE_CXX_FLAGS_RELEASE
CMAKE_CXX_FLAGS_RELWITHDEBINFO
# CMAKE_C_LINK_EXECUTABLE
)
message(STATUS "Build flags:")
foreach(variable ${variables})
message(STATUS " '${variable}': ${${variable}}")
endforeach()
message(STATUS "")
endif()
endmacro()
# That's all Folks!
##
This diff is collapsed.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
1. Redistributions of source code must retain the copyright
notice, this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
3. The name of the author may not be used to endorse or promote products
derived from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
# - Try to find the Exiv2 library
#
# EXIV2_MIN_VERSION - You can set this variable to the minimum version you need
# before doing FIND_PACKAGE(Exiv2). The default is 0.12.
#
# Once done this will define
#
# EXIV2_FOUND - system has libexiv2
# EXIV2_INCLUDE_DIR - the libexiv2 include directory
# EXIV2_LIBRARIES - Link these to use libexiv2
# EXIV2_DEFINITIONS - Compiler switches required for using libexiv2
#
# The minimum required version of Exiv2 can be specified using the
# standard syntax, e.g. find_package(Exiv2 0.17)
#
# For compatiblity, also the variable EXIV2_MIN_VERSION can be set to the minimum version
# you need before doing FIND_PACKAGE(Exiv2). The default is 0.12.
# Copyright (c) 2010, Alexander Neundorf, <neundorf@kde.org>
# Copyright (c) 2008, Gilles Caulier, <caulier.gilles@gmail.com>
#
# Redistribution and use is allowed according to the terms of the BSD license.
# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
# Support EXIV2_MIN_VERSION for compatibility:
if(NOT Exiv2_FIND_VERSION)
set(Exiv2_FIND_VERSION "${EXIV2_MIN_VERSION}")
endif(NOT Exiv2_FIND_VERSION)
# the minimum version of exiv2 we require
if(NOT Exiv2_FIND_VERSION)
set(Exiv2_FIND_VERSION "0.12")
endif(NOT Exiv2_FIND_VERSION)
if (NOT WIN32)
# use pkg-config to get the directories and then use these values
# in the FIND_PATH() and FIND_LIBRARY() calls
find_package(PkgConfig)
pkg_check_modules(PC_EXIV2 QUIET exiv2)
set(EXIV2_DEFINITIONS ${PC_EXIV2_CFLAGS_OTHER})
endif (NOT WIN32)
find_path(EXIV2_INCLUDE_DIR NAMES exiv2/exif.hpp
HINTS
${PC_EXIV2_INCLUDEDIR}
${PC_EXIV2_INCLUDE_DIRS}
)
find_library(EXIV2_LIBRARY NAMES exiv2 libexiv2
HINTS
${PC_EXIV2_LIBDIR}
${PC_EXIV2_LIBRARY_DIRS}
)
# Get the version number from exiv2/version.hpp and store it in the cache:
if(EXIV2_INCLUDE_DIR AND NOT EXIV2_VERSION)
file(READ ${EXIV2_INCLUDE_DIR}/exiv2/version.hpp EXIV2_VERSION_CONTENT)
string(REGEX MATCH "#define EXIV2_MAJOR_VERSION +\\( *([0-9]+) *\\)" _dummy "${EXIV2_VERSION_CONTENT}")
set(EXIV2_VERSION_MAJOR "${CMAKE_MATCH_1}")
string(REGEX MATCH "#define EXIV2_MINOR_VERSION +\\