[Kde-imaging] extragear/libs/libkdcraw

Gilles Caulier caulier.gilles at gmail.com
Thu Aug 23 14:29:26 CEST 2007


SVN commit 703839 by cgilles:

libkdcraw from trunk (KDE4) : fix Cmake rules to install dcraw bin program like KDE3 branch do. 
All version informations about library need to be changed only in one file : "libkdcraw/CMakeLists.txt". 
It's more simple to release.

CCMAIL: kde-imaging at kde.org


 M  +35 -15    CMakeLists.txt  
 M  +1 -1      dcraw/CMakeLists.txt  
 M  +11 -9     libkdcraw/CMakeLists.txt  
 M  +7 -6      libkdcraw/dcrawbinary.cpp  
 AM            libkdcraw/dcrawinfo.h   [License: GPL]
 M  +2 -5      libkdcraw/version.h.cmake  


--- trunk/extragear/libs/libkdcraw/CMakeLists.txt #703838:703839
@@ -1,22 +1,42 @@
-project(libkdcraw)
+PROJECT(libkdcraw)
 
+# =======================================================
+# Informations to update before to release this library.
+
+# Library API version
+SET(DCRAW_LIB_MAJOR_VERSION "2")
+SET(DCRAW_LIB_MINOR_VERSION "0")
+SET(DCRAW_LIB_PATCH_VERSION "0")
+
+# dcraw.c version include with this library. 
+# Look into dcraw/dcraw.c implementation for details.
+SET(DCRAW_PROGRAM_VERSION "8.77")
+
+# =======================================================
+
+# Set env. variables accordinly
+
+SET(DCRAW_PROGRAM_DIR "${LIB_INSTALL_DIR}/libkdcraw${DCRAW_LIB_MAJOR_VERSION}/kdcraw")
+
+SET(DCRAW_LIB_VERSION_INFO "${DCRAW_LIB_MAJOR_VERSION}:${DCRAW_LIB_MINOR_VERSION}:${DCRAW_LIB_PATCH_VERSION}")
+SET(DCRAW_LIB_SOVERSION ${DCRAW_LIB_MAJOR_VERSION})
+
+SET(DCRAW_LIB_VERSION_STRING "${DCRAW_LIB_MAJOR_VERSION}.${DCRAW_LIB_MINOR_VERSION}.${DCRAW_LIB_PATCH_VERSION}")
+SET(DCRAW_LIB_VERSION_ID "0x000${DCRAW_LIB_MAJOR_VERSION}${DCRAW_LIB_MINOR_VERSION}${DCRAW_LIB_PATCH_VERSION}")
+
 # Depencies detection require to compile dcraw.c
 # Detect Little CMS library properlly with CMake script from 'cmake/modules'
-set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH}  ${CMAKE_CURRENT_SOURCE_DIR}/cmake/modules)
-find_package(LCMS REQUIRED)
+SET(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH}  ${CMAKE_CURRENT_SOURCE_DIR}/cmake/modules)
+FIND_PACKAGE(LCMS REQUIRED)
 
 # Detect libJPEG
-find_package(JPEG REQUIRED)
+FIND_PACKAGE(JPEG REQUIRED)
 
-set(DCRAW_LIB_VERSION "2.0.0")
-set(DCRAW_LIB_SOVERSION "2")
+SUBDIRS(icons)
+SUBDIRS(libkdcraw)
+SUBDIRS(dcraw)
 
-
-subdirs(icons)
-subdirs(libkdcraw)
-subdirs(dcraw)
-
-if(NOT WIN32)
-  configure_file(${CMAKE_CURRENT_SOURCE_DIR}/libkdcraw.pc.cmake ${CMAKE_CURRENT_BINARY_DIR}/libkdcraw.pc)
-  install(FILES ${CMAKE_CURRENT_BINARY_DIR}/libkdcraw.pc DESTINATION ${LIB_INSTALL_DIR}/pkgconfig)
-endif(NOT WIN32)
+IF(NOT WIN32)
+  CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/libkdcraw.pc.cmake ${CMAKE_CURRENT_BINARY_DIR}/libkdcraw.pc)
+  INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/libkdcraw.pc DESTINATION ${LIB_INSTALL_DIR}/pkgconfig)
+ENDIF(NOT WIN32)
--- trunk/extragear/libs/libkdcraw/dcraw/CMakeLists.txt #703838:703839
@@ -25,7 +25,7 @@
 target_link_libraries(kdcraw ${JPEG_LIBRARY} ${LCMS_LIBRARIES})
 
 # the target kdcraw binary programe name add the soname of library as suffixe.
-set_target_properties(kdcraw PROPERTIES OUTPUT_NAME kdcraw-${DCRAW_LIB_VERSION})
+set_target_properties(kdcraw PROPERTIES OUTPUT_NAME kdcraw)
 
 # Note: we don't install kcraw man page. It will never used by users.
 install(TARGETS kdcraw DESTINATION ${BIN_INSTALL_DIR})
--- trunk/extragear/libs/libkdcraw/libkdcraw/CMakeLists.txt #703838:703839
@@ -1,19 +1,21 @@
-include_directories(${KDE4_INCLUDES} ${QT4_INCLUDES})
+INCLUDE_DIRECTORIES(${KDE4_INCLUDES} ${QT4_INCLUDES})
 
-configure_file(${CMAKE_CURRENT_SOURCE_DIR}/version.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/version.h)
+CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/version.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/version.h)
 
-set(kdcraw_LIB_SRCS dcrawbinary.cpp kdcraw.cpp dcrawsettingswidget.cpp)
+CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/dcrawinfo.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/dcrawinfo.h)
 
-kde4_add_library(kdcraw SHARED ${kdcraw_LIB_SRCS})
+SET(kdcraw_LIB_SRCS dcrawbinary.cpp kdcraw.cpp dcrawsettingswidget.cpp)
 
-target_link_libraries(kdcraw ${KDE4_KDECORE_LIBS} 
+KDE4_ADD_LIBRARY(kdcraw SHARED ${kdcraw_LIB_SRCS})
+
+TARGET_LINK_LIBRARIES(kdcraw ${KDE4_KDECORE_LIBS} 
                              ${KDE4_KDEUI_LIBS} 
-			     ${QT_QT3SUPPORT_LIBRARY}
+                             ${QT_QT3SUPPORT_LIBRARY}
                      )
 
-set_target_properties(kdcraw PROPERTIES VERSION ${DCRAW_LIB_VERSION} SOVERSION ${DCRAW_LIB_SOVERSION})
+SET_TARGET_PROPERTIES(kdcraw PROPERTIES VERSION ${DCRAW_LIB_VERSION_INFO} SOVERSION ${DCRAW_LIB_SOVERSION})
 
-install(TARGETS kdcraw DESTINATION ${LIB_INSTALL_DIR})
+INSTALL(TARGETS kdcraw DESTINATION ${LIB_INSTALL_DIR})
 
-install(FILES rawdecodingsettings.h kdcraw.h dcrawbinary.h dcrawsettingswidget.h dcrawinfocontainer.h rawfiles.h libkdcraw_export.h ${CMAKE_CURRENT_BINARY_DIR}/version.h DESTINATION ${INCLUDE_INSTALL_DIR}/libkdcraw)
+INSTALL(FILES rawdecodingsettings.h kdcraw.h dcrawbinary.h dcrawsettingswidget.h dcrawinfocontainer.h rawfiles.h libkdcraw_export.h ${CMAKE_CURRENT_BINARY_DIR}/version.h DESTINATION ${INCLUDE_INSTALL_DIR}/libkdcraw)
 
--- trunk/extragear/libs/libkdcraw/libkdcraw/dcrawbinary.cpp #703838:703839
@@ -29,9 +29,11 @@
 #include <klocale.h>
 #include <kglobal.h>
 #include <kaboutdata.h>
-#include "version.h"
+
 // Local includes
 
+#include "version.h"
+#include "dcrawinfo.h"
 #include "dcrawbinary.h"
 #include "dcrawbinary.moc"
 
@@ -93,7 +95,7 @@
 
 void DcrawBinary::slotReadStdoutFromDcraw(K3Process*, char* buffer, int buflen)
 {
-    // The dcraw output looks like this : Raw photo decoder "dcraw" v8.54...
+    // The dcraw output looks like this : Raw photo decoder "dcraw" v8.77...
     QString dcrawHeader("Raw photo decoder \"dcraw\" v");
 
     QString dcrawOut  = QString::fromLocal8Bit(buffer, buflen);
@@ -109,7 +111,7 @@
 const char *DcrawBinary::path()
 {
     // return the kdcraw binary program name + soname of library as suffixe
-    return /*"kdcraw-2.0.0"*/kdcraw_soname;
+    return dcraw_program_dir;
 }
 
 bool DcrawBinary::isAvailable() const
@@ -124,9 +126,8 @@
 
 QString DcrawBinary::internalVersion()
 {
-    // The version of dcraw include with this library. 
-    // Look into dcraw/dcraw.c implementation.
-    return QString("8.77");   
+    // The version of dcraw include with this library.
+    return QString(dcraw_program_version);
 }
 
 bool DcrawBinary::versionIsRight() const
** trunk/extragear/libs/libkdcraw/libkdcraw/dcrawinfo.h #property svn:eol-style
   + native
--- trunk/extragear/libs/libkdcraw/libkdcraw/version.h.cmake #703838:703839
@@ -23,11 +23,8 @@
 #ifndef KDCRAW_VERSION_H
 #define KDCRAW_VERSION_H
 
-static const char kdcraw_version[] = "0.2.0";
+static const char kdcraw_version[] = "${DCRAW_LIB_VERSION_STRING}";
 
-static const char kdcraw_soname[] = "kdcraw-${DCRAW_LIB_VERSION}";
+#define KDCRAW_VERSION ${DCRAW_LIB_VERSION_ID}
 
-#define KDCRAW_VERSION 0x000200
-
 #endif // KDCRAW_VERSION_H
-


More information about the Kde-imaging mailing list