Make out-of-source build possible and encourage people to use it.

On behalf of lebedev.ri, see issue 1340.
This commit is contained in:
Philip Rinn
2012-06-25 23:37:20 +02:00
parent c71fab4feb
commit 128c6dee7b
7 changed files with 131 additions and 73 deletions

View File

@@ -3,7 +3,7 @@
execute_process(COMMAND gcc -dumpversion OUTPUT_VARIABLE GCC_VERSION OUTPUT_STRIP_TRAILING_WHITESPACE) execute_process(COMMAND gcc -dumpversion OUTPUT_VARIABLE GCC_VERSION OUTPUT_STRIP_TRAILING_WHITESPACE)
# If we find ReleaseInfo.cmake we use the info from there and don't need Mercurial to be installed # If we find ReleaseInfo.cmake we use the info from there and don't need Mercurial to be installed
find_file(REL_INFO_FILE ReleaseInfo.cmake PATHS "${CMAKE_CURRENT_SOURCE_DIR}" NO_DEFAULT_PATH) find_file(REL_INFO_FILE ReleaseInfo.cmake PATHS "${PROJECT_SOURCE_DIR}" NO_DEFAULT_PATH)
if (REL_INFO_FILE STREQUAL REL_INFO_FILE-NOTFOUND) if (REL_INFO_FILE STREQUAL REL_INFO_FILE-NOTFOUND)
# we look for the hg command in this paths by order of preference # we look for the hg command in this paths by order of preference
if (WIN32) if (WIN32)
@@ -24,18 +24,18 @@ if (REL_INFO_FILE STREQUAL REL_INFO_FILE-NOTFOUND)
message(STATUS "hg command found: ${HG_CMD}") message(STATUS "hg command found: ${HG_CMD}")
endif (HG_CMD STREQUAL HG_CMD-NOTFOUND) endif (HG_CMD STREQUAL HG_CMD-NOTFOUND)
execute_process(COMMAND ${HG_CMD} -R ${CMAKE_CURRENT_SOURCE_DIR} branch OUTPUT_VARIABLE HG_BRANCH OUTPUT_STRIP_TRAILING_WHITESPACE) execute_process(COMMAND ${HG_CMD} -R "${PROJECT_SOURCE_DIR}" branch OUTPUT_VARIABLE HG_BRANCH OUTPUT_STRIP_TRAILING_WHITESPACE)
execute_process(COMMAND ${HG_CMD} parents --template={latesttag}.{latesttagdistance} WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} OUTPUT_VARIABLE HG_VERSION OUTPUT_STRIP_TRAILING_WHITESPACE) execute_process(COMMAND ${HG_CMD} -R "${PROJECT_SOURCE_DIR}" parents --template={latesttag}.{latesttagdistance} WORKING_DIRECTORY "${PROJECT_SOURCE_DIR}" OUTPUT_VARIABLE HG_VERSION OUTPUT_STRIP_TRAILING_WHITESPACE)
execute_process(COMMAND ${HG_CMD} parents --template={node|short} WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} OUTPUT_VARIABLE HG_CHANGESET OUTPUT_STRIP_TRAILING_WHITESPACE) execute_process(COMMAND ${HG_CMD} -R "${PROJECT_SOURCE_DIR}" parents --template={node|short} WORKING_DIRECTORY "${PROJECT_SOURCE_DIR}" OUTPUT_VARIABLE HG_CHANGESET OUTPUT_STRIP_TRAILING_WHITESPACE)
execute_process(COMMAND ${HG_CMD} parents --template={latesttagdistance} WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} OUTPUT_VARIABLE HG_TAGDISTANCE OUTPUT_STRIP_TRAILING_WHITESPACE) execute_process(COMMAND ${HG_CMD} -R "${PROJECT_SOURCE_DIR}" parents --template={latesttagdistance} WORKING_DIRECTORY "${PROJECT_SOURCE_DIR}" OUTPUT_VARIABLE HG_TAGDISTANCE OUTPUT_STRIP_TRAILING_WHITESPACE)
if (CACHE_NAME_SUFFIX STREQUAL "") if (CACHE_NAME_SUFFIX STREQUAL "")
execute_process(COMMAND ${HG_CMD} parents --template={latesttag} WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} OUTPUT_VARIABLE CACHE_NAME_SUFFIX OUTPUT_STRIP_TRAILING_WHITESPACE) execute_process(COMMAND ${HG_CMD} -R "${PROJECT_SOURCE_DIR}" parents --template={latesttag} WORKING_DIRECTORY "${PROJECT_SOURCE_DIR}" OUTPUT_VARIABLE CACHE_NAME_SUFFIX OUTPUT_STRIP_TRAILING_WHITESPACE)
endif (CACHE_NAME_SUFFIX STREQUAL "") endif (CACHE_NAME_SUFFIX STREQUAL "")
else (REL_INFO_FILE STREQUAL REL_INFO_FILE-NOTFOUND) else (REL_INFO_FILE STREQUAL REL_INFO_FILE-NOTFOUND)
include(${CMAKE_CURRENT_SOURCE_DIR}/ReleaseInfo.cmake) include("${PROJECT_SOURCE_DIR}/ReleaseInfo.cmake")
endif (REL_INFO_FILE STREQUAL REL_INFO_FILE-NOTFOUND) endif (REL_INFO_FILE STREQUAL REL_INFO_FILE-NOTFOUND)
# build version.h from template # build version.h from template
configure_file (${SRC_DIR}/rtgui/version.h.in ${SRC_DIR}/rtgui/version.h) configure_file ("${PROJECT_SOURCE_DIR}/rtgui/version.h.in" "${CMAKE_BINARY_DIR}/rtgui/version.h")
# build AboutThisBuild.txt from template # build AboutThisBuild.txt from template
configure_file (${SRC_DIR}/AboutThisBuild.txt.in ${SRC_DIR}/AboutThisBuild.txt) configure_file ("${PROJECT_SOURCE_DIR}/AboutThisBuild.txt.in" "${CMAKE_BINARY_DIR}/AboutThisBuild.txt")

View File

@@ -5,6 +5,8 @@ else (WIN32)
cmake_minimum_required(VERSION 2.6) cmake_minimum_required(VERSION 2.6)
endif (WIN32) endif (WIN32)
PROJECT(RawTherapee)
# 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)
@@ -77,23 +79,23 @@ if (WIN32 OR APPLE)
endif(WIN32 OR APPLE) endif(WIN32 OR APPLE)
if (NOT DEFINED BUNDLE_BASE_INSTALL_DIR) if (NOT DEFINED BUNDLE_BASE_INSTALL_DIR)
set (BUNDLE_BASE_INSTALL_DIR ${CMAKE_CURRENT_SOURCE_DIR}/${CMAKE_BUILD_TYPE}) set (BUNDLE_BASE_INSTALL_DIR "${CMAKE_BINARY_DIR}/${CMAKE_BUILD_TYPE}")
endif (NOT DEFINED BUNDLE_BASE_INSTALL_DIR) endif (NOT DEFINED BUNDLE_BASE_INSTALL_DIR)
if (BUILD_BUNDLE) if (BUILD_BUNDLE)
set (BINDIR .) set (BINDIR .)
set (CMAKE_INSTALL_PREFIX ${BUNDLE_BASE_INSTALL_DIR}) set (CMAKE_INSTALL_PREFIX "${BUNDLE_BASE_INSTALL_DIR}")
endif (BUILD_BUNDLE) endif (BUILD_BUNDLE)
if (NOT DEFINED BINDIR) if (NOT DEFINED BINDIR)
set (BINDIR ${CMAKE_INSTALL_PREFIX}/bin) set (BINDIR "${CMAKE_INSTALL_PREFIX}/bin")
endif (NOT DEFINED BINDIR) endif (NOT DEFINED BINDIR)
if (NOT DEFINED DATADIR) if (NOT DEFINED DATADIR)
if (BUILD_BUNDLE) if (BUILD_BUNDLE)
set (DATADIR .) set (DATADIR .)
else (BUILD_BUNDLE) else (BUILD_BUNDLE)
set (DATADIR ${CMAKE_INSTALL_PREFIX}/share/rawtherapee) set (DATADIR "${CMAKE_INSTALL_PREFIX}/share/rawtherapee")
endif (BUILD_BUNDLE) endif (BUILD_BUNDLE)
endif (NOT DEFINED DATADIR) endif (NOT DEFINED DATADIR)
@@ -103,13 +105,13 @@ if (NOT DEFINED LIBDIR)
else (BUILD_BUNDLE) else (BUILD_BUNDLE)
# Respect CMAKE_INSTALL_LIBDIR if set # Respect CMAKE_INSTALL_LIBDIR if set
if (DEFINED CMAKE_INSTALL_LIBDIR) if (DEFINED CMAKE_INSTALL_LIBDIR)
if (IS_ABSOLUTE ${LIBDIR}) if (IS_ABSOLUTE "${LIBDIR}")
set (LIBDIR ${CMAKE_INSTALL_LIBDIR}) set (LIBDIR "${CMAKE_INSTALL_LIBDIR}")
else (IS_ABSOLUTE ${LIBDIR}) else (IS_ABSOLUTE "${LIBDIR}")
set (LIBDIR ${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR}) set (LIBDIR "${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR}")
endif (IS_ABSOLUTE ${LIBDIR}) endif (IS_ABSOLUTE "${LIBDIR}")
else (DEFINED CMAKE_INSTALL_LIBDIR) else (DEFINED CMAKE_INSTALL_LIBDIR)
set (LIBDIR ${CMAKE_INSTALL_PREFIX}/lib) set (LIBDIR "${CMAKE_INSTALL_PREFIX}/lib")
endif (DEFINED CMAKE_INSTALL_LIBDIR) endif (DEFINED CMAKE_INSTALL_LIBDIR)
endif (BUILD_BUNDLE) endif (BUILD_BUNDLE)
endif (NOT DEFINED LIBDIR) endif (NOT DEFINED LIBDIR)
@@ -118,7 +120,7 @@ if (NOT DEFINED DOCDIR)
if (BUILD_BUNDLE) if (BUILD_BUNDLE)
set (DOCDIR ./doc) set (DOCDIR ./doc)
else (BUILD_BUNDLE) else (BUILD_BUNDLE)
set (DOCDIR ${CMAKE_INSTALL_PREFIX}/share/doc/rawtherapee) set (DOCDIR "${CMAKE_INSTALL_PREFIX}/share/doc/rawtherapee")
endif (BUILD_BUNDLE) endif (BUILD_BUNDLE)
endif (NOT DEFINED DOCDIR) endif (NOT DEFINED DOCDIR)
@@ -126,7 +128,7 @@ if (NOT DEFINED CREDITSDIR)
if (BUILD_BUNDLE) if (BUILD_BUNDLE)
set (CREDITSDIR .) set (CREDITSDIR .)
else (BUILD_BUNDLE) else (BUILD_BUNDLE)
set (CREDITSDIR ${CMAKE_INSTALL_PREFIX}/share/doc/rawtherapee) set (CREDITSDIR "${CMAKE_INSTALL_PREFIX}/share/doc/rawtherapee")
endif (BUILD_BUNDLE) endif (BUILD_BUNDLE)
endif (NOT DEFINED CREDITSDIR) endif (NOT DEFINED CREDITSDIR)
@@ -134,26 +136,26 @@ if (NOT DEFINED LICENCEDIR)
if (BUILD_BUNDLE) if (BUILD_BUNDLE)
set (LICENCEDIR .) set (LICENCEDIR .)
else (BUILD_BUNDLE) else (BUILD_BUNDLE)
set (LICENCEDIR ${CMAKE_INSTALL_PREFIX}/share/doc/rawtherapee) set (LICENCEDIR "${CMAKE_INSTALL_PREFIX}/share/doc/rawtherapee")
endif (BUILD_BUNDLE) endif (BUILD_BUNDLE)
endif (NOT DEFINED LICENCEDIR) endif (NOT DEFINED LICENCEDIR)
if (NOT DEFINED DESKTOPDIR) if (NOT DEFINED DESKTOPDIR)
if (UNIX) if (UNIX)
set (DESKTOPDIR ${CMAKE_INSTALL_PREFIX}/share/applications) set (DESKTOPDIR "${CMAKE_INSTALL_PREFIX}/share/applications")
endif (UNIX) endif (UNIX)
endif (NOT DEFINED DESKTOPDIR) endif (NOT DEFINED DESKTOPDIR)
if (NOT DEFINED ICONSDIR) if (NOT DEFINED ICONSDIR)
if (UNIX) if (UNIX)
set (ICONSDIR ${CMAKE_INSTALL_PREFIX}/share/icons) set (ICONSDIR "${CMAKE_INSTALL_PREFIX}/share/icons")
endif (UNIX) endif (UNIX)
endif (NOT DEFINED ICONSDIR) endif (NOT DEFINED ICONSDIR)
# non-bundle builds has to use absolute paths # non-bundle builds has to use absolute paths
if (NOT BUILD_BUNDLE AND if (NOT BUILD_BUNDLE AND
NOT (IS_ABSOLUTE ${BINDIR} AND IS_ABSOLUTE ${DATADIR} AND IS_ABSOLUTE ${LIBDIR} AND NOT (IS_ABSOLUTE "${BINDIR}" AND IS_ABSOLUTE "${DATADIR}" AND IS_ABSOLUTE "${LIBDIR}" AND
IS_ABSOLUTE ${DOCDIR} AND IS_ABSOLUTE ${CREDITSDIR} AND IS_ABSOLUTE ${LICENCEDIR})) IS_ABSOLUTE "${DOCDIR}" AND IS_ABSOLUTE "${CREDITSDIR}" AND IS_ABSOLUTE "${LICENCEDIR}"))
message (FATAL_ERROR "The paths has to be absolute or use -DBUILD_BUNDLE=ON") message (FATAL_ERROR "The paths has to be absolute or use -DBUILD_BUNDLE=ON")
endif () endif ()
@@ -200,10 +202,10 @@ set(CXX_FLAGS "${CMAKE_CXX_FLAGS} ${CMAKE_CXX_FLAGS_${UPPER_CMAKE_BUILD_TYPE}}")
set(LFLAGS "${CMAKE_EXE_LINKER_FLAGS} ${CMAKE_EXE_LINKER_FLAGS_${UPPER_CMAKE_BUILD_TYPE}}") set(LFLAGS "${CMAKE_EXE_LINKER_FLAGS} ${CMAKE_EXE_LINKER_FLAGS_${UPPER_CMAKE_BUILD_TYPE}}")
set(ABOUT_COMMAND_WITH_ARGS ${CMAKE_COMMAND} set(ABOUT_COMMAND_WITH_ARGS ${CMAKE_COMMAND}
-DSRC_DIR:STRING=${CMAKE_CURRENT_SOURCE_DIR} -DPROJECT_SOURCE_DIR:STRING=${PROJECT_SOURCE_DIR}
-DCACHE_NAME_SUFFIX:STRING=${CACHE_NAME_SUFFIX} -DCACHE_NAME_SUFFIX:STRING=${CACHE_NAME_SUFFIX}
-DPROC_LABEL:STRING=\"${PROC_LABEL}\" -DPROC_LABEL:STRING="${PROC_LABEL}"
-DPROC_BIT_DEPTH:STRING=\"${PROC_BIT_DEPTH}\" -DPROC_BIT_DEPTH:STRING="${PROC_BIT_DEPTH}"
-DBUILD_TYPE:STRING=${CMAKE_BUILD_TYPE} -DBUILD_TYPE:STRING=${CMAKE_BUILD_TYPE}
-DGTKMM_VERSION:STRING=${GTKMM_VERSION} -DGTKMM_VERSION:STRING=${GTKMM_VERSION}
-DOPTION_OMP:STRING=${OPTION_OMP} -DOPTION_OMP:STRING=${OPTION_OMP}
@@ -211,8 +213,8 @@ set(ABOUT_COMMAND_WITH_ARGS ${CMAKE_COMMAND}
if (WIN32) if (WIN32)
list(APPEND ABOUT_COMMAND_WITH_ARGS -DSYSTEM:STRING=Windows list(APPEND ABOUT_COMMAND_WITH_ARGS -DSYSTEM:STRING=Windows
-DCXX_FLAGS:STRING=\"${CXX_FLAGS}\" -DCXX_FLAGS:STRING="${CXX_FLAGS}"
-DLFLAGS:STRING=\"${LFLAGS}\") -DLFLAGS:STRING="${LFLAGS}")
elseif (APPLE) elseif (APPLE)
list(APPEND ABOUT_COMMAND_WITH_ARGS -DSYSTEM:STRING=Apple list(APPEND ABOUT_COMMAND_WITH_ARGS -DSYSTEM:STRING=Apple
-DCXX_FLAGS:STRING=${CXX_FLAGS} -DCXX_FLAGS:STRING=${CXX_FLAGS}
@@ -223,7 +225,7 @@ else (WIN32)
-DLFLAGS:STRING=${LFLAGS}) -DLFLAGS:STRING=${LFLAGS})
endif (WIN32) endif (WIN32)
list(APPEND ABOUT_COMMAND_WITH_ARGS -P ${CMAKE_CURRENT_SOURCE_DIR}/AboutThisBuild.cmake) list(APPEND ABOUT_COMMAND_WITH_ARGS -P "${PROJECT_SOURCE_DIR}/AboutThisBuild.cmake")
add_custom_target(AboutFile ALL add_custom_target(AboutFile ALL
COMMAND ${ABOUT_COMMAND_WITH_ARGS} COMMAND ${ABOUT_COMMAND_WITH_ARGS}
@@ -258,12 +260,42 @@ if(USE_EXPERIMENTAL_LANG_VERSIONS)
SET (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=gnu++0x") SET (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=gnu++0x")
endif (USE_EXPERIMENTAL_LANG_VERSIONS) endif (USE_EXPERIMENTAL_LANG_VERSIONS)
install (FILES AUTHORS.txt DESTINATION ${CREDITSDIR}) # find out whether we are building out of source
install (FILES LICENSE.txt DESTINATION ${LICENCEDIR}) get_filename_component(ABS_SOURCE_DIR "${PROJECT_SOURCE_DIR}" ABSOLUTE)
install (FILES AboutThisBuild.txt DESTINATION ${CREDITSDIR}) get_filename_component(ABS_BINARY_DIR "${CMAKE_BINARY_DIR}" ABSOLUTE)
install (FILES RELEASE_NOTES.txt DESTINATION ${CREDITSDIR} OPTIONAL) set (OUT_OF_SOURCE_BUILD TRUE)
if (ABS_SOURCE_DIR STREQUAL ABS_BINARY_DIR)
set (OUT_OF_SOURCE_BUILD FALSE)
message (WARNING "You are performing an in-source build. This is discouraged. Please refer e.g. to http://www.cmake.org/Wiki/CMake_FAQ#What_is_an_.22out-of-source.22_build.3F for advantages of o ut of source builds.")
endif ()
# XXX remove files triggering the below check to prevent every developer from
# needing manual manual work. We will remove this after some time to have a
# clean build system without file modifications in the source tree again.
set(OOSB_FILES "${PROJECT_SOURCE_DIR}/rtdata/rawtherapee.desktop" "${PROJECT_SOURCE_DIR}/rtgui/version.h" "${PROJECT_SOURCE_DIR}/rtgui/config.h" "${PROJECT_SOURCE_DIR}/AboutThisBuild.txt")
if (OUT_OF_SOURCE_BUILD)
foreach(f ${OOSB_FILES})
file (REMOVE "${f}")
endforeach(f)
endif ()
# check for generated files in the source tree which should not be there when
# doing out of source builds. Without checking for this it might happen that old
# versions are used for the compilation
if (OUT_OF_SOURCE_BUILD)
foreach(f ${OOSB_FILES})
if (EXISTS "${f}")
message (SEND_ERROR "Generated \"${f}\" found inside the source tree. Please remove it as it is a relic of the old build system and prevents valid compilation now.")
endif ()
endforeach(f)
endif ()
install (FILES AUTHORS.txt DESTINATION "${CREDITSDIR}")
install (FILES LICENSE.txt DESTINATION "${LICENCEDIR}")
install (FILES "${CMAKE_BINARY_DIR}/AboutThisBuild.txt" DESTINATION "${CREDITSDIR}")
install (FILES RELEASE_NOTES.txt DESTINATION "${CREDITSDIR}" OPTIONAL)
if (UNIX) if (UNIX)
install (FILES ${CMAKE_CURRENT_SOURCE_DIR}/doc/manpage/rawtherapee.1 DESTINATION ${CMAKE_INSTALL_PREFIX}/share/man/man1) install (FILES "${PROJECT_SOURCE_DIR}/doc/manpage/rawtherapee.1" DESTINATION "${CMAKE_INSTALL_PREFIX}/share/man/man1")
endif (UNIX) endif (UNIX)
add_subdirectory (rtexif) add_subdirectory (rtexif)

View File

@@ -41,6 +41,21 @@ Preamble
4. The repository is now ready to be made into a public tarball: hg archive 4. The repository is now ready to be made into a public tarball: hg archive
"rawtherapee-4.0.10.tar" -X ".hg*" && xz -z -9e -T 8 "rawtherapee-4.0.10.tar" "rawtherapee-4.0.10.tar" -X ".hg*" && xz -z -9e -T 8 "rawtherapee-4.0.10.tar"
The build system especially encourages to perform out-of-source builds. This
means that the CMake project is generated in a folder which is not in the
source tree of RawTherapee. This way the source tree stays clean all the time
and multiple different compilation settings can be maintained in parallel
using different binary folders. Further information about out-of-source builds
can be found here:
http://www.cmake.org/Wiki/CMake_FAQ#What_is_an_.22out-of-source.22_build.3F
If an in-source build is performed, the CMake logic now warns about this but
does not fail. Especially important for clean out-of-source builds is that the
CMake code does not generate files inside the source tree, e.g. when using
configure_file. Please keep this in mind when altering the CMake files.
Windows Windows
------- -------
@@ -242,10 +257,12 @@ Windows
Compile: Compile:
- Start an MSYS command line interface, - Start an MSYS command line interface,
- Enter the root directory of the RawTherapee source tree: - Enter a new empty folder outside RawTherapee's source directory:
cd /C/Absolute/Path/To/RawTherapee_sourceTree cd /C/Absolute/Path/To/RawTherapee_sourceTree
mkdir build
cd build
- Type: - Type:
cmake -G "MSYS Makefiles" -DCMAKE_BUILD_TYPE=Release -Ccmo.txt . cmake -G "MSYS Makefiles" -DCMAKE_BUILD_TYPE=Release -Ccmo.txt <path to the source directory, if done as above '..'>
- Type: - Type:
make install make install
- You'll find the compiled program in the subdirectory named like the - You'll find the compiled program in the subdirectory named like the
@@ -260,8 +277,10 @@ Windows
Compile: Compile:
- Start a standard DOS command prompt (WIN+R > cmd), - Start a standard DOS command prompt (WIN+R > cmd),
- Enter the root directory of the RawTherapee source tree: - Enter a new empty folder outside RawTherapee's source directory:
cd C:\Absolute\Path\To\RawTherapee_sourceTree cd /C/Absolute/Path/To/RawTherapee_sourceTree
mkdir build
cd build
If you want to upload a build, you should set some additional If you want to upload a build, you should set some additional
information about your processor. There are two possibilities: information about your processor. There are two possibilities:
@@ -306,12 +325,15 @@ Linux
sudo apt-get install build-essential cmake libbz2-dev libexiv2-dev libexpat1-dev libglib2.0-dev libglibmm-2.4-dev libgtk2.0-dev libgtkmm-2.4-dev libiptcdata-dev libjpeg8-dev liblcms2-dev libpng-dev libsigc++-2.0-dev libtiff-dev mercurial zlib1g-dev sudo apt-get install build-essential cmake libbz2-dev libexiv2-dev libexpat1-dev libglib2.0-dev libglibmm-2.4-dev libgtk2.0-dev libgtkmm-2.4-dev libiptcdata-dev libjpeg8-dev liblcms2-dev libpng-dev libsigc++-2.0-dev libtiff-dev mercurial zlib1g-dev
Compile: Compile:
- Enter the root directory of the RawTherapee source tree - Create and enter a new empty folder outside RawTherapee's source directory:
mkdir ~/rt-build
cd ~/rt-build
- Type: - Type:
cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=./release -DBINDIR=. -DDATADIR=. -DLIBDIR=. cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=./release -DBINDIR=. -DDATADIR=. -DLIBDIR=. <path to source directory>
Developers who want to provide a public build have to set the PROC_LABEL Developers who want to provide a public build have to set the PROC_LABEL
to their processor name, e.g.: to their processor name, e.g.:
cmake -DPROC_LABEL:STRING=athlon64 -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=./release -DBINDIR=. -DDATADIR=. -DLIBDIR=. cmake -DPROC_LABEL:STRING=athlon64 -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=./release -DBINDIR=. -DDATADIR=. -DLIBDIR=. <path to source directory>
- Type: - Type:
make install make install
- You'll find the compiled program in the subdirectory named like the value - You'll find the compiled program in the subdirectory named like the value
@@ -333,9 +355,10 @@ Linux
Enter this URL: Enter this URL:
https://rawtherapee.googlecode.com/hg https://rawtherapee.googlecode.com/hg
Enter the root directory of the RawTherapee source tree from a terminal Create and enter a new empty folder outside RawTherapee's source directory.
window. Configure the source for Eclipse with: Configure the source for Eclipse with:
cmake -G "Eclipse CDT4 - Unix Makefiles" -DCMAKE_INSTALL_PREFIX=./release -DBINDIR=. -DDATADIR=. -DLIBDIR=. -DCMAKE_BUILD_TYPE=Release cmake -G "Eclipse CDT4 - Unix Makefiles" -DCMAKE_INSTALL_PREFIX=./release -DBINDIR=. -DDATADIR=. -DLIBDIR=. -DCMAKE_BUILD_TYPE=Release <path to source directory>
If you want to upload a build, you should set some additional information If you want to upload a build, you should set some additional information
about your processor. There are two possibilities: about your processor. There are two possibilities:
@@ -382,9 +405,9 @@ OS X
Compile: Compile:
- Enter the root directory of the RawTherapee source tree - Enter the root directory of the RawTherapee source tree
- To enable OpenMP, assuming you have installed gcc45), type: - To enable OpenMP, assuming you have installed gcc45), type:
cmake -D CMAKE_C_COMPILER=gcc-mp-4.5 -D CMAKE_CXX_COMPILER=g++-mp-4.5 . cmake -D CMAKE_C_COMPILER=gcc-mp-4.5 -D CMAKE_CXX_COMPILER=g++-mp-4.5 <path to source directory>
OR to disable OpenMP and use the default compiler, type: OR to disable OpenMP and use the default compiler, type:
cmake -D OPTION_OMP=false . cmake -D OPTION_OMP=false <path to source directory>
If you want to upload a build, you should set some additional information If you want to upload a build, you should set some additional information
about your processor. There are two possibilities: about your processor. There are two possibilities:

View File

@@ -18,25 +18,24 @@ else (WIN32)
endif (WIN32) endif (WIN32)
if (UNIX) if (UNIX)
configure_file (${CMAKE_CURRENT_SOURCE_DIR}/icons/rawtherapee.desktop.in ${CMAKE_CURRENT_BINARY_DIR}/rawtherapee.desktop) configure_file ("${CMAKE_CURRENT_SOURCE_DIR}/icons/rawtherapee.desktop.in" "${CMAKE_CURRENT_BINARY_DIR}/rawtherapee.desktop")
install (FILES ${CMAKE_CURRENT_BINARY_DIR}/rawtherapee.desktop DESTINATION ${DESKTOPDIR}) install (FILES "${CMAKE_CURRENT_BINARY_DIR}/rawtherapee.desktop" DESTINATION ${DESKTOPDIR})
install (FILES ${CMAKE_CURRENT_SOURCE_DIR}/icons/hi16-app-rawtherapee.png DESTINATION ${ICONSDIR}/hicolor/16x16/apps RENAME rawtherapee.png) install (FILES "${CMAKE_CURRENT_SOURCE_DIR}/icons/hi16-app-rawtherapee.png" DESTINATION "${ICONSDIR}/hicolor/16x16/apps" RENAME rawtherapee.png)
install (FILES ${CMAKE_CURRENT_SOURCE_DIR}/icons/hi24-app-rawtherapee.png DESTINATION ${ICONSDIR}/hicolor/24x24/apps RENAME rawtherapee.png) install (FILES "${CMAKE_CURRENT_SOURCE_DIR}/icons/hi24-app-rawtherapee.png" DESTINATION "${ICONSDIR}/hicolor/24x24/apps" RENAME rawtherapee.png)
install (FILES ${CMAKE_CURRENT_SOURCE_DIR}/icons/hi32-app-rawtherapee.png DESTINATION ${ICONSDIR}/hicolor/32x32/apps RENAME rawtherapee.png) install (FILES "${CMAKE_CURRENT_SOURCE_DIR}/icons/hi32-app-rawtherapee.png" DESTINATION "${ICONSDIR}/hicolor/32x32/apps" RENAME rawtherapee.png)
install (FILES ${CMAKE_CURRENT_SOURCE_DIR}/icons/hi48-app-rawtherapee.png DESTINATION ${ICONSDIR}/hicolor/48x48/apps RENAME rawtherapee.png) install (FILES "${CMAKE_CURRENT_SOURCE_DIR}/icons/hi48-app-rawtherapee.png" DESTINATION "${ICONSDIR}/hicolor/48x48/apps" RENAME rawtherapee.png)
install (FILES ${CMAKE_CURRENT_SOURCE_DIR}/icons/hi128-app-rawtherapee.png DESTINATION ${ICONSDIR}/hicolor/128x128/apps RENAME rawtherapee.png) install (FILES "${CMAKE_CURRENT_SOURCE_DIR}/icons/hi128-app-rawtherapee.png" DESTINATION "${ICONSDIR}/hicolor/128x128/apps" RENAME rawtherapee.png)
install (FILES ${CMAKE_CURRENT_SOURCE_DIR}/icons/hi256-app-rawtherapee.png DESTINATION ${ICONSDIR}/hicolor/256x256/apps RENAME rawtherapee.png) install (FILES "${CMAKE_CURRENT_SOURCE_DIR}/icons/hi256-app-rawtherapee.png" DESTINATION "${ICONSDIR}/hicolor/256x256/apps" RENAME rawtherapee.png)
endif (UNIX) endif (UNIX)
install (FILES ${IMAGEFILES} DESTINATION ${DATADIR}/images) install (FILES ${IMAGEFILES} DESTINATION "${DATADIR}/images")
install (FILES ${LANGUAGEFILES} DESTINATION ${DATADIR}/languages) install (FILES ${LANGUAGEFILES} DESTINATION "${DATADIR}/languages")
install (FILES ${PROFILEFILES} DESTINATION ${DATADIR}/profiles) install (FILES ${PROFILEFILES} DESTINATION "${DATADIR}/profiles")
install (FILES ${SOUNDFILES} DESTINATION ${DATADIR}/sounds) install (FILES ${SOUNDFILES} DESTINATION "${DATADIR}/sounds")
install (FILES ${INPUTICCFILES} DESTINATION ${DATADIR}/iccprofiles/input) install (FILES ${INPUTICCFILES} DESTINATION "${DATADIR}/iccprofiles/input")
install (FILES ${OUTPUTICCFILES} DESTINATION ${DATADIR}/iccprofiles/output) install (FILES ${OUTPUTICCFILES} DESTINATION "${DATADIR}/iccprofiles/output")
install (FILES ${DCPFILES} DESTINATION ${DATADIR}/dcpprofiles) install (FILES ${DCPFILES} DESTINATION "${DATADIR}/dcpprofiles")
install (DIRECTORY ${THEMEDIR} DESTINATION ${DATADIR}) install (DIRECTORY ${THEMEDIR} DESTINATION "${DATADIR}")
install (DIRECTORY ${IMAGESDIR} DESTINATION ${DATADIR} FILES_MATCHING PATTERN "index.theme") install (DIRECTORY ${IMAGESDIR} DESTINATION "${DATADIR}" FILES_MATCHING PATTERN "index.theme")
install (DIRECTORY ${IMAGESDIR} DESTINATION ${DATADIR} FILES_MATCHING PATTERN "*.png") install (DIRECTORY ${IMAGESDIR} DESTINATION "${DATADIR}" FILES_MATCHING PATTERN "*.png")
install (FILES ${OPTIONSFILE} DESTINATION ${DATADIR} PERMISSIONS OWNER_WRITE OWNER_READ GROUP_READ WORLD_READ RENAME options) install (FILES ${OPTIONSFILE} DESTINATION "${DATADIR}" PERMISSIONS OWNER_WRITE OWNER_READ GROUP_READ WORLD_READ RENAME options)

View File

@@ -1,7 +1,7 @@
include_directories (${EXTRA_INCDIR} ${GTHREAD_INCLUDE_DIRS} ${GOBJECT_INCLUDE_DIRS} ${GLIB2_INCLUDE_DIRS} include_directories (${EXTRA_INCDIR} ${GTHREAD_INCLUDE_DIRS} ${GOBJECT_INCLUDE_DIRS} ${GLIB2_INCLUDE_DIRS}
${GLIBMM_INCLUDE_DIRS} ${IPTCDATA_INCLUDE_DIRS} ${LCMS_INCLUDE_DIRS} ${EXPAT_INCLUDE_DIRS} ${GLIBMM_INCLUDE_DIRS} ${IPTCDATA_INCLUDE_DIRS} ${LCMS_INCLUDE_DIRS} ${EXPAT_INCLUDE_DIRS}
${GTKMM_INCLUDE_DIRS} ${GTK_INCLUDE_DIRS}) ${GTKMM_INCLUDE_DIRS} ${GTK_INCLUDE_DIRS})
link_directories (${CMAKE_CURRENT_SOURCE_DIR}/../rtexif ${EXTRA_LIBDIR} ${GTHREAD_LIBRARY_DIRS} link_directories ("${PROJECT_SOURCE_DIR}/rtexif" ${EXTRA_LIBDIR} ${GTHREAD_LIBRARY_DIRS}
${GOBJECT_LIBRARY_DIRS} ${GLIB2_LIBRARY_DIRS} ${GLIBMM_LIBRARY_DIRS} ${GOBJECT_LIBRARY_DIRS} ${GLIB2_LIBRARY_DIRS} ${GLIBMM_LIBRARY_DIRS}
${IPTCDATA_LIBRARY_DIRS} ${LCMS_LIBRARY_DIRS} ${EXPAT_LIBRARY_DIRS}) ${IPTCDATA_LIBRARY_DIRS} ${LCMS_LIBRARY_DIRS} ${EXPAT_LIBRARY_DIRS})
@@ -19,6 +19,8 @@ set (RTENGINESOURCEFILES safegtk.cc colortemp.cc curves.cc flatcurves.cc diagona
klt/storeFeatures.cc klt/trackFeatures.cc klt/writeFeatures.cc klt/storeFeatures.cc klt/trackFeatures.cc klt/writeFeatures.cc
) )
include_directories (BEFORE "${CMAKE_CURRENT_BINARY_DIR}")
add_library (rtengine ${RTENGINESOURCEFILES}) add_library (rtengine ${RTENGINESOURCEFILES})
#It may be nice to store library version too #It may be nice to store library version too
IF (BUILD_SHARED_LIBS) IF (BUILD_SHARED_LIBS)

View File

@@ -5,7 +5,7 @@ IF (WIN32)
set_target_properties (rtexif PROPERTIES COMPILE_FLAGS " -ffast-math -fexpensive-optimizations") set_target_properties (rtexif PROPERTIES COMPILE_FLAGS " -ffast-math -fexpensive-optimizations")
include_directories (${EXTRA_INCDIR} ${GLIB2_INCLUDE_DIRS} ${GLIBMM_INCLUDE_DIRS} include_directories (${EXTRA_INCDIR} ${GLIB2_INCLUDE_DIRS} ${GLIBMM_INCLUDE_DIRS}
${GTK_INCLUDE_DIRS} ${GTKMM_INCLUDE_DIRS}) ${GTK_INCLUDE_DIRS} ${GTKMM_INCLUDE_DIRS})
link_directories (. ../rtexif ${EXTRA_LIBDIR} ${GLIB2_LIBRARY_DIRS} ${GLIBMM_LIBRARY_DIRS} link_directories (. "${PROJECT_SOURCE_DIR}/rtexif" ${EXTRA_LIBDIR} ${GLIB2_LIBRARY_DIRS} ${GLIBMM_LIBRARY_DIRS}
${GTK_LIBRARY_DIRS} ${GTKMM_LIBRARY_DIRS}) ${GTK_LIBRARY_DIRS} ${GTKMM_LIBRARY_DIRS})
#set_target_properties (rth PROPERTIES LINK_FLAGS "-mwindows") #set_target_properties (rth PROPERTIES LINK_FLAGS "-mwindows")
ELSE (WIN32) ELSE (WIN32)

View File

@@ -30,12 +30,14 @@ set (BASESOURCEFILES
dirpyrequalizer.cc hsvequalizer.cc defringe.cc dirpyrequalizer.cc hsvequalizer.cc defringe.cc
popupcommon.cc popupbutton.cc popuptogglebutton.cc sharpenedge.cc sharpenmicro.cc) popupcommon.cc popupbutton.cc popuptogglebutton.cc sharpenedge.cc sharpenmicro.cc)
include_directories (BEFORE "${CMAKE_CURRENT_BINARY_DIR}")
if (WIN32) if (WIN32)
set (EXTRA_SRC windirmonitor.cc myicon.rc) set (EXTRA_SRC windirmonitor.cc myicon.rc)
set (EXTRA_LIB_RTGUI winmm) set (EXTRA_LIB_RTGUI winmm)
include_directories (${EXTRA_INCDIR} ${GLIB2_INCLUDE_DIRS} ${GLIBMM_INCLUDE_DIRS} include_directories (${EXTRA_INCDIR} ${GLIB2_INCLUDE_DIRS} ${GLIBMM_INCLUDE_DIRS}
${GTK_INCLUDE_DIRS} ${GTKMM_INCLUDE_DIRS} ${GIO_INCLUDE_DIRS} ${GIOMM_INCLUDE_DIRS}) ${GTK_INCLUDE_DIRS} ${GTKMM_INCLUDE_DIRS} ${GIO_INCLUDE_DIRS} ${GIOMM_INCLUDE_DIRS})
link_directories (. ../rtexif ${EXTRA_LIBDIR} ${GLIB2_LIBRARY_DIRS} ${GLIBMM_LIBRARY_DIRS} link_directories (. "${PROJECT_SOURCE_DIR}/rtexif" ${EXTRA_LIBDIR} ${GLIB2_LIBRARY_DIRS} ${GLIBMM_LIBRARY_DIRS}
${GTK_LIBRARY_DIRS} ${GTKMM_LIBRARY_DIRS} ${GIO_LIBRARY_DIRS} ${GIOMM_LIBRARY_DIRS}) ${GTK_LIBRARY_DIRS} ${GTKMM_LIBRARY_DIRS} ${GIO_LIBRARY_DIRS} ${GIOMM_LIBRARY_DIRS})
#set_target_properties (rth PROPERTIES LINK_FLAGS "-mwindows") #set_target_properties (rth PROPERTIES LINK_FLAGS "-mwindows")
else (WIN32) else (WIN32)
@@ -45,7 +47,7 @@ else (WIN32)
${GTK_LIBRARY_DIRS} ${GTKMM_LIBRARY_DIRS} ${GIO_LIBRARY_DIRS} ${GIOMM_LIBRARY_DIRS} ${IPTCDATA_LIBRARY_DIRS} ${LCMS_LIBRARY_DIRS} ${EXPAT_LIBRARY_DIRS} ${GTHREAD_LIBRARY_DIRS} ${GOBJECT_LIBRARY_DIRS}) ${GTK_LIBRARY_DIRS} ${GTKMM_LIBRARY_DIRS} ${GIO_LIBRARY_DIRS} ${GIOMM_LIBRARY_DIRS} ${IPTCDATA_LIBRARY_DIRS} ${LCMS_LIBRARY_DIRS} ${EXPAT_LIBRARY_DIRS} ${GTHREAD_LIBRARY_DIRS} ${GOBJECT_LIBRARY_DIRS})
endif (WIN32) endif (WIN32)
# create config.h which defines where data are stored # create config.h which defines where data are stored
configure_file (${CMAKE_CURRENT_SOURCE_DIR}/config.h.in ${CMAKE_CURRENT_SOURCE_DIR}/config.h) configure_file ("${CMAKE_CURRENT_SOURCE_DIR}/config.h.in" "${CMAKE_CURRENT_BINARY_DIR}/config.h")
add_executable (rth ${EXTRA_SRC} ${BASESOURCEFILES}) add_executable (rth ${EXTRA_SRC} ${BASESOURCEFILES})