diff --git a/CMakeLists.txt b/CMakeLists.txt index 403314b07..00604052e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -150,15 +150,20 @@ endif() if(NOT DEFINED BUNDLE_BASE_INSTALL_DIR) if(APPLE) - set(BUNDLE_BASE_INSTALL_DIR "${CMAKE_BUILD_TYPE}") + set(BUNDLE_BASE_INSTALL_DIR "${CMAKE_BUILD_TYPE}/MacOS") else() set(BUNDLE_BASE_INSTALL_DIR "${CMAKE_BINARY_DIR}/${CMAKE_BUILD_TYPE}") endif() endif() if(BUILD_BUNDLE) - set(BINDIR .) - set(CMAKE_INSTALL_PREFIX "${BUNDLE_BASE_INSTALL_DIR}") + if(APPLE) + set(BINDIR "${BUNDLE_BASE_INSTALL_DIR}") + set(CMAKE_INSTALL_PREFIX ".") + else() + set(BINDIR .) + set(CMAKE_INSTALL_PREFIX "${BUNDLE_BASE_INSTALL_DIR}") + endif() endif() if(NOT DEFINED BINDIR) @@ -168,7 +173,7 @@ endif() if(NOT DEFINED DATADIR) if(BUILD_BUNDLE) if(APPLE) - set(DATADIR "../Resources/share") + set(DATADIR "${CMAKE_BUILD_TYPE}/Resources/share") else() set(DATADIR .) endif() @@ -180,7 +185,7 @@ endif() if(NOT DEFINED LIBDIR) if(BUILD_BUNDLE) if(APPLE) - set(LIBDIR "../Frameworks") + set(LIBDIR "${CMAKE_BUILD_TYPE}/Frameworks") else() set(LIBDIR .) endif() diff --git a/UpdateInfo.cmake b/UpdateInfo.cmake index d1f532506..ce194bfe9 100644 --- a/UpdateInfo.cmake +++ b/UpdateInfo.cmake @@ -107,4 +107,8 @@ endif(WIN32) # build version.h from template configure_file("${PROJECT_SOURCE_DIR}/rtgui/version.h.in" "${CMAKE_BINARY_DIR}/rtgui/version.h") # build AboutThisBuild.txt from template -configure_file("${PROJECT_SOURCE_DIR}/AboutThisBuild.txt.in" "${CMAKE_BINARY_DIR}/AboutThisBuild.txt") +if(APPLE) + configure_file("${PROJECT_SOURCE_DIR}/AboutThisBuild.txt.in" "${CMAKE_BINARY_DIR}/AboutThisBuild.txt") +else() + configure_file("${PROJECT_SOURCE_DIR}/AboutThisBuild.txt.in" "${CMAKE_BINARY_DIR}/AboutThisBuild.txt") +endif() diff --git a/rtgui/config.h.in b/rtgui/config.h.in index 570f263b8..558c25f76 100644 --- a/rtgui/config.h.in +++ b/rtgui/config.h.in @@ -24,10 +24,10 @@ #cmakedefine HAVE_UNALIGNED_MALLOC #ifdef __APPLE__ -#define DATA_SEARCH_PATH "/Applications/RawTherapee.com/Contents/Resources/share" -#define DOC_SEARCH_PATH "/Applications/RawTherapee.com/Contents/Resources" -#define CREDITS_SEARCH_PATH "/Applications/RawTherapee.com/Contents/Resources" -#define LICENCE_SEARCH_PATH "/Applications/RawTherapee.com/Contents/Resources" +#define DATA_SEARCH_PATH "/Applications/RawTherapee.app/Contents/Resources/share" +#define DOC_SEARCH_PATH "/Applications/RawTherapee.app/Contents/Resources" +#define CREDITS_SEARCH_PATH "/Applications/RawTherapee.app/Contents/Resources" +#define LICENCE_SEARCH_PATH "/Applications/RawTherapee.app/Contents/Resources" #define LENSFUN_DB_PATH "${LENSFUNDBDIR}" #else #define DATA_SEARCH_PATH "${DATADIR}" diff --git a/tools/osx/macosx_bundle.sh b/tools/osx/macosx_bundle.sh index 884979aba..da44ed51e 100644 --- a/tools/osx/macosx_bundle.sh +++ b/tools/osx/macosx_bundle.sh @@ -130,19 +130,20 @@ install -d "${MACOS}" install -d "${LIB}" install -d "${ETC}" -echo "\n--------\n" >> "${CMAKE_BUILD_TYPE}/Resources/AboutThisBuild.txt" -echo "Bundle system: $(sysctl -n machdep.cpu.brand_string)" >> "${CMAKE_BUILD_TYPE}/Resources/AboutThisBuild.txt" -echo "Bundle OS: $(sw_vers -productName) $(sw_vers -productVersion) $(sw_vers -buildVersion) $(uname -mrs)" >> "${CMAKE_BUILD_TYPE}/Resources/AboutThisBuild.txt" -echo "Bundle date: $(date -Ru) ZULU" >> "${CMAKE_BUILD_TYPE}/Resources/AboutThisBuild.txt" -echo "Bundle epoch: $(date +%s)" >> "${CMAKE_BUILD_TYPE}/Resources/AboutThisBuild.txt" -echo "Bundle UUID: $(uuidgen|tr 'A-Z' 'a-z')" >> "${CMAKE_BUILD_TYPE}/Resources/AboutThisBuild.txt" - msg "Copying binary executable files." ditto "${CMAKE_BUILD_TYPE}/MacOS" "${MACOS}" msg "Copying Resources directory." +mv "${CMAKE_BUILD_TYPE}/Resources/share/AboutThisBuild.txt" ditto "${CMAKE_BUILD_TYPE}/Resources" "${RESOURCES}" +echo "\n--------\n" >> "${RESOURCES}/AboutThisBuild.txt" +echo "Bundle system: $(sysctl -n machdep.cpu.brand_string)" >> "${RESOURCES}/AboutThisBuild.txt" +echo "Bundle OS: $(sw_vers -productName) $(sw_vers -productVersion) $(sw_vers -buildVersion) $(uname -mrs)" >> "${RESOURCES}/AboutThisBuild.txt" +echo "Bundle date: $(date -Ru) ZULU" >> "${RESOURCES}/AboutThisBuild.txt" +echo "Bundle epoch: $(date +%s)" >> "${RESOURCES}/AboutThisBuild.txt" +echo "Bundle UUID: $(uuidgen|tr 'A-Z' 'a-z')" >> "${RESOURCES}/AboutThisBuild.txt" + # Copy the Lensfun database into the app bundle mkdir -p "${RESOURCES}/share/lensfun" ditto ${LOCAL_PREFIX}/local/share/lensfun/version_2/* "${RESOURCES}/share/lensfun"