blob: 47b2c728cef9e164c97e8ff3d0cdd82d1e96af1e [file] [log] [blame]
From 0e5ebb56e3b0ca85b8ca74ae3577b06a4795cad6 Mon Sep 17 00:00:00 2001
From: Ronan Arraes Jardim Chagas <ronisbr@gmail.com>
Date: Thu, 4 Feb 2010 11:09:22 -0200
Subject: [PATCH] Initial approach to unbundled libpgf from Digikam 1.1.0
Changes to be committed:
modified: CMakeLists.txt
new file: cmake/modules/FindPGF.cmake
modified: digikam/CMakeLists.txt
modified: libs/CMakeLists.txt
---
CMakeLists.txt | 70 ++++++++++++++++++++++++++++++------------
cmake/modules/FindPGF.cmake | 15 +++++++++
digikam/CMakeLists.txt | 8 ++---
libs/CMakeLists.txt | 1 +
4 files changed, 69 insertions(+), 25 deletions(-)
create mode 100644 cmake/modules/FindPGF.cmake
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 3cf296a..329e410 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -34,6 +34,13 @@ SET(DIGIKAM_VERSION_STRING
"${DIGIKAM_VERSION_SHORT}${DIGIKAM_SUFFIX_VERSION}"
)
+# Path to find FindPGF.cmake script.
+SET(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake/modules")
+
+# =================================================================================================
+# Project options
+OPTION(BUILD_DOC "Set ON to install documentation files" OFF)
+
# ==================================================================================================
# Debug area codes
# These codes will be set for every project specific path automatically, so
@@ -115,6 +122,11 @@ FIND_PACKAGE(LCMS)
FIND_PACKAGE(JPEG)
FIND_PACKAGE(PNG)
FIND_PACKAGE(TIFF)
+
+# Included to unbundle libpgf that is on portage tree.
+# This function call the script cmake/modules/FindPGF.cmake
+FIND_PACKAGE(PGF)
+
FIND_PACKAGE(Jasper)
FIND_PACKAGE(Kdcraw)
FIND_PACKAGE(Kexiv2)
@@ -197,6 +209,7 @@ MESSAGE(STATUS "")
PRINT_QTMODULE_STATUS("Qt4 SQL" QT_QTSQL_FOUND)
PRINT_LIBRARY_STATUS("libtiff" "http://www.remotesensing.org/libtiff" "" TIFF_FOUND)
+PRINT_LIBRARY_STATUS("libpgf" "http://www.libpgf.org" "" PGF_FOUND)
PRINT_LIBRARY_STATUS("libpng" "http://www.libpng.org/pub/png/libpng.html" " (version >= 1.2.7)" PNG_FOUND)
PRINT_LIBRARY_STATUS("libjasper" "http://www.ece.uvic.ca/~mdadams/jasper" "" JASPER_FOUND)
PRINT_LIBRARY_STATUS("liblcms" "http://www.littlecms.com" "" LCMS_FOUND)
@@ -298,13 +311,13 @@ ELSE(DOXYGEN_FOUND)
MESSAGE(STATUS "")
ENDIF(DOXYGEN_FOUND)
-IF(LCMS_FOUND AND JPEG_FOUND AND PNG_FOUND AND TIFF_FOUND AND JASPER_FOUND AND KDCRAW_FOR_DIGIKAM AND KEXIV2_FOUND AND KIPI_FOUND)
+IF(LCMS_FOUND AND JPEG_FOUND AND PNG_FOUND AND TIFF_FOUND AND PGF_FOUND AND JASPER_FOUND AND KDCRAW_FOR_DIGIKAM AND KEXIV2_FOUND AND KIPI_FOUND)
MESSAGE(STATUS " digiKam will be compiled................. YES")
SET(DIGIKAM_CAN_BE_COMPILED true)
-ELSE(LCMS_FOUND AND JPEG_FOUND AND PNG_FOUND AND TIFF_FOUND AND AND JASPER_FOUND AND KDCRAW_FOR_DIGIKAM AND KEXIV2_FOUND AND KIPI_FOUND)
+ELSE(LCMS_FOUND AND JPEG_FOUND AND PNG_FOUND AND TIFF_FOUND AND PGF_FOUND AND JASPER_FOUND AND KDCRAW_FOR_DIGIKAM AND KEXIV2_FOUND AND KIPI_FOUND)
MESSAGE(FATAL_ERROR " digiKam will be compiled................. NO (Look README file for more details about dependencies)")
SET(DIGIKAM_CAN_BE_COMPILED false)
-ENDIF(LCMS_FOUND AND JPEG_FOUND AND PNG_FOUND AND TIFF_FOUND AND JASPER_FOUND AND KDCRAW_FOR_DIGIKAM AND KEXIV2_FOUND AND KIPI_FOUND)
+ENDIF(LCMS_FOUND AND JPEG_FOUND AND PNG_FOUND AND TIFF_FOUND AND PGF_FOUND AND JASPER_FOUND AND KDCRAW_FOR_DIGIKAM AND KEXIV2_FOUND AND KIPI_FOUND)
MESSAGE(STATUS "----------------------------------------------------------------------------------")
MESSAGE(STATUS "")
@@ -889,14 +902,7 @@ IF(DIGIKAM_CAN_BE_COMPILED)
${CMAKE_CURRENT_SOURCE_DIR}/libs/threadimageio/pgfutils.cpp
)
- SET(libpgf_SRCS
- ${CMAKE_CURRENT_SOURCE_DIR}/libs/3rdparty/libpgf/Decoder.cpp
- ${CMAKE_CURRENT_SOURCE_DIR}/libs/3rdparty/libpgf/Encoder.cpp
- ${CMAKE_CURRENT_SOURCE_DIR}/libs/3rdparty/libpgf/PGFimage.cpp
- ${CMAKE_CURRENT_SOURCE_DIR}/libs/3rdparty/libpgf/Stream.cpp
- ${CMAKE_CURRENT_SOURCE_DIR}/libs/3rdparty/libpgf/Subband.cpp
- ${CMAKE_CURRENT_SOURCE_DIR}/libs/3rdparty/libpgf/WaveletTransform.cpp
- )
+ INCLUDE_DIRECTORIES(${PGF_INCLUDE_DIRS})
SET(libsqlite2_SRCS
${CMAKE_CURRENT_SOURCE_DIR}/libs/3rdparty/sqlite2/attach.c
@@ -1176,18 +1182,42 @@ ENDIF(DIGIKAM_CAN_BE_COMPILED)
# ==================================================================================================
# API documentation generation
-IF(DOXYGEN_FOUND)
- SET(API_DIR ${CMAKE_BINARY_DIR}/api)
- SET(SOURCE_DIR ${CMAKE_SOURCE_DIR})
- SET(DOXYFILE ${CMAKE_BINARY_DIR}/Doxyfile)
- SET(WARNFILE ${CMAKE_BINARY_DIR}/doxygen-warn.log)
+# Checks if user ask to build documentation.
+IF(BUILD_DOC)
+ IF(DOXYGEN_FOUND)
- CONFIGURE_FILE(Doxyfile.cmake ${DOXYFILE})
+ MESSAGE(STATUS "")
+ MESSAGE(STATUS "Documentation will be installed")
+ MESSAGE(STATUS "")
- ADD_CUSTOM_TARGET(doc ${DOXYGEN_EXECUTABLE} ${DOXYFILE}
- WORKING_DIRECTORY ${CMAKE_BINARY_DIR})
+ SET(API_DIR ${CMAKE_BINARY_DIR}/api)
+ SET(SOURCE_DIR ${CMAKE_SOURCE_DIR})
+ SET(DOXYFILE ${CMAKE_BINARY_DIR}/Doxyfile)
+ SET(WARNFILE ${CMAKE_BINARY_DIR}/doxygen-warn.log)
+
+ CONFIGURE_FILE(Doxyfile.cmake ${DOXYFILE})
+
+ ADD_CUSTOM_TARGET(doc ${DOXYGEN_EXECUTABLE} ${DOXYFILE}
+ WORKING_DIRECTORY ${CMAKE_BINARY_DIR})
+
+ ELSE(DOXYGEN_FOUND)
+
+ MESSAGE(STATUS "")
+ MESSAGE(STATUS "Documentation will NOT be installed")
+ MESSAGE(STATUS "Doxygen wasn't found on the system")
+ MESSAGE(STATUS "")
+
+ ENDIF(DOXYGEN_FOUND)
+
+ELSE(BUILD_DOC)
+
+ MESSAGE(STATUS "")
+ MESSAGE(STATUS "Documentation will NOT be installed")
+ MESSAGE(STATUS "Because the option -DBUILD_DOC=ON wasn't passed to cmake")
+ MESSAGE(STATUS "")
+
+ENDIF(BUILD_DOC)
-ENDIF(DOXYGEN_FOUND)
include(MacroOptionalAddSubdirectory)
macro_optional_add_subdirectory( po )
diff --git a/cmake/modules/FindPGF.cmake b/cmake/modules/FindPGF.cmake
new file mode 100644
index 0000000..60aeacc
--- /dev/null
+++ b/cmake/modules/FindPGF.cmake
@@ -0,0 +1,15 @@
+# - Try to find libpgf
+# Once done this will define
+#
+# PGF_FOUND - system has libgf
+# PGF_INCLUDE_DIRS - the libpgf include directory
+# PGF_LIBRARIES - Link these to use libpgf
+
+# PKG-CONFIG is required.
+INCLUDE(FindPkgConfig REQUIRED)
+
+IF(PKG_CONFIG_FOUND)
+ INCLUDE(FindPkgConfig)
+
+ PKG_CHECK_MODULES(PGF libpgf)
+ENDIF(PKG_CONFIG_FOUND)
diff --git a/digikam/CMakeLists.txt b/digikam/CMakeLists.txt
index 445e24f..e6839f7 100644
--- a/digikam/CMakeLists.txt
+++ b/digikam/CMakeLists.txt
@@ -73,6 +73,7 @@ INCLUDE_DIRECTORIES(
${JPEG_INCLUDE_DIR}
${PNG_PNG_INCLUDE_DIR}
${TIFF_INCLUDE_DIR}
+ ${PGF_INCLUDE_DIRS}
)
@@ -81,9 +82,6 @@ INCLUDE_DIRECTORIES(
# Disable Clapack C code warnings.
SET_SOURCE_FILES_PROPERTIES(${libclapack_SRCS} PROPERTIES COMPILE_FLAGS "-w")
-# Disable libpgf warnings.
-SET_SOURCE_FILES_PROPERTIES(${libpgf_SRCS} PROPERTIES COMPILE_FLAGS "-w")
-
SET(digikamcore_LIB_SRCS
# basic libs
${libdimg_SRCS}
@@ -100,7 +98,6 @@ SET(digikamcore_LIB_SRCS
${libgreycstoration_SRCS}
${libthreadimageio_SRCS}
${libthemeengine_SRCS}
- ${libpgf_SRCS}
${pgfutils_SRCS}
${libdigikamhelpers_SRCS}
@@ -150,6 +147,7 @@ TARGET_LINK_LIBRARIES(digikamcore
${JPEG_LIBRARIES}
${TIFF_LIBRARIES}
${PNG_LIBRARIES}
+ ${PGF_LIBRARIES}
${LCMS_LIBRARIES}
${JASPER_LIBRARIES}
@@ -193,7 +191,6 @@ SET(digikamdatabase_LIB_SRCS ${libdatabase_SRCS}
${libhaar_SRCS}
${libdatabasemodels_SRCS}
${libsqlite2_SRCS}
- ${libpgf_SRCS}
${pgfutils_SRCS}
)
@@ -208,6 +205,7 @@ TARGET_LINK_LIBRARIES(digikamdatabase
${QT_QTCORE_LIBRARY}
${QT_QTGUI_LIBRARY}
${QT_QTSQL_LIBRARY}
+ ${PGF_LIBRARIES}
)
SET_TARGET_PROPERTIES(digikamdatabase PROPERTIES VERSION 1.0.0 SOVERSION 1 )
diff --git a/libs/CMakeLists.txt b/libs/CMakeLists.txt
index b66da1c..f0a6aab 100644
--- a/libs/CMakeLists.txt
+++ b/libs/CMakeLists.txt
@@ -21,6 +21,7 @@ INCLUDE_DIRECTORIES( dimg
${JPEG_INCLUDE_DIR}
${TIFF_INCLUDE_DIR}
${PNG_INCLUDE_DIR}
+ ${PGF_INCLUDE_DIRS}
${JASPER_INCLUDE_DIR}
)
ADD_SUBDIRECTORY( curves )
--
1.6.4.4