mac:export non-relative paths to config.h

This commit is contained in:
Richard Barber 2020-02-20 01:17:49 -08:00
parent a78c4b99df
commit 9bc078c5bb
4 changed files with 26 additions and 15 deletions

View File

@ -168,7 +168,7 @@ endif()
if(NOT DEFINED DATADIR) if(NOT DEFINED DATADIR)
if(BUILD_BUNDLE) if(BUILD_BUNDLE)
if(APPLE) if(APPLE)
set(DATADIR "/Applications/RawTherapee.app/Contents/Resources") set(DATADIR "../Resources/share")
else() else()
set(DATADIR .) set(DATADIR .)
endif() endif()
@ -180,7 +180,7 @@ endif()
if(NOT DEFINED LIBDIR) if(NOT DEFINED LIBDIR)
if(BUILD_BUNDLE) if(BUILD_BUNDLE)
if(APPLE) if(APPLE)
set(LIBDIR "/Applications/RawTherapee.app/Contents/Frameworks") set(LIBDIR "../Frameworks")
else() else()
set(LIBDIR .) set(LIBDIR .)
endif() endif()

View File

@ -195,4 +195,8 @@ target_link_libraries(rtengine rtexif
${KLT_LIBRARIES} ${KLT_LIBRARIES}
) )
if(APPLE)
install(FILES ${CAMCONSTSFILE} DESTINATION "${CMAKE_INSTALL_PREFIX}/RawTherapee.app/Contents/Resources" PERMISSIONS OWNER_WRITE OWNER_READ GROUP_READ WORLD_READ)
else()
install(FILES ${CAMCONSTSFILE} DESTINATION "${DATADIR}" PERMISSIONS OWNER_WRITE OWNER_READ GROUP_READ WORLD_READ) install(FILES ${CAMCONSTSFILE} DESTINATION "${DATADIR}" PERMISSIONS OWNER_WRITE OWNER_READ GROUP_READ WORLD_READ)
endif()

View File

@ -22,10 +22,19 @@
#cmakedefine BUILD_BUNDLE #cmakedefine BUILD_BUNDLE
#cmakedefine HAVE_UNALIGNED_MALLOC #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 LENSFUN_DB_PATH "${LENSFUNDBDIR}"
#else
#define DATA_SEARCH_PATH "${DATADIR}" #define DATA_SEARCH_PATH "${DATADIR}"
#define DOC_SEARCH_PATH "${DOCDIR}" #define DOC_SEARCH_PATH "${DOCDIR}"
#define CREDITS_SEARCH_PATH "${CREDITSDIR}" #define CREDITS_SEARCH_PATH "${CREDITSDIR}"
#define LICENCE_SEARCH_PATH "${LICENCEDIR}" #define LICENCE_SEARCH_PATH "${LICENCEDIR}"
#define LENSFUN_DB_PATH "${LENSFUNDBDIR}" #define LENSFUN_DB_PATH "${LENSFUNDBDIR}"
#endif
#endif #endif

View File

@ -110,7 +110,7 @@ EXPATLIB="$(cmake .. -LA -N | grep "pkgcfg_lib_EXPAT_expat" | cut -d "=" -f2)"
CODESIGNID="$(cmake .. -LA -N | grep "CODESIGNID" | cut -d "=" -f2)" CODESIGNID="$(cmake .. -LA -N | grep "CODESIGNID" | cut -d "=" -f2)"
NOTARY="$(cmake .. -LA -N | grep "NOTARY" | cut -d "=" -f2)" NOTARY="$(cmake .. -LA -N | grep "NOTARY" | cut -d "=" -f2)"
FANCY_DMG="$(cmake .. -LA -N | grep "FANCY_DMG" | cut -d "=" -f2)" FANCY_DMG="$(cmake .. -LA -N | grep "FANCY_DMG" | cut -d "=" -f2)"
echo ${FANCY_DMG} || echo "Building plain .dmg" echo ${FANCY_DMG}
APP="${PROJECT_NAME}.app" APP="${PROJECT_NAME}.app"
CONTENTS="${APP}/Contents" CONTENTS="${APP}/Contents"
@ -125,17 +125,14 @@ msg "Removing old files:"
rm -rf "${APP}" *.dmg *.zip rm -rf "${APP}" *.dmg *.zip
msg "Creating bundle container:" msg "Creating bundle container:"
install -d "${RESOURCES}" \ install -d "${APP}" "${RESOURCES}" "${MACOS}" "${LIB}" "${ETC}"
"${MACOS}" \
"${LIB}" \
"${ETC}"
echo "\n--------\n" >> "${CMAKE_BUILD_TYPE}"/Resources/AboutThisBuild.txt 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 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 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 date: $(date -Ru) ZULU" >> "${CMAKE_BUILD_TYPE}/Resources/AboutThisBuild.txt"
echo "Bundle epoch: $(date +%s)" >> "${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 echo "Bundle UUID: $(uuidgen|tr 'A-Z' 'a-z')" >> "${CMAKE_BUILD_TYPE}/Resources/AboutThisBuild.txt"
msg "Copying binary executable files." msg "Copying binary executable files."
ditto "${CMAKE_BUILD_TYPE}/MacOS" "${MACOS}" ditto "${CMAKE_BUILD_TYPE}/MacOS" "${MACOS}"
@ -318,8 +315,8 @@ function CreateWebloc {
defaults write "${srcDir}/$1" URL "$2" defaults write "${srcDir}/$1" URL "$2"
mv "${srcDir}/$1".{plist,webloc} mv "${srcDir}/$1".{plist,webloc}
} }
CreateWebloc 'Website' 'http://www.rawtherapee.com/' CreateWebloc 'Website' 'https://www.rawtherapee.com/'
CreateWebloc 'Manual' 'http://rawpedia.rawtherapee.com/' CreateWebloc 'Manual' 'https://rawpedia.rawtherapee.com/'
# Disk image name # Disk image name
dmg_name="${PROJECT_NAME// /_}_OSX_${MINIMUM_SYSTEM_VERSION}_${PROC_BIT_DEPTH}_${PROJECT_FULL_VERSION}" dmg_name="${PROJECT_NAME// /_}_OSX_${MINIMUM_SYSTEM_VERSION}_${PROC_BIT_DEPTH}_${PROJECT_FULL_VERSION}"
@ -374,3 +371,4 @@ msg "Finishing build:"
echo "Script complete." echo "Script complete."
# #
# TODO filter out the benign errors # TODO filter out the benign errors
# Build a fancy dmg