New CMAKE bundle option
on behalf of L.Jirkovsky, see issue 184
This commit is contained in:
@@ -62,61 +62,74 @@ option (WITH_RAWZOR "Build with Rawzor support" OFF)
|
||||
option (WITH_BZIP "Build with Bzip2 support" ON)
|
||||
option (WITH_MYFILE_MMAP "Build using memory mapped file" ON)
|
||||
option (OPTION_OMP "Build with OpenMP support" ON)
|
||||
option (BUILD_BUNDLE "Self-contained build" OFF)
|
||||
|
||||
# set install directories
|
||||
if (NOT DEFINED DATADIR)
|
||||
if (WIN32 OR APPLE)
|
||||
set (DATADIR ${CMAKE_CURRENT_SOURCE_DIR}/release)
|
||||
else (WIN32 OR APPLE)
|
||||
set (DATADIR ${CMAKE_INSTALL_PREFIX}/share/rawtherapee)
|
||||
endif (WIN32 OR APPLE)
|
||||
endif (NOT DEFINED DATADIR)
|
||||
if (WIN32 OR APPLE)
|
||||
set (BUILD_BUNDLE ON FORCE)
|
||||
endif(WIN32 OR APPLE)
|
||||
|
||||
if (BUILD_BUNDLE)
|
||||
set (BINDIR .)
|
||||
set (CMAKE_INSTALL_PREFIX ${CMAKE_CURRENT_SOURCE_DIR}/${CMAKE_BUILD_TYPE})
|
||||
endif (BUILD_BUNDLE)
|
||||
|
||||
if (NOT DEFINED BINDIR)
|
||||
if (WIN32 OR APPLE)
|
||||
set (BINDIR ${CMAKE_CURRENT_SOURCE_DIR}/release)
|
||||
else (WIN32 OR APPLE)
|
||||
set (BINDIR ${CMAKE_INSTALL_PREFIX}/bin)
|
||||
endif (WIN32 OR APPLE)
|
||||
set (BINDIR ${CMAKE_INSTALL_PREFIX}/bin)
|
||||
endif (NOT DEFINED BINDIR)
|
||||
|
||||
if (NOT DEFINED DATADIR)
|
||||
if (BUILD_BUNDLE)
|
||||
set (DATADIR .)
|
||||
else (BUILD_BUNDLE)
|
||||
set (DATADIR ${CMAKE_INSTALL_PREFIX}/share/rawtherapee)
|
||||
endif (BUILD_BUNDLE)
|
||||
endif (NOT DEFINED DATADIR)
|
||||
|
||||
if (NOT DEFINED LIBDIR)
|
||||
if (WIN32 OR APPLE)
|
||||
set (LIBDIR ${CMAKE_CURRENT_SOURCE_DIR}/release)
|
||||
else (WIN32 OR APPLE)
|
||||
if (BUILD_BUNDLE)
|
||||
set (LIBDIR .)
|
||||
else (BUILD_BUNDLE)
|
||||
# Respect CMAKE_INSTALL_LIBDIR if set
|
||||
if (DEFINED CMAKE_INSTALL_LIBDIR)
|
||||
set (LIBDIR ${CMAKE_INSTALL_LIBDIR})
|
||||
else (DEFINED CMAKE_INSTALL_LIBDIR)
|
||||
set (LIBDIR ${CMAKE_INSTALL_PREFIX}/lib)
|
||||
endif (DEFINED CMAKE_INSTALL_LIBDIR)
|
||||
endif (WIN32 OR APPLE)
|
||||
endif (BUILD_BUNDLE)
|
||||
endif (NOT DEFINED LIBDIR)
|
||||
|
||||
if (NOT DEFINED DOCDIR)
|
||||
if (WIN32 OR APPLE)
|
||||
set (DOCDIR ${CMAKE_CURRENT_SOURCE_DIR}/release/doc)
|
||||
else (WIN32 OR APPLE)
|
||||
set (DOCDIR ${CMAKE_INSTALL_PREFIX}/share/doc)
|
||||
endif (WIN32 OR APPLE)
|
||||
if (BUILD_BUNDLE)
|
||||
set (DOCDIR ./doc)
|
||||
else (BUILD_BUNDLE)
|
||||
set (DOCDIR ${CMAKE_INSTALL_PREFIX}/share/doc/rawtherapee)
|
||||
endif (BUILD_BUNDLE)
|
||||
endif (NOT DEFINED DOCDIR)
|
||||
|
||||
if (NOT DEFINED CREDITSDIR)
|
||||
if (WIN32 OR APPLE)
|
||||
set (CREDITSDIR ${CMAKE_CURRENT_SOURCE_DIR}/release)
|
||||
else (WIN32 OR APPLE)
|
||||
set (CREDITSDIR ${CMAKE_INSTALL_PREFIX}/share/doc)
|
||||
endif (WIN32 OR APPLE)
|
||||
if (BUILD_BUNDLE)
|
||||
set (CREDITSDIR .)
|
||||
else (BUILD_BUNDLE)
|
||||
set (CREDITSDIR ${CMAKE_INSTALL_PREFIX}/share/doc/rawtherapee)
|
||||
endif (BUILD_BUNDLE)
|
||||
endif (NOT DEFINED CREDITSDIR)
|
||||
|
||||
if (NOT DEFINED LICENCEDIR)
|
||||
if (WIN32 OR APPLE)
|
||||
set (LICENCEDIR ${CMAKE_CURRENT_SOURCE_DIR}/release)
|
||||
else (WIN32 OR APPLE)
|
||||
set (LICENCEDIR ${CMAKE_INSTALL_PREFIX}/share/doc)
|
||||
endif (WIN32 OR APPLE)
|
||||
if (BUILD_BUNDLE)
|
||||
set (LICENCEDIR .)
|
||||
else (BUILD_BUNDLE)
|
||||
set (LICENCEDIR ${CMAKE_INSTALL_PREFIX}/share/doc/rawtherapee)
|
||||
endif (BUILD_BUNDLE)
|
||||
endif (NOT DEFINED LICENCEDIR)
|
||||
|
||||
# non-bundle builds has to use absolute paths
|
||||
if (NOT BUILD_BUNDLE 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}))
|
||||
message (FATAL_ERROR "The paths has to be absolute or use -DBUILD_BUNDLE=ON")
|
||||
endif ()
|
||||
|
||||
# check for libraries
|
||||
find_package(PkgConfig)
|
||||
pkg_check_modules (GTK REQUIRED gtk+-2.0>=2.12)
|
||||
@@ -314,10 +327,6 @@ if (OPTION_OMP)
|
||||
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 ${CREDITSDIR})
|
||||
|
Reference in New Issue
Block a user