Commit 037cbc48 authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

Revert "Start to implement kf5 support"

This reverts commit dc9a20ff.
parent e10307d5
......@@ -22,91 +22,8 @@
#
# ============================================================
cmake_minimum_required(VERSION 2.8.12)
PROJECT(libkexiv2)
# ECM setup
find_package(ECM 1.1.0 CONFIG REQUIRED)
set(CMAKE_MODULE_PATH ${libkexiv2_SOURCE_DIR}/cmake/modules ${ECM_MODULE_PATH})
include(GenerateExportHeader)
include(ECMGenerateHeaders)
include(ECMGeneratePriFile)
include(ECMPackageConfigHelpers)
include(ECMSetupVersion)
include(FeatureSummary)
include(KDEInstallDirs)
include(KDECMakeSettings)
include(KDEFrameworkCompilerSettings)
set(KF5_VERSION "5.0.0")
set(LIBKEXIV2_LIB_VERSION "2.70.0")
############## Find Packages ##############
set(REQUIRED_QT_VERSION "5.2.0")
find_package(KF5KDELibs4Support ${KF5_VERSION} CONFIG REQUIRED)
find_package(KF5KHtml ${KF5_VERSION} CONFIG REQUIRED)
SET(EXIV2_MIN_VERSION "0.21")
FIND_PACKAGE(Exiv2)
#MACRO_LOG_FEATURE(EXIV2_FOUND "Exiv2" "Required to build libkexiv2." "http://www.exiv2.org"
# TRUE ${EXIV2_MIN_VERSION} "")
ecm_setup_version(${LIBKEXIV2_LIB_VERSION}
VARIABLE_PREFIX KEXIV2
VERSION_HEADER "${CMAKE_CURRENT_BINARY_DIR}/libkexiv2_version.h"
PACKAGE_VERSION_FILE "${CMAKE_CURRENT_BINARY_DIR}/KF5KExiv2ConfigVersion.cmake"
SOVERSION 3
)
############## Targets ##############
add_definitions(-DTRANSLATION_DOMAIN=\"libkexiv2\")
add_subdirectory(libkexiv2)
#add_subdirectory(tests)
############## CMake Config Files ##############
message("${CMAKECONFIG_INSTALL_DIR}")
set(CMAKECONFIG_INSTALL_DIR "${CMAKECONFIG_INSTALL_PREFIX}/KEXIV2")
ecm_configure_package_config_file(
"${CMAKE_CURRENT_SOURCE_DIR}/KF5KExiv2Config.cmake.in"
"${CMAKE_CURRENT_BINARY_DIR}/KF5KExiv2Config.cmake"
INSTALL_DESTINATION ${CMAKECONFIG_INSTALL_DIR}
)
install(FILES
"${CMAKE_CURRENT_BINARY_DIR}/KF5KExiv2Config.cmake"
"${CMAKE_CURRENT_BINARY_DIR}/KF5KExiv2ConfigVersion.cmake"
DESTINATION "${CMAKECONFIG_INSTALL_DIR}"
COMPONENT Devel
)
#REACTIVATE
#install(EXPORT KF5KExiv2Targets
# DESTINATION "${CMAKECONFIG_INSTALL_DIR}"
# FILE KF5KExiv2Targets.cmake
# NAMESPACE KF5::
#)
install(FILES
"${CMAKE_CURRENT_BINARY_DIR}/libkexiv2_version.h"
DESTINATION "${KF5_INCLUDE_INSTALL_DIR}"
COMPONENT Devel
)
feature_summary(WHAT ALL FATAL_ON_MISSING_REQUIRED_PACKAGES)
if (FALSE)
MESSAGE(STATUS "----------------------------------------------------------------------------------")
MESSAGE(STATUS "Starting CMake configuration for: libkexiv2")
......@@ -119,11 +36,15 @@ INCLUDE(MacroOptionalFindPackage)
INCLUDE(FindPackageHandleStandardArgs)
ADD_DEFINITIONS (${QT_DEFINITIONS} ${QT_QTDBUS_DEFINITIONS} ${KDE4_DEFINITIONS})
INCLUDE_DIRECTORIES (${QDBUS_INCLUDE_DIRS} ${CMAKE_SOURCE_DIR} ${CMAKE_BINARY_DIR} )
INCLUDE_DIRECTORIES (${QDBUS_INCLUDE_DIRS} ${CMAKE_SOURCE_DIR} ${CMAKE_BINARY_DIR} ${KDE4_INCLUDES})
SET(LIBKEXIV2_AREA_CODE_GENERAL 51003)
ADD_DEFINITIONS(-DKDE_DEFAULT_DEBUG_AREA=${LIBKEXIV2_AREA_CODE_GENERAL})
SET(EXIV2_MIN_VERSION "0.21")
FIND_PACKAGE(Exiv2)
MACRO_LOG_FEATURE(EXIV2_FOUND "Exiv2" "Required to build libkexiv2." "http://www.exiv2.org"
TRUE ${EXIV2_MIN_VERSION} "")
# =======================================================
# Information to update before to release this library.
......@@ -216,4 +137,3 @@ IF (EXIV2_FOUND)
ENDIF (EXIV2_FOUND)
MACRO_DISPLAY_FEATURE_LOG()
endif()
......@@ -26,15 +26,11 @@ INCLUDE_DIRECTORIES(${EXIV2_INCLUDE_DIR})
ADD_DEFINITIONS(${EXIV2_DEFINITIONS})
ADD_DEFINITIONS(${KDE4_ENABLE_EXCEPTIONS})
remove_definitions(-DQT_NO_CAST_FROM_ASCII -DQT_NO_CAST_TO_ASCII)
IF( WIN32 )
ADD_DEFINITIONS( -DEXV_HAVE_DLL )
ENDIF( WIN32 )
generate_export_header(KF5 BASE_NAME KMime)
CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/version.h.cmake.in ${CMAKE_CURRENT_BINARY_DIR}/version.h)
# This was used to enable catching of exceptions thrown by libexiv2.
......@@ -57,9 +53,10 @@ SET(kexiv2_LIB_SRCS kexiv2.cpp
rotationmatrix.cpp
)
ADD_LIBRARY(kexiv2 SHARED ${kexiv2_LIB_SRCS})
KDE4_ADD_LIBRARY(kexiv2 SHARED ${kexiv2_LIB_SRCS})
TARGET_LINK_LIBRARIES(kexiv2 KF5::KHtml KF5::KDELibs4Support Qt5::Xml ${EXIV2_LIBRARIES})
TARGET_LINK_LIBRARIES(kexiv2 ${KDE4_KDEUI_LIBS} ${KDE4_KDECORE_LIBS} ${QT_QTGUI_LIBRARY}
${QT_QTXML_LIBRARY} ${EXIV2_LIBRARIES})
IF( WIN32 )
TARGET_LINK_LIBRARIES( kexiv2 ${EXPAT_LIBRARIES} )
......
......@@ -299,7 +299,7 @@ bool KExiv2::load(const QString& filePath) const
{
Exiv2::Image::AutoPtr image;
image = Exiv2::ImageFactory::open((const char*)(QFile::encodeName(filePath)).constData());
image = Exiv2::ImageFactory::open((const char*)(QFile::encodeName(filePath)));
image->readMetadata();
......@@ -350,7 +350,7 @@ bool KExiv2::load(const QString& filePath) const
if (xmpSidecarFileInfo.exists() && xmpSidecarFileInfo.isReadable())
{
// Read sidecar data
xmpsidecar = Exiv2::ImageFactory::open(QFile::encodeName(xmpSidecarPath).constData());
xmpsidecar = Exiv2::ImageFactory::open((const char*)QFile::encodeName(xmpSidecarPath));
xmpsidecar->readMetadata();
// Merge
......
......@@ -75,7 +75,7 @@ bool KExiv2::Private::saveToXMPSidecar(const QFileInfo& finfo) const
try
{
Exiv2::Image::AutoPtr image;
image = Exiv2::ImageFactory::create(Exiv2::ImageType::xmp, (const char*)(QFile::encodeName(filePath).constData()));
image = Exiv2::ImageFactory::create(Exiv2::ImageType::xmp, (const char*)(QFile::encodeName(filePath)));
return saveOperations(finfo, image);
}
catch( Exiv2::Error& e )
......@@ -151,7 +151,7 @@ bool KExiv2::Private::saveToFile(const QFileInfo& finfo) const
try
{
Exiv2::Image::AutoPtr image;
image = Exiv2::ImageFactory::open((const char*)(QFile::encodeName(finfo.filePath()).constData()));
image = Exiv2::ImageFactory::open((const char*)(QFile::encodeName(finfo.filePath())));
return saveOperations(finfo, image);
}
catch( Exiv2::Error& e )
......@@ -283,7 +283,7 @@ bool KExiv2::Private::saveOperations(const QFileInfo& finfo, Exiv2::Image::AutoP
// Don't touch access and modification timestamp of file.
struct stat st;
struct utimbuf ut;
int ret = ::stat(QFile::encodeName(filePath).constData(), &st);
int ret = ::stat(QFile::encodeName(filePath), &st);
if (ret == 0)
{
......@@ -295,7 +295,7 @@ bool KExiv2::Private::saveOperations(const QFileInfo& finfo, Exiv2::Image::AutoP
if (ret == 0)
{
::utime(QFile::encodeName(filePath).constData(), &ut);
::utime(QFile::encodeName(filePath), &ut);
}
}
else
......
......@@ -38,7 +38,7 @@ bool KExiv2::canWriteComment(const QString& filePath)
try
{
Exiv2::Image::AutoPtr image = Exiv2::ImageFactory::open((const char*)
(QFile::encodeName(filePath).constData()));
(QFile::encodeName(filePath)));
Exiv2::AccessMode mode = image->checkMode(Exiv2::mdComment);
return (mode == Exiv2::amWrite || mode == Exiv2::amReadWrite);
......
......@@ -45,7 +45,7 @@ bool KExiv2::canWriteExif(const QString& filePath)
try
{
Exiv2::Image::AutoPtr image = Exiv2::ImageFactory::open((const char*)
(QFile::encodeName(filePath).constData()));
(QFile::encodeName(filePath)));
Exiv2::AccessMode mode = image->checkMode(Exiv2::mdExif);
......
......@@ -36,7 +36,7 @@ bool KExiv2::canWriteIptc(const QString& filePath)
try
{
Exiv2::Image::AutoPtr image = Exiv2::ImageFactory::open((const char*)
(QFile::encodeName(filePath).constData()));
(QFile::encodeName(filePath)));
Exiv2::AccessMode mode = image->checkMode(Exiv2::mdIptc);
return (mode == Exiv2::amWrite || mode == Exiv2::amReadWrite);
......
......@@ -78,7 +78,7 @@ KExiv2Previews::KExiv2Previews(const QString& filePath)
{
try
{
Exiv2::Image::AutoPtr image = Exiv2::ImageFactory::open((const char*)(QFile::encodeName(filePath).constData()));
Exiv2::Image::AutoPtr image = Exiv2::ImageFactory::open((const char*)(QFile::encodeName(filePath)));
d->load(image);
}
catch( Exiv2::Error& e )
......
......@@ -37,7 +37,7 @@ bool KExiv2::canWriteXmp(const QString& filePath)
try
{
Exiv2::Image::AutoPtr image = Exiv2::ImageFactory::open((const char*)
(QFile::encodeName(filePath).constData()));
(QFile::encodeName(filePath)));
Exiv2::AccessMode mode = image->checkMode(Exiv2::mdXmp);
return (mode == Exiv2::amWrite || mode == Exiv2::amReadWrite);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment