PP3 file version is now manually specified in a header file (ppversion.h) for easier version tracking through Mercurial. It has been set to 300 instead of {latestagdistance} which was a bad idea. This could chnage if the Mercurial team manage to create a reliable absolute version numbering of the remote repos before the 3.0 release.

This commit is contained in:
Hombre 2011-02-20 01:19:38 +01:00
parent 01401c20a6
commit c2ad633fe8
11 changed files with 429 additions and 388 deletions

View File

@ -1,228 +1,250 @@
cmake_minimum_required(VERSION 2.6) cmake_minimum_required(VERSION 2.6)
# the default target is 'Debug' # the default target is 'Debug'
if (CMAKE_BUILD_TYPE STREQUAL "") if (CMAKE_BUILD_TYPE STREQUAL "")
set (CMAKE_BUILD_TYPE Debug CACHE STRING "One of: None Debug Release RelWithDebInfo MinSizeRel." FORCE) set (CMAKE_BUILD_TYPE Debug CACHE STRING "One of: None Debug Release RelWithDebInfo MinSizeRel." FORCE)
endif () endif ()
message(STATUS "CMAKE_BUILD_TYPE: ${CMAKE_BUILD_TYPE}") message(STATUS "CMAKE_BUILD_TYPE: ${CMAKE_BUILD_TYPE}")
# By default, we don't use specific processor target, so PROC_TARGET_NUMBER is set to 0. If can specify other values to select specific # By default, we don't use specific processor target, so PROC_TARGET_NUMBER is set to 0. If can specify other values to select specific
# processor targets, which list can be found in ProcessorTargets.cmake. # processor targets, which list can be found in ProcessorTargets.cmake.
set (PROC_TARGET_NUMBER 0 CACHE STRING "Selected target processor from the list above (taken from ProcessorTargets.cmake)") set (PROC_TARGET_NUMBER 0 CACHE STRING "Selected target processor from the list above (taken from ProcessorTargets.cmake)")
# The following line set special compilation flags for RTEngine, and will be added to CMAKE_CXX_FLAGS # The following line set special compilation flags for RTEngine, and will be added to CMAKE_CXX_FLAGS
# It were moved away from rtengine/CMakefiles.txt, because some users may want to remove -ffast_math : # It were moved away from rtengine/CMakefiles.txt, because some users may want to remove -ffast_math :
# this flag speeds up the floating-point operations, but with a little bite less precisions. This default value # this flag speeds up the floating-point operations, but with a little bite less precisions. This default value
# gives the same result/behaviour as before. # gives the same result/behaviour as before.
set (RTENGINE_CXX_FLAGS "-ffast-math -funroll-loops" CACHE STRING "Special compilation flags for RTEngine") set (RTENGINE_CXX_FLAGS "-ffast-math -funroll-loops" CACHE STRING "Special compilation flags for RTEngine")
#loading the processor targets list #loading the processor targets list
set (PROC_LABEL "undefined") set (PROC_LABEL "undefined")
set (PROC_FLAGS "") set (PROC_FLAGS "")
if (PROC_TARGET_NUMBER GREATER 0) if (PROC_TARGET_NUMBER GREATER 0)
include (ProcessorTargets.cmake) include (ProcessorTargets.cmake)
set (PROC_LABEL ${PROC_TARGET_${PROC_TARGET_NUMBER}_LABEL}) set (PROC_LABEL ${PROC_TARGET_${PROC_TARGET_NUMBER}_LABEL})
set (PROC_FLAGS ${PROC_TARGET_${PROC_TARGET_NUMBER}_FLAGS}) set (PROC_FLAGS ${PROC_TARGET_${PROC_TARGET_NUMBER}_FLAGS})
endif (PROC_TARGET_NUMBER GREATER 0) endif (PROC_TARGET_NUMBER GREATER 0)
# if it exists, the PROC_FORCED_LABEL value is loaded in PROC_LABEL to override the one of ProcessorTargets # if it exists, the PROC_FORCED_LABEL value is loaded in PROC_LABEL to override the one of ProcessorTargets
if (DEFINED PROC_FORCED_LABEL) if (DEFINED PROC_FORCED_LABEL)
set (PROC_LABEL ${PROC_FORCED_LABEL}) set (PROC_LABEL ${PROC_FORCED_LABEL})
endif (DEFINED PROC_FORCED_LABEL) endif (DEFINED PROC_FORCED_LABEL)
# adding the proc flags to the build flags # adding the proc flags to the build flags
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${PROC_FLAGS}") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${PROC_FLAGS}")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${PROC_FLAGS}") set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${PROC_FLAGS}")
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${PROC_FLAGS}") set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${PROC_FLAGS}")
if (APPLE) if (APPLE)
# SET (CMAKE_OSX_ARCHITECTURES "i386;x86_64;" ) # SET (CMAKE_OSX_ARCHITECTURES "i386;x86_64;" )
# SET (CMAKE_TRY_COMPILE_OSX_ARCHITECTURES "i386;x86_64;" ) # SET (CMAKE_TRY_COMPILE_OSX_ARCHITECTURES "i386;x86_64;" )
SET (CMAKE_OSX_SYSROOT "/Developer/SDKs/MacOSX10.5.sdk") SET (CMAKE_OSX_SYSROOT "/Developer/SDKs/MacOSX10.5.sdk")
SET (CMAKE_OSX_DEPLOYMENT_TARGET "10.5") SET (CMAKE_OSX_DEPLOYMENT_TARGET "10.5")
endif (APPLE) endif (APPLE)
option (BUILD_SHARED "Build rawtherapee with shared libraries" OFF) option (AUTOMATED_BUILD_SYSTEM "TRUE if built by an automate" OFF)
option (WITH_RAWZOR "Build with Rawzor support" OFF)
option (WITH_MYFILE_MMAP "Build using memory mapped file" OFF) option (BUILD_SHARED "Build rawtherapee with shared libraries" OFF)
option (OPTION_OMP "Build with OpenMP support" ON) option (WITH_RAWZOR "Build with Rawzor support" OFF)
option (WITH_MYFILE_MMAP "Build using memory mapped file" OFF)
# set install directories option (OPTION_OMP "Build with OpenMP support" ON)
if (NOT DEFINED DATADIR)
if (WIN32 OR APPLE) # set install directories
set (DATADIR ${CMAKE_CURRENT_SOURCE_DIR}/release) if (NOT DEFINED DATADIR)
else (WIN32 OR APPLE) if (WIN32 OR APPLE)
set (DATADIR ${CMAKE_INSTALL_PREFIX}/share/rawtherapee) set (DATADIR ${CMAKE_CURRENT_SOURCE_DIR}/release)
endif (WIN32 OR APPLE) else (WIN32 OR APPLE)
endif (NOT DEFINED DATADIR) set (DATADIR ${CMAKE_INSTALL_PREFIX}/share/rawtherapee)
endif (WIN32 OR APPLE)
if (NOT DEFINED BINDIR) endif (NOT DEFINED DATADIR)
if (WIN32 OR APPLE)
set (BINDIR ${CMAKE_CURRENT_SOURCE_DIR}/release) if (NOT DEFINED BINDIR)
else (WIN32 OR APPLE) if (WIN32 OR APPLE)
set (BINDIR ${CMAKE_INSTALL_PREFIX}/bin) set (BINDIR ${CMAKE_CURRENT_SOURCE_DIR}/release)
endif (WIN32 OR APPLE) else (WIN32 OR APPLE)
endif (NOT DEFINED BINDIR) set (BINDIR ${CMAKE_INSTALL_PREFIX}/bin)
endif (WIN32 OR APPLE)
if (NOT DEFINED LIBDIR) endif (NOT DEFINED BINDIR)
if (WIN32 OR APPLE)
set (LIBDIR ${CMAKE_CURRENT_SOURCE_DIR}/release) if (NOT DEFINED LIBDIR)
else (WIN32 OR APPLE) if (WIN32 OR APPLE)
# Respect CMAKE_INSTALL_LIBDIR if set set (LIBDIR ${CMAKE_CURRENT_SOURCE_DIR}/release)
if (DEFINED CMAKE_INSTALL_LIBDIR) else (WIN32 OR APPLE)
set (LIBDIR ${CMAKE_INSTALL_LIBDIR}) # Respect CMAKE_INSTALL_LIBDIR if set
else (DEFINED CMAKE_INSTALL_LIBDIR) if (DEFINED CMAKE_INSTALL_LIBDIR)
set (LIBDIR ${CMAKE_INSTALL_PREFIX}/lib) set (LIBDIR ${CMAKE_INSTALL_LIBDIR})
endif (DEFINED CMAKE_INSTALL_LIBDIR) else (DEFINED CMAKE_INSTALL_LIBDIR)
endif (WIN32 OR APPLE) set (LIBDIR ${CMAKE_INSTALL_PREFIX}/lib)
endif (NOT DEFINED LIBDIR) endif (DEFINED CMAKE_INSTALL_LIBDIR)
endif (WIN32 OR APPLE)
if (NOT DEFINED DOCDIR) endif (NOT DEFINED LIBDIR)
if (WIN32 OR APPLE)
set (DOCDIR ${CMAKE_CURRENT_SOURCE_DIR}/release/doc) if (NOT DEFINED DOCDIR)
else (WIN32 OR APPLE) if (WIN32 OR APPLE)
set (DOCDIR ${CMAKE_INSTALL_PREFIX}/share/doc) set (DOCDIR ${CMAKE_CURRENT_SOURCE_DIR}/release/doc)
endif (WIN32 OR APPLE) else (WIN32 OR APPLE)
endif (NOT DEFINED DOCDIR) set (DOCDIR ${CMAKE_INSTALL_PREFIX}/share/doc)
endif (WIN32 OR APPLE)
if (NOT DEFINED CREDITSDIR) endif (NOT DEFINED DOCDIR)
if (WIN32 OR APPLE)
set (CREDITSDIR ${CMAKE_CURRENT_SOURCE_DIR}/release) if (NOT DEFINED CREDITSDIR)
else (WIN32 OR APPLE) if (WIN32 OR APPLE)
set (CREDITSDIR ${CMAKE_INSTALL_PREFIX}/share/doc) set (CREDITSDIR ${CMAKE_CURRENT_SOURCE_DIR}/release)
endif (WIN32 OR APPLE) else (WIN32 OR APPLE)
endif (NOT DEFINED CREDITSDIR) set (CREDITSDIR ${CMAKE_INSTALL_PREFIX}/share/doc)
endif (WIN32 OR APPLE)
if (NOT DEFINED LICENCEDIR) endif (NOT DEFINED CREDITSDIR)
if (WIN32 OR APPLE)
set (LICENCEDIR ${CMAKE_CURRENT_SOURCE_DIR}/release) if (NOT DEFINED LICENCEDIR)
else (WIN32 OR APPLE) if (WIN32 OR APPLE)
set (LICENCEDIR ${CMAKE_INSTALL_PREFIX}/share/doc) set (LICENCEDIR ${CMAKE_CURRENT_SOURCE_DIR}/release)
endif (WIN32 OR APPLE) else (WIN32 OR APPLE)
endif (NOT DEFINED LICENCEDIR) set (LICENCEDIR ${CMAKE_INSTALL_PREFIX}/share/doc)
endif (WIN32 OR APPLE)
# check for libraries endif (NOT DEFINED LICENCEDIR)
find_package(PkgConfig)
pkg_check_modules (GTK REQUIRED gtk+-2.0>=2.12) # check for libraries
pkg_check_modules (GLIB2 REQUIRED glib-2.0>=2.16) find_package(PkgConfig)
pkg_check_modules (GLIBMM REQUIRED glibmm-2.4>=2.16) pkg_check_modules (GTK REQUIRED gtk+-2.0>=2.12)
pkg_check_modules (GTKMM REQUIRED gtkmm-2.4>=2.12) pkg_check_modules (GLIB2 REQUIRED glib-2.0>=2.16)
pkg_check_modules (GIO REQUIRED gio-2.0>=2.16) pkg_check_modules (GLIBMM REQUIRED glibmm-2.4>=2.16)
pkg_check_modules (GIOMM REQUIRED giomm-2.4>=2.12) pkg_check_modules (GTKMM REQUIRED gtkmm-2.4>=2.12)
pkg_check_modules (GTHREAD REQUIRED gthread-2.0>=2.16) pkg_check_modules (GIO REQUIRED gio-2.0>=2.16)
pkg_check_modules (GOBJECT REQUIRED gobject-2.0>=2.16) pkg_check_modules (GIOMM REQUIRED giomm-2.4>=2.12)
pkg_check_modules (SIGC REQUIRED sigc++-2.0) pkg_check_modules (GTHREAD REQUIRED gthread-2.0>=2.16)
# NOTE: dependencies should be handled by pkg_check_modules and FIND_PACKAGE pkg_check_modules (GOBJECT REQUIRED gobject-2.0>=2.16)
# on windows too but I don't want to break current build chain pkg_check_modules (SIGC REQUIRED sigc++-2.0)
if (WIN32) # NOTE: dependencies should be handled by pkg_check_modules and FIND_PACKAGE
set (EXTRA_LIBDIR "${CMAKE_CURRENT_SOURCE_DIR}/lib") # on windows too but I don't want to break current build chain
set (EXTRA_INCDIR "${CMAKE_CURRENT_SOURCE_DIR}/winclude") if (WIN32)
set (EXTRA_LIB "-lws2_32") set (EXTRA_LIBDIR "${CMAKE_CURRENT_SOURCE_DIR}/lib")
set (IPTCDATA_LIBRARIES iptcdata) set (EXTRA_INCDIR "${CMAKE_CURRENT_SOURCE_DIR}/winclude")
set (LCMS_LIBRARIES liblcms.a) set (EXTRA_LIB "-lws2_32")
set (JPEG_LIBRARIES libjpeg.a) set (IPTCDATA_LIBRARIES iptcdata)
set (PNG_LIBRARIES libpng.a) set (LCMS_LIBRARIES liblcms.a)
set (TIFF_LIBRARIES libtiff.a) set (JPEG_LIBRARIES libjpeg.a)
set (ZLIB_LIBRARIES libz.a) set (PNG_LIBRARIES libpng.a)
set (TIFF_LIBRARIES libtiff.a)
add_definitions (-DWIN32) set (ZLIB_LIBRARIES libz.a)
add_definitions (-D_WIN32)
if (MINGW) add_definitions (-DWIN32)
add_definitions (-D__MINGW32__) add_definitions (-D_WIN32)
endif (MINGW) if (MINGW)
else (WIN32) add_definitions (-D__MINGW32__)
pkg_check_modules (IPTCDATA REQUIRED libiptcdata) endif (MINGW)
pkg_check_modules (LCMS REQUIRED lcms) else (WIN32)
find_package (JPEG REQUIRED) pkg_check_modules (IPTCDATA REQUIRED libiptcdata)
find_package (PNG REQUIRED) pkg_check_modules (LCMS REQUIRED lcms)
find_package (TIFF REQUIRED) find_package (JPEG REQUIRED)
find_package (ZLIB REQUIRED) find_package (PNG REQUIRED)
endif (WIN32) find_package (TIFF REQUIRED)
find_package (ZLIB REQUIRED)
# set the bit number information of the platform endif (WIN32)
if (CMAKE_SIZEOF_VOID_P EQUAL 4)
set(PROC_BIT_DEPTH 32 bits) if (AUTOMATED_BUILD_SYSTEM)
elseif (CMAKE_SIZEOF_VOID_P EQUAL 8)
set(PROC_BIT_DEPTH 64 bits) message(WARNING "Automated build system mode! You have to make sure that AboutThisBuild.txt and rtgui/version.h are up-to-date by building RT at least one time with AUTOMATED_BUILD_SYSTEM=OFF.")
endif (CMAKE_SIZEOF_VOID_P EQUAL 4)
# Checking for the presence of AboutThisBuild.txt
#generating AboutThisBuild.txt find_file(ABOUT_FILE AboutThisBuild.txt PATHS "${CMAKE_CURRENT_SOURCE_DIR}" NO_DEFAULT_PATH)
if (WIN32) if (ABOUT_FILE STREQUAL ABOUT_FILE-NOTFOUND)
include (About-Windows.cmake) message(FATAL_ERROR "AboutThisBuild.txt not found! You have to build RT at least one time with AUTOMATED_BUILD_SYSTEM=OFF to generate this file.")
elseif (APPLE) endif (ABOUT_FILE STREQUAL ABOUT_FILE-NOTFOUND)
include (About-Apple.cmake)
else (WIN32) # Checking for the presence of version.h
include (About-Linux.cmake) find_file(VERSION_FILE version.h PATHS "${CMAKE_CURRENT_SOURCE_DIR}/rtgui" NO_DEFAULT_PATH)
endif (WIN32) if (VERSION_FILE STREQUAL VERSION_FILE-NOTFOUND)
add_dependencies(AboutFile Debug Release MinSizeRel RelWithDebInfo) message(FATAL_ERROR "rtgui/version.h not found! You have to build RT at least one time with AUTOMATED_BUILD_SYSTEM=OFF to generate this file.")
endif (VERSION_FILE STREQUAL VERSION_FILE-NOTFOUND)
# link rawzor
if (WITH_RAWZOR) else (AUTOMATED_BUILD_SYSTEM)
if (WIN32)
set (EXTRA_INCDIR ${EXTRA_INCDIR} "${CMAKE_CURRENT_SOURCE_DIR}/rawzor_win") # set the bit number information of the platform
set (EXTRA_LIBDIR ${EXTRA_LIBDIR} "${CMAKE_CURRENT_SOURCE_DIR}/rawzor_win") if (CMAKE_SIZEOF_VOID_P EQUAL 4)
set (EXTRA_LIB ${EXTRA_LIB} "${CMAKE_CURRENT_SOURCE_DIR}/rawzor_win/rwz_sdk_s.a") set(PROC_BIT_DEPTH 32 bits)
add_definitions (-DRAWZOR_SUPPORT) elseif (CMAKE_SIZEOF_VOID_P EQUAL 8)
install (FILES ${CMAKE_CURRENT_SOURCE_DIR}/rawzor_win/rwz_sdk_s.dll DESTINATION ${BINDIR} set(PROC_BIT_DEPTH 64 bits)
PERMISSIONS OWNER_EXECUTE OWNER_WRITE OWNER_READ GROUP_EXECUTE GROUP_READ WORLD_EXECUTE WORLD_READ) endif (CMAKE_SIZEOF_VOID_P EQUAL 4)
elseif (APPLE)
set (EXTRA_INCDIR "${CMAKE_CURRENT_SOURCE_DIR}/rawzor_mac") #generating AboutThisBuild.txt
set (EXTRA_LIBDIR "${CMAKE_CURRENT_SOURCE_DIR}/rawzor_mac") if (WIN32)
set (EXTRA_LIB "-lrwz_sdk_64") include (About-Windows.cmake)
add_definitions (-DRAWZOR_SUPPORT) elseif (APPLE)
install (FILES ${CMAKE_CURRENT_SOURCE_DIR}/rawzor_mac/librwz_sdk_64.dylib DESTINATION ${BINDIR} include (About-Apple.cmake)
PERMISSIONS OWNER_WRITE OWNER_READ GROUP_READ WORLD_READ RENAME rwz_sdk_64.dylib) else (WIN32)
if (BUILD_SHARED) include (About-Linux.cmake)
install (FILES ${CMAKE_CURRENT_SOURCE_DIR}/rawzor_mac/librwz_sdk_64.dylib DESTINATION ${LIBDIR} endif (WIN32)
PERMISSIONS OWNER_WRITE OWNER_READ GROUP_READ WORLD_READ RENAME rwz_sdk_64.dylib) add_dependencies(AboutFile Debug Release MinSizeRel RelWithDebInfo)
endif (BUILD_SHARED)
else (WIN32) endif (AUTOMATED_BUILD_SYSTEM)
if (CMAKE_SIZEOF_VOID_P EQUAL 4)
set (EXTRA_INCDIR ${EXTRA_INCDIR} "${CMAKE_CURRENT_SOURCE_DIR}/rawzor_lin32") # link rawzor
set (EXTRA_LIBDIR ${EXTRA_LIBDIR} "${CMAKE_CURRENT_SOURCE_DIR}/rawzor_lin32") if (WITH_RAWZOR)
set (EXTRA_LIB ${EXTRA_LIB} "-lrwz_sdk") if (WIN32)
add_definitions (-DRAWZOR_SUPPORT) set (EXTRA_INCDIR ${EXTRA_INCDIR} "${CMAKE_CURRENT_SOURCE_DIR}/rawzor_win")
install (FILES ${CMAKE_CURRENT_SOURCE_DIR}/rawzor_lin32/librwz_sdk.so DESTINATION ${BINDIR} set (EXTRA_LIBDIR ${EXTRA_LIBDIR} "${CMAKE_CURRENT_SOURCE_DIR}/rawzor_win")
PERMISSIONS OWNER_WRITE OWNER_READ GROUP_READ WORLD_READ RENAME rwz_sdk.so) set (EXTRA_LIB ${EXTRA_LIB} "${CMAKE_CURRENT_SOURCE_DIR}/rawzor_win/rwz_sdk_s.a")
if (BUILD_SHARED) add_definitions (-DRAWZOR_SUPPORT)
install (FILES ${CMAKE_CURRENT_SOURCE_DIR}/rawzor_lin32/librwz_sdk.so DESTINATION ${LIBDIR} install (FILES ${CMAKE_CURRENT_SOURCE_DIR}/rawzor_win/rwz_sdk_s.dll DESTINATION ${BINDIR}
PERMISSIONS OWNER_WRITE OWNER_READ GROUP_READ WORLD_READ RENAME rwz_sdk.so) PERMISSIONS OWNER_EXECUTE OWNER_WRITE OWNER_READ GROUP_EXECUTE GROUP_READ WORLD_EXECUTE WORLD_READ)
endif (BUILD_SHARED) elseif (APPLE)
elseif (CMAKE_SIZEOF_VOID_P EQUAL 8) set (EXTRA_INCDIR "${CMAKE_CURRENT_SOURCE_DIR}/rawzor_mac")
set (EXTRA_INCDIR ${EXTRA_INCDIR} "${CMAKE_CURRENT_SOURCE_DIR}/rawzor_lin64") set (EXTRA_LIBDIR "${CMAKE_CURRENT_SOURCE_DIR}/rawzor_mac")
set (EXTRA_LIBDIR ${EXTRA_LIBDIR} "${CMAKE_CURRENT_SOURCE_DIR}/rawzor_lin64") set (EXTRA_LIB "-lrwz_sdk_64")
set (EXTRA_LIB ${EXTRA_LIB} "-lrwz_sdk") add_definitions (-DRAWZOR_SUPPORT)
add_definitions (-DRAWZOR_SUPPORT) install (FILES ${CMAKE_CURRENT_SOURCE_DIR}/rawzor_mac/librwz_sdk_64.dylib DESTINATION ${BINDIR}
install (FILES ${CMAKE_CURRENT_SOURCE_DIR}/rawzor_lin64/librwz_sdk.so DESTINATION ${BINDIR} PERMISSIONS OWNER_WRITE OWNER_READ GROUP_READ WORLD_READ RENAME rwz_sdk_64.dylib)
PERMISSIONS OWNER_WRITE OWNER_READ GROUP_READ WORLD_READ RENAME rwz_sdk.so) if (BUILD_SHARED)
if (BUILD_SHARED) install (FILES ${CMAKE_CURRENT_SOURCE_DIR}/rawzor_mac/librwz_sdk_64.dylib DESTINATION ${LIBDIR}
install (FILES ${CMAKE_CURRENT_SOURCE_DIR}/rawzor_lin64/librwz_sdk.so DESTINATION ${LIBDIR} PERMISSIONS OWNER_WRITE OWNER_READ GROUP_READ WORLD_READ RENAME rwz_sdk_64.dylib)
PERMISSIONS OWNER_WRITE OWNER_READ GROUP_READ WORLD_READ RENAME rwz_sdk.so) endif (BUILD_SHARED)
endif (BUILD_SHARED) else (WIN32)
endif (CMAKE_SIZEOF_VOID_P EQUAL 4) if (CMAKE_SIZEOF_VOID_P EQUAL 4)
endif (WIN32) set (EXTRA_INCDIR ${EXTRA_INCDIR} "${CMAKE_CURRENT_SOURCE_DIR}/rawzor_lin32")
endif (WITH_RAWZOR) set (EXTRA_LIBDIR ${EXTRA_LIBDIR} "${CMAKE_CURRENT_SOURCE_DIR}/rawzor_lin32")
set (EXTRA_LIB ${EXTRA_LIB} "-lrwz_sdk")
if (WITH_MYFILE_MMAP) add_definitions (-DRAWZOR_SUPPORT)
add_definitions (-DMYFILE_MMAP) install (FILES ${CMAKE_CURRENT_SOURCE_DIR}/rawzor_lin32/librwz_sdk.so DESTINATION ${BINDIR}
endif (WITH_MYFILE_MMAP) PERMISSIONS OWNER_WRITE OWNER_READ GROUP_READ WORLD_READ RENAME rwz_sdk.so)
if (BUILD_SHARED)
if (OPTION_OMP) install (FILES ${CMAKE_CURRENT_SOURCE_DIR}/rawzor_lin32/librwz_sdk.so DESTINATION ${LIBDIR}
find_package(OpenMP) PERMISSIONS OWNER_WRITE OWNER_READ GROUP_READ WORLD_READ RENAME rwz_sdk.so)
if (OPENMP_FOUND) endif (BUILD_SHARED)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${OpenMP_CXX_FLAGS}") elseif (CMAKE_SIZEOF_VOID_P EQUAL 8)
endif (OPENMP_FOUND) set (EXTRA_INCDIR ${EXTRA_INCDIR} "${CMAKE_CURRENT_SOURCE_DIR}/rawzor_lin64")
endif (OPTION_OMP) set (EXTRA_LIBDIR ${EXTRA_LIBDIR} "${CMAKE_CURRENT_SOURCE_DIR}/rawzor_lin64")
set (EXTRA_LIB ${EXTRA_LIB} "-lrwz_sdk")
if (UNIX) add_definitions (-DRAWZOR_SUPPORT)
install (PROGRAMS rtstart DESTINATION ${BINDIR}) install (FILES ${CMAKE_CURRENT_SOURCE_DIR}/rawzor_lin64/librwz_sdk.so DESTINATION ${BINDIR}
endif (UNIX) PERMISSIONS OWNER_WRITE OWNER_READ GROUP_READ WORLD_READ RENAME rwz_sdk.so)
if (BUILD_SHARED)
install (FILES AUTHORS.txt DESTINATION ${CREDITSDIR}) install (FILES ${CMAKE_CURRENT_SOURCE_DIR}/rawzor_lin64/librwz_sdk.so DESTINATION ${LIBDIR}
install (FILES LICENSE.txt DESTINATION ${LICENCEDIR}) PERMISSIONS OWNER_WRITE OWNER_READ GROUP_READ WORLD_READ RENAME rwz_sdk.so)
install (FILES AboutThisBuild.txt DESTINATION ${BINDIR}) endif (BUILD_SHARED)
endif (CMAKE_SIZEOF_VOID_P EQUAL 4)
add_subdirectory (rtexif) endif (WIN32)
add_subdirectory (rtengine) endif (WITH_RAWZOR)
add_subdirectory (rtgui)
add_subdirectory (rtdata) if (WITH_MYFILE_MMAP)
add_definitions (-DMYFILE_MMAP)
endif (WITH_MYFILE_MMAP)
if (OPTION_OMP)
find_package(OpenMP)
if (OPENMP_FOUND)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${OpenMP_CXX_FLAGS}")
endif (OPENMP_FOUND)
endif (OPTION_OMP)
if (UNIX)
install (PROGRAMS rtstart DESTINATION ${BINDIR})
endif (UNIX)
install (FILES AUTHORS.txt DESTINATION ${CREDITSDIR})
install (FILES LICENSE.txt DESTINATION ${LICENCEDIR})
install (FILES AboutThisBuild.txt DESTINATION ${BINDIR})
add_subdirectory (rtexif)
add_subdirectory (rtengine)
add_subdirectory (rtgui)
add_subdirectory (rtdata)

View File

@ -9,7 +9,7 @@ Cmake is actually used to create the Makefiles (scripts that handle the build pr
It is designed to find all necessary compilation flags for your specific machine, but everything can be overriden. It is designed to find all necessary compilation flags for your specific machine, but everything can be overriden.
RT's build mechanism will generate a build information file, named "AboutThisBuild.txt", and require some parameters that can't be set by Cmake, so it's RT's build mechanism will generate a build information file, named "AboutThisBuild.txt", and require some parameters that can't be set by Cmake, so it's
done in our build script, and may be aoverriden at your own will. The build process also enable some sort of cross compiling, since you can only choose done in our build script, and may be overriden at your own will. The build process also enable some sort of cross compiling, since you can only choose
a specific processor variation of the same type (e.g. core2, athlon64, which are both an x86 architecture). Real cross compiling (e.g. building the windows a specific processor variation of the same type (e.g. core2, athlon64, which are both an x86 architecture). Real cross compiling (e.g. building the windows
version on a linux platform) has not been tested. version on a linux platform) has not been tested.
@ -17,6 +17,11 @@ By default, no processor is specified, so Cmake/GCC will build RT for your proce
download then have to set the processor label manually (set to 'undefined' by default) with the PROC_FORCED_LABEL cmake's parameter (we assume that you know download then have to set the processor label manually (set to 'undefined' by default) with the PROC_FORCED_LABEL cmake's parameter (we assume that you know
how to specify a cmake parameter). how to specify a cmake parameter).
Note for developers that handle an automated build system : Mercurial is requested in order to produce the build information file, but you build system will
certainly only use the source code without any access to a Mercurial repository. In this case, you have to first build RT like explained below to generates
the build information files, then you can tell your build system to run cmake with the following additionnal parameter : -D AUTOMATED_BUILD_SYSTEM:BOOL=ON.
Cmake will then pass the files creation step, but will check the presence of the requested files and stop if they're not there.
Windows Windows
------- -------

View File

@ -23,9 +23,12 @@
#include <sstream> #include <sstream>
#include <string.h> #include <string.h>
#include <version.h> #include <version.h>
#include <ppversion.h>
#include <safekeyfile.h> #include <safekeyfile.h>
#define APPVERSION VERSION
namespace rtengine { namespace rtengine {
namespace procparams { namespace procparams {
@ -223,14 +226,15 @@ raw.preser=0.0;
exif.clear (); exif.clear ();
iptc.clear (); iptc.clear ();
version = TAGDISTANCE; ppVersion = PPVERSION;
} }
int ProcParams::save (Glib::ustring fname) const { int ProcParams::save (Glib::ustring fname) const {
SafeKeyFile keyFile; SafeKeyFile keyFile;
keyFile.set_integer ("Version", "Version", TAGDISTANCE); keyFile.set_string ("Version", "AppVersion", APPVERSION);
keyFile.set_integer ("Version", "Version", PPVERSION);
// save tonecurve: // save tonecurve:
keyFile.set_boolean ("Exposure", "Auto", toneCurve.autoexp); keyFile.set_boolean ("Exposure", "Auto", toneCurve.autoexp);
@ -495,9 +499,11 @@ int ProcParams::load (Glib::ustring fname) {
// load tonecurve: // load tonecurve:
version = TAGDISTANCE; ppVersion = PPVERSION;
appVersion = APPVERSION;
if (keyFile.has_group ("Version")) { if (keyFile.has_group ("Version")) {
if (keyFile.has_key ("Version", "Version")) version = keyFile.get_integer ("Version", "Version"); if (keyFile.has_key ("Version", "AppVersion")) appVersion = keyFile.get_string ("Version", "AppVersion");
if (keyFile.has_key ("Version", "Version")) ppVersion = keyFile.get_integer ("Version", "Version");
} }
if (keyFile.has_group ("Exposure")) { if (keyFile.has_group ("Exposure")) {
@ -513,7 +519,7 @@ if (keyFile.has_group ("Exposure")) {
if (keyFile.has_key ("Exposure", "HighlightComprThreshold")) toneCurve.hlcomprthresh = keyFile.get_integer ("Exposure", "HighlightComprThreshold"); if (keyFile.has_key ("Exposure", "HighlightComprThreshold")) toneCurve.hlcomprthresh = keyFile.get_integer ("Exposure", "HighlightComprThreshold");
if (keyFile.has_key ("Exposure", "ShadowCompr")) toneCurve.shcompr = keyFile.get_integer ("Exposure", "ShadowCompr"); if (keyFile.has_key ("Exposure", "ShadowCompr")) toneCurve.shcompr = keyFile.get_integer ("Exposure", "ShadowCompr");
if (toneCurve.shcompr > 100) toneCurve.shcompr = 100; // older pp3 files can have values above 100. if (toneCurve.shcompr > 100) toneCurve.shcompr = 100; // older pp3 files can have values above 100.
if (version>200) if (ppVersion>200)
if (keyFile.has_key ("Exposure", "Curve")) toneCurve.curve = keyFile.get_double_list ("Exposure", "Curve"); if (keyFile.has_key ("Exposure", "Curve")) toneCurve.curve = keyFile.get_double_list ("Exposure", "Curve");
} }
@ -537,7 +543,7 @@ if (keyFile.has_group ("Luminance Curve")) {
if (keyFile.has_key ("Luminance Curve", "AvoidColorClipping")) labCurve.avoidclip = keyFile.get_boolean ("Luminance Curve", "AvoidColorClipping"); if (keyFile.has_key ("Luminance Curve", "AvoidColorClipping")) labCurve.avoidclip = keyFile.get_boolean ("Luminance Curve", "AvoidColorClipping");
if (keyFile.has_key ("Luminance Curve", "SaturationLimiter")) labCurve.enable_saturationlimiter= keyFile.get_boolean ("Luminance Curve", "SaturationLimiter"); if (keyFile.has_key ("Luminance Curve", "SaturationLimiter")) labCurve.enable_saturationlimiter= keyFile.get_boolean ("Luminance Curve", "SaturationLimiter");
if (keyFile.has_key ("Luminance Curve", "SaturationLimit")) labCurve.saturationlimit = keyFile.get_double ("Luminance Curve", "SaturationLimit"); if (keyFile.has_key ("Luminance Curve", "SaturationLimit")) labCurve.saturationlimit = keyFile.get_double ("Luminance Curve", "SaturationLimit");
if (version>200) if (ppVersion>200)
if (keyFile.has_key ("Luminance Curve", "LCurve")) labCurve.lcurve = keyFile.get_double_list ("Luminance Curve", "LCurve"); if (keyFile.has_key ("Luminance Curve", "LCurve")) labCurve.lcurve = keyFile.get_double_list ("Luminance Curve", "LCurve");
if (keyFile.has_key ("Luminance Curve", "aCurve")) labCurve.acurve = keyFile.get_double_list ("Luminance Curve", "aCurve"); if (keyFile.has_key ("Luminance Curve", "aCurve")) labCurve.acurve = keyFile.get_double_list ("Luminance Curve", "aCurve");
if (keyFile.has_key ("Luminance Curve", "bCurve")) labCurve.bcurve = keyFile.get_double_list ("Luminance Curve", "bCurve"); if (keyFile.has_key ("Luminance Curve", "bCurve")) labCurve.bcurve = keyFile.get_double_list ("Luminance Curve", "bCurve");

View File

@ -446,7 +446,8 @@ class ProcParams {
HSVEqualizerParams hsvequalizer; ///< hsv equalizer parameters HSVEqualizerParams hsvequalizer; ///< hsv equalizer parameters
std::vector<ExifPair> exif; ///< List of modifications appplied on the exif tags of the input image std::vector<ExifPair> exif; ///< List of modifications appplied on the exif tags of the input image
std::vector<IPTCPair> iptc; ///< The IPTC tags and values to be saved to the output image std::vector<IPTCPair> iptc; ///< The IPTC tags and values to be saved to the output image
int version; ///< Version of the file from which the parameters have been read Glib::ustring appVersion; ///< Version of the application that generated the parameters
int ppVersion; ///< Version of the PP file from which the parameters have been read
/** /**
* The constructor only sets the hand-wired defaults. * The constructor only sets the hand-wired defaults.

View File

@ -1,143 +1,143 @@
/* /*
* This file is part of RawTherapee. * This file is part of RawTherapee.
* *
* Copyright (c) 2004-2010 Gabor Horvath <hgabor@rawtherapee.com> * Copyright (c) 2004-2010 Gabor Horvath <hgabor@rawtherapee.com>
* *
* RawTherapee is free software: you can redistribute it and/or modify * RawTherapee is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or * the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version. * (at your option) any later version.
* *
* RawTherapee is distributed in the hope that it will be useful, * RawTherapee is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * GNU General Public License for more details.
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with RawTherapee. If not, see <http://www.gnu.org/licenses/>. * along with RawTherapee. If not, see <http://www.gnu.org/licenses/>.
*/ */
#include <cacheimagedata.h> #include <cacheimagedata.h>
#include <vector> #include <vector>
#include <glib/gstdio.h> #include <glib/gstdio.h>
#include <safekeyfile.h> #include <safekeyfile.h>
CacheImageData::CacheImageData () CacheImageData::CacheImageData ()
: md5(""), supported(false), format(FT_Invalid), rank(0), inTrash(false), recentlySaved(false), : md5(""), supported(false), format(FT_Invalid), rank(0), inTrash(false), recentlySaved(false),
timeValid(false), exifValid(false), thumbImgType(0) { timeValid(false), exifValid(false), thumbImgType(0) {
} }
int CacheImageData::load (const Glib::ustring& fname) { int CacheImageData::load (const Glib::ustring& fname) {
rtengine::SafeKeyFile keyFile; rtengine::SafeKeyFile keyFile;
try { try {
if (!keyFile.load_from_file (fname)) if (!keyFile.load_from_file (fname))
return 1; return 1;
if (keyFile.has_group ("General")) { if (keyFile.has_group ("General")) {
if (keyFile.has_key ("General", "MD5")) md5 = keyFile.get_string ("General", "MD5"); if (keyFile.has_key ("General", "MD5")) md5 = keyFile.get_string ("General", "MD5");
if (keyFile.has_key ("General", "Version")) version = keyFile.get_integer ("General", "Version"); if (keyFile.has_key ("General", "Version")) version = keyFile.get_string ("General", "Version");
if (keyFile.has_key ("General", "Supported")) supported = keyFile.get_boolean ("General", "Supported"); if (keyFile.has_key ("General", "Supported")) supported = keyFile.get_boolean ("General", "Supported");
if (keyFile.has_key ("General", "Format")) format = (ThFileType)keyFile.get_integer ("General", "Format"); if (keyFile.has_key ("General", "Format")) format = (ThFileType)keyFile.get_integer ("General", "Format");
if (keyFile.has_key ("General", "Rank")) rank = keyFile.get_integer ("General", "Rank"); if (keyFile.has_key ("General", "Rank")) rank = keyFile.get_integer ("General", "Rank");
if (keyFile.has_key ("General", "InTrash")) inTrash = keyFile.get_boolean ("General", "InTrash"); if (keyFile.has_key ("General", "InTrash")) inTrash = keyFile.get_boolean ("General", "InTrash");
if (keyFile.has_key ("General", "RecentlySaved")) recentlySaved = keyFile.get_boolean ("General", "RecentlySaved"); if (keyFile.has_key ("General", "RecentlySaved")) recentlySaved = keyFile.get_boolean ("General", "RecentlySaved");
} }
timeValid = keyFile.has_group ("DateTime"); timeValid = keyFile.has_group ("DateTime");
if (timeValid) { if (timeValid) {
if (keyFile.has_key ("DateTime", "Year")) year = keyFile.get_integer ("DateTime", "Year"); if (keyFile.has_key ("DateTime", "Year")) year = keyFile.get_integer ("DateTime", "Year");
if (keyFile.has_key ("DateTime", "Month")) month = keyFile.get_integer ("DateTime", "Month"); if (keyFile.has_key ("DateTime", "Month")) month = keyFile.get_integer ("DateTime", "Month");
if (keyFile.has_key ("DateTime", "Day")) day = keyFile.get_integer ("DateTime", "Day"); if (keyFile.has_key ("DateTime", "Day")) day = keyFile.get_integer ("DateTime", "Day");
if (keyFile.has_key ("DateTime", "Hour")) hour = keyFile.get_integer ("DateTime", "Hour"); if (keyFile.has_key ("DateTime", "Hour")) hour = keyFile.get_integer ("DateTime", "Hour");
if (keyFile.has_key ("DateTime", "Min")) min = keyFile.get_integer ("DateTime", "Min"); if (keyFile.has_key ("DateTime", "Min")) min = keyFile.get_integer ("DateTime", "Min");
if (keyFile.has_key ("DateTime", "Sec")) sec = keyFile.get_integer ("DateTime", "Sec"); if (keyFile.has_key ("DateTime", "Sec")) sec = keyFile.get_integer ("DateTime", "Sec");
if (keyFile.has_key ("DateTime", "MSec")) msec = keyFile.get_integer ("DateTime", "MSec"); if (keyFile.has_key ("DateTime", "MSec")) msec = keyFile.get_integer ("DateTime", "MSec");
} }
exifValid = false; exifValid = false;
if (keyFile.has_group ("ExifInfo")) { if (keyFile.has_group ("ExifInfo")) {
exifValid = true; exifValid = true;
if (keyFile.has_key ("ExifInfo", "Valid")) exifValid = keyFile.get_boolean ("ExifInfo", "Valid"); if (keyFile.has_key ("ExifInfo", "Valid")) exifValid = keyFile.get_boolean ("ExifInfo", "Valid");
if (exifValid) { if (exifValid) {
if (keyFile.has_key ("ExifInfo", "FNumber")) fnumber = keyFile.get_double ("ExifInfo", "FNumber"); if (keyFile.has_key ("ExifInfo", "FNumber")) fnumber = keyFile.get_double ("ExifInfo", "FNumber");
if (keyFile.has_key ("ExifInfo", "Shutter")) shutter = keyFile.get_double ("ExifInfo", "Shutter"); if (keyFile.has_key ("ExifInfo", "Shutter")) shutter = keyFile.get_double ("ExifInfo", "Shutter");
if (keyFile.has_key ("ExifInfo", "FocalLen")) focalLen = keyFile.get_double ("ExifInfo", "FocalLen"); if (keyFile.has_key ("ExifInfo", "FocalLen")) focalLen = keyFile.get_double ("ExifInfo", "FocalLen");
if (keyFile.has_key ("ExifInfo", "ISO")) iso = keyFile.get_integer ("ExifInfo", "ISO"); if (keyFile.has_key ("ExifInfo", "ISO")) iso = keyFile.get_integer ("ExifInfo", "ISO");
} }
if (keyFile.has_key ("ExifInfo", "Lens")) lens = keyFile.get_string ("ExifInfo", "Lens"); if (keyFile.has_key ("ExifInfo", "Lens")) lens = keyFile.get_string ("ExifInfo", "Lens");
if (keyFile.has_key ("ExifInfo", "Camera")) camera = keyFile.get_string ("ExifInfo", "Camera"); if (keyFile.has_key ("ExifInfo", "Camera")) camera = keyFile.get_string ("ExifInfo", "Camera");
} }
if (keyFile.has_group ("FileInfo")) { if (keyFile.has_group ("FileInfo")) {
if (keyFile.has_key ("FileInfo", "Filetype")) filetype = keyFile.get_string ("FileInfo", "Filetype"); if (keyFile.has_key ("FileInfo", "Filetype")) filetype = keyFile.get_string ("FileInfo", "Filetype");
} }
if (format==FT_Raw && keyFile.has_group ("ExtraRawInfo")) { if (format==FT_Raw && keyFile.has_group ("ExtraRawInfo")) {
if (keyFile.has_key ("ExtraRawInfo", "ThumbImageType")) thumbImgType = keyFile.get_integer ("ExtraRawInfo", "ThumbImageType"); if (keyFile.has_key ("ExtraRawInfo", "ThumbImageType")) thumbImgType = keyFile.get_integer ("ExtraRawInfo", "ThumbImageType");
if (keyFile.has_key ("ExtraRawInfo", "ThumbImageOffset")) thumbOffset = keyFile.get_integer ("ExtraRawInfo", "ThumbImageOffset"); if (keyFile.has_key ("ExtraRawInfo", "ThumbImageOffset")) thumbOffset = keyFile.get_integer ("ExtraRawInfo", "ThumbImageOffset");
} }
else { else {
rotate = 0; rotate = 0;
thumbImgType = 0; thumbImgType = 0;
} }
return 0; return 0;
} }
catch (Glib::Error) { catch (Glib::Error) {
return 1; return 1;
} }
} }
int CacheImageData::save (const Glib::ustring& fname) { int CacheImageData::save (const Glib::ustring& fname) {
rtengine::SafeKeyFile keyFile; rtengine::SafeKeyFile keyFile;
if (::g_file_test(fname.c_str(),G_FILE_TEST_EXISTS)) keyFile.load_from_file (fname); if (::g_file_test(fname.c_str(),G_FILE_TEST_EXISTS)) keyFile.load_from_file (fname);
keyFile.set_string ("General", "MD5", md5); keyFile.set_string ("General", "MD5", md5);
keyFile.set_integer ("General", "Version", options.version); keyFile.set_string ("General", "Version", options.version);
keyFile.set_boolean ("General", "Supported", supported); keyFile.set_boolean ("General", "Supported", supported);
keyFile.set_integer ("General", "Format", format); keyFile.set_integer ("General", "Format", format);
keyFile.set_integer ("General", "Rank", rank); keyFile.set_integer ("General", "Rank", rank);
keyFile.set_boolean ("General", "InTrash", inTrash); keyFile.set_boolean ("General", "InTrash", inTrash);
keyFile.set_boolean ("General", "RecentlySaved", recentlySaved); keyFile.set_boolean ("General", "RecentlySaved", recentlySaved);
if (timeValid) { if (timeValid) {
keyFile.set_integer ("DateTime", "Year", year); keyFile.set_integer ("DateTime", "Year", year);
keyFile.set_integer ("DateTime", "Month", month); keyFile.set_integer ("DateTime", "Month", month);
keyFile.set_integer ("DateTime", "Day", day); keyFile.set_integer ("DateTime", "Day", day);
keyFile.set_integer ("DateTime", "Hour", hour); keyFile.set_integer ("DateTime", "Hour", hour);
keyFile.set_integer ("DateTime", "Min", min); keyFile.set_integer ("DateTime", "Min", min);
keyFile.set_integer ("DateTime", "Sec", sec); keyFile.set_integer ("DateTime", "Sec", sec);
keyFile.set_integer ("DateTime", "MSec", msec); keyFile.set_integer ("DateTime", "MSec", msec);
} }
keyFile.set_boolean ("ExifInfo", "Valid", exifValid); keyFile.set_boolean ("ExifInfo", "Valid", exifValid);
if (exifValid) { if (exifValid) {
keyFile.set_double ("ExifInfo", "FNumber", fnumber); keyFile.set_double ("ExifInfo", "FNumber", fnumber);
keyFile.set_double ("ExifInfo", "Shutter", shutter); keyFile.set_double ("ExifInfo", "Shutter", shutter);
keyFile.set_double ("ExifInfo", "FocalLen", focalLen); keyFile.set_double ("ExifInfo", "FocalLen", focalLen);
keyFile.set_integer ("ExifInfo", "ISO", iso); keyFile.set_integer ("ExifInfo", "ISO", iso);
} }
keyFile.set_string ("ExifInfo", "Lens", lens); keyFile.set_string ("ExifInfo", "Lens", lens);
keyFile.set_string ("ExifInfo", "Camera", camera); keyFile.set_string ("ExifInfo", "Camera", camera);
keyFile.set_string ("FileInfo", "Filetype", filetype); keyFile.set_string ("FileInfo", "Filetype", filetype);
if (format==FT_Raw) { if (format==FT_Raw) {
keyFile.set_integer ("ExtraRawInfo", "ThumbImageType", thumbImgType); keyFile.set_integer ("ExtraRawInfo", "ThumbImageType", thumbImgType);
keyFile.set_integer ("ExtraRawInfo", "ThumbImageOffset", thumbOffset); keyFile.set_integer ("ExtraRawInfo", "ThumbImageOffset", thumbOffset);
} }
FILE *f = g_fopen (fname.c_str(), "wt"); FILE *f = g_fopen (fname.c_str(), "wt");
if (!f) if (!f)
return 1; return 1;
else { else {
fprintf (f, "%s", keyFile.to_data().c_str()); fprintf (f, "%s", keyFile.to_data().c_str());
fclose (f); fclose (f);
return 0; return 0;
}} }}

View File

@ -28,7 +28,7 @@ class CacheImageData {
// basic informations // basic informations
Glib::ustring md5; Glib::ustring md5;
int version; Glib::ustring version;
bool supported; bool supported;
ThFileType format; ThFileType format;
char rank; char rank;

View File

@ -75,7 +75,7 @@ void Options::setDefaults () {
fbShowHidden = false; fbShowHidden = false;
fbArrangement = 0; fbArrangement = 0;
multiUser = false; multiUser = false;
version = TAGDISTANCE; version = VERSION;
thumbSize = 80; thumbSize = 80;
thumbSizeTab = 80; thumbSizeTab = 80;
showHistory = true; showHistory = true;
@ -181,7 +181,7 @@ if (keyFile.has_group ("General")) {
if (keyFile.has_key ("General", "StoreLastProfile")) savesParamsAtExit = keyFile.get_boolean ("General", "StoreLastProfile"); if (keyFile.has_key ("General", "StoreLastProfile")) savesParamsAtExit = keyFile.get_boolean ("General", "StoreLastProfile");
if (keyFile.has_key ("General", "DualProcSupport")) rtSettings.dualThreadEnabled = keyFile.get_boolean ("General", "DualProcSupport"); if (keyFile.has_key ("General", "DualProcSupport")) rtSettings.dualThreadEnabled = keyFile.get_boolean ("General", "DualProcSupport");
if (keyFile.has_key ("General", "MultiUser")) multiUser = keyFile.get_boolean ("General", "MultiUser"); if (keyFile.has_key ("General", "MultiUser")) multiUser = keyFile.get_boolean ("General", "MultiUser");
// if (keyFile.has_key ("General", "Version")) version = keyFile.get_integer ("General", "Version"); if (keyFile.has_key ("General", "Version")) version = keyFile.get_string ("General", "Version");
if (keyFile.has_key ("General", "Language")) language = keyFile.get_string ("General", "Language"); if (keyFile.has_key ("General", "Language")) language = keyFile.get_string ("General", "Language");
if (keyFile.has_key ("General", "Theme")) theme = keyFile.get_string ("General", "Theme"); if (keyFile.has_key ("General", "Theme")) theme = keyFile.get_string ("General", "Theme");
if (keyFile.has_key ("General", "UseSystemTheme")) useSystemTheme = keyFile.get_boolean ("General", "UseSystemTheme"); if (keyFile.has_key ("General", "UseSystemTheme")) useSystemTheme = keyFile.get_boolean ("General", "UseSystemTheme");
@ -324,7 +324,7 @@ int Options::saveToFile (Glib::ustring fname) {
keyFile.set_string ("General", "Language", language); keyFile.set_string ("General", "Language", language);
keyFile.set_string ("General", "Theme", theme); keyFile.set_string ("General", "Theme", theme);
keyFile.set_boolean ("General", "UseSystemTheme", useSystemTheme); keyFile.set_boolean ("General", "UseSystemTheme", useSystemTheme);
keyFile.set_integer ("General", "Version", TAGDISTANCE); keyFile.set_string ("General", "Version", VERSION);
keyFile.set_boolean ("General", "FirstRun", firstRun); keyFile.set_boolean ("General", "FirstRun", firstRun);
keyFile.set_string ("General", "DarkFramesPath", rtSettings.darkFramesPath); keyFile.set_string ("General", "DarkFramesPath", rtSettings.darkFramesPath);
keyFile.set_boolean ("General", "Verbose", rtSettings.verbose); keyFile.set_boolean ("General", "Verbose", rtSettings.verbose);

View File

@ -84,7 +84,7 @@ class Options {
int fbArrangement; int fbArrangement;
bool multiUser; bool multiUser;
static Glib::ustring rtdir; static Glib::ustring rtdir;
int version; Glib::ustring version;
int thumbSize,thumbSizeTab; int thumbSize,thumbSizeTab;
bool showHistory; bool showHistory;
int showFilePanelState; // 0: normal, 1: maximized, 2: normal, 3: hidden int showFilePanelState; // 0: normal, 1: maximized, 2: normal, 3: hidden

7
rtgui/ppversion.h Normal file
View File

@ -0,0 +1,7 @@
#ifndef _PPVERSION_
#define _PPVERSION_
// This number have to be incremented whenever the PP3 file format is modified
#define PPVERSION 300
#endif

View File

@ -73,7 +73,7 @@ void ProfileStore::parseDir (const Glib::ustring& pdir) {
} }
ProcParams* pp = new ProcParams (); ProcParams* pp = new ProcParams ();
int res = pp->load (fname); int res = pp->load (fname);
if (!res && pp->version>=220) if (!res && pp->ppVersion>=220)
pparams[name] = pp; pparams[name] = pp;
else else
delete pp; delete pp;

View File

@ -158,7 +158,7 @@ void Thumbnail::loadProcParams () {
if (options.paramsLoadLocation==PLL_Input) { if (options.paramsLoadLocation==PLL_Input) {
// try to load it from params file next to the image file // try to load it from params file next to the image file
int ppres = pparams.load (fname + paramFileExtension); int ppres = pparams.load (fname + paramFileExtension);
pparamsValid = !ppres && pparams.version>=220; pparamsValid = !ppres && pparams.ppVersion>=220;
if (!pparamsValid) if (!pparamsValid)
pparamsValid = !pparams.load (getCacheFileName ("profiles")+paramFileExtension); pparamsValid = !pparams.load (getCacheFileName ("profiles")+paramFileExtension);
} }
@ -168,7 +168,7 @@ void Thumbnail::loadProcParams () {
// if no success, load it from params file next to the image file // if no success, load it from params file next to the image file
if (!pparamsValid) { if (!pparamsValid) {
int ppres = pparams.load (fname + paramFileExtension); int ppres = pparams.load (fname + paramFileExtension);
pparamsValid = !ppres && pparams.version>=220; pparamsValid = !ppres && pparams.ppVersion>=220;
} }
} }
} }
@ -565,4 +565,4 @@ bool Thumbnail::openDefaultViewer(int destination) {
return false; return false;
#endif #endif
} }