mac: fix -cli and add a linker flag
This commit is contained in:
parent
9f64679fe0
commit
3bbdd89c8f
|
@ -113,14 +113,14 @@ endif()
|
||||||
|
|
||||||
if(APPLE)
|
if(APPLE)
|
||||||
if(CMAKE_CXX_COMPILER MATCHES "g\\+\\+-mp-4.[5-8]" OR CMAKE_CXX_COMPILER_ARG1 MATCHES "g\\+\\+-mp-4.[5-8]")
|
if(CMAKE_CXX_COMPILER MATCHES "g\\+\\+-mp-4.[5-8]" OR CMAKE_CXX_COMPILER_ARG1 MATCHES "g\\+\\+-mp-4.[5-8]")
|
||||||
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /usr/lib/libstdc++.6.dylib")
|
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /usr/lib/libstdc++.6.dylib -Wl,-headerpad_max_install_names -mtune=generic")
|
||||||
message(STATUS "CMAKE_CXX_COMPILER is MacPorts GCC.\n CMAKE_EXE_LINKER_FLAGS: ${CMAKE_EXE_LINKER_FLAGS}")
|
message(STATUS "CMAKE_CXX_COMPILER is MacPorts GCC.\n CMAKE_EXE_LINKER_FLAGS: ${CMAKE_EXE_LINKER_FLAGS}")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
# Set minimum system version
|
# Set minimum system version
|
||||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -mmacosx-version-min=${CMAKE_OSX_DEPLOYMENT_TARGET}")
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -mmacosx-version-min=${CMAKE_OSX_DEPLOYMENT_TARGET}")
|
||||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -mmacosx-version-min=${CMAKE_OSX_DEPLOYMENT_TARGET}")
|
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -mmacosx-version-min=${CMAKE_OSX_DEPLOYMENT_TARGET}")
|
||||||
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -headerpad_max_install_names")
|
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,-headerpad_max_install_names -mtune=generic")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
option(USE_EXPERIMENTAL_LANG_VERSIONS "Build with -std=c++0x" OFF)
|
option(USE_EXPERIMENTAL_LANG_VERSIONS "Build with -std=c++0x" OFF)
|
||||||
|
@ -270,6 +270,9 @@ if(APPLE)
|
||||||
elseif(NOT DEFINED LOCAL_PREFIX)
|
elseif(NOT DEFINED LOCAL_PREFIX)
|
||||||
set(LOCAL_PREFIX "/usr")
|
set(LOCAL_PREFIX "/usr")
|
||||||
endif()
|
endif()
|
||||||
|
if("${FANCY_DMG}")
|
||||||
|
set(FANCY_DMG ON CACHE BOOL "Use the andreyvit/create-dmg script to make a fancy .dmg")
|
||||||
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
# Enforce absolute paths for non-bundle builds:
|
# Enforce absolute paths for non-bundle builds:
|
||||||
|
|
|
@ -24,7 +24,7 @@ mark_as_advanced(MACINTEGRATION_LIBRARY)
|
||||||
# handle the QUIETLY and REQUIRED arguments and set MACINTEGRATION_FOUND to TRUE if
|
# handle the QUIETLY and REQUIRED arguments and set MACINTEGRATION_FOUND to TRUE if
|
||||||
# all listed variables are TRUE
|
# all listed variables are TRUE
|
||||||
include(FindPackageHandleStandardArgs)
|
include(FindPackageHandleStandardArgs)
|
||||||
find_package_handle_standard_args(MACINTEGRATION DEFAULT_MSG MACINTEGRATION_LIBRARY MACINTEGRATION_INCLUDE_DIR)
|
find_package_handle_standard_args(MacIntegration DEFAULT_MSG MACINTEGRATION_LIBRARY MACINTEGRATION_INCLUDE_DIR)
|
||||||
|
|
||||||
if(MACINTEGRATION_FOUND)
|
if(MACINTEGRATION_FOUND)
|
||||||
set(MacIntegration_LIBRARIES ${MACINTEGRATION_LIBRARY})
|
set(MacIntegration_LIBRARIES ${MACINTEGRATION_LIBRARY})
|
||||||
|
|
|
@ -40,11 +40,11 @@ msg "Modifying install names: ${x}"
|
||||||
{
|
{
|
||||||
# id
|
# id
|
||||||
if [ ${x:(-6)} == ".dylib" ] || [ f${x:(-3)} == ".so" ]; then
|
if [ ${x:(-6)} == ".dylib" ] || [ f${x:(-3)} == ".so" ]; then
|
||||||
install_name_tool -id @rpath/$(basename ${x}) ${x}
|
install_name_tool -id /Applications/"${LIB}"/$(basename ${x}) ${x}
|
||||||
fi
|
fi
|
||||||
GetDependencies "${x}" | while read -r y
|
GetDependencies "${x}" | while read -r y
|
||||||
do
|
do
|
||||||
install_name_tool -change ${y} @rpath/$(basename ${y}) ${x}
|
install_name_tool -change ${y} /Applications/"${LIB}"/$(basename ${y}) ${x}
|
||||||
done
|
done
|
||||||
} | bash -v
|
} | bash -v
|
||||||
done
|
done
|
||||||
|
@ -109,6 +109,8 @@ LOCAL_PREFIX="$(cmake .. -LA -N | grep "LOCAL_PREFIX" | cut -d "=" -f2)"
|
||||||
EXPATLIB="$(cmake .. -LA -N | grep "pkgcfg_lib_EXPAT_expat" | cut -d "=" -f2)"
|
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)"
|
||||||
|
echo ${FANCY_DMG} || echo "Building plain .dmg"
|
||||||
|
|
||||||
APP="${PROJECT_NAME}.app"
|
APP="${PROJECT_NAME}.app"
|
||||||
CONTENTS="${APP}/Contents"
|
CONTENTS="${APP}/Contents"
|
||||||
|
@ -251,7 +253,7 @@ ditto {"${LOCAL_PREFIX}/local","${RESOURCES}"}/share/glib-2.0/schemas
|
||||||
|
|
||||||
# Append an LC_RPATH
|
# Append an LC_RPATH
|
||||||
msg "Registering @rpath into the main executable."
|
msg "Registering @rpath into the main executable."
|
||||||
install_name_tool -add_rpath ${LIB} ${EXECUTABLE}
|
install_name_tool -add_rpath /Applications/"${LIB}" ${EXECUTABLE}
|
||||||
|
|
||||||
ModifyInstallNames
|
ModifyInstallNames
|
||||||
|
|
||||||
|
@ -259,7 +261,7 @@ ModifyInstallNames
|
||||||
msg "Registering @rpath in Frameworks folder."
|
msg "Registering @rpath in Frameworks folder."
|
||||||
for frameworklibs in "${LIB}"/*{dylib,so} ; do
|
for frameworklibs in "${LIB}"/*{dylib,so} ; do
|
||||||
install_name_tool -delete_rpath ${LOCAL_PREFIX}/local/lib ${frameworklibs}
|
install_name_tool -delete_rpath ${LOCAL_PREFIX}/local/lib ${frameworklibs}
|
||||||
install_name_tool -add_rpath "${LIB}" ${frameworklibs}
|
install_name_tool -add_rpath /Applications/"${LIB}" ${frameworklibs}
|
||||||
done
|
done
|
||||||
install_name_tool -delete_rpath RawTherapee.app/Contents/Frameworks "${EXECUTABLE}"-cli
|
install_name_tool -delete_rpath RawTherapee.app/Contents/Frameworks "${EXECUTABLE}"-cli
|
||||||
install_name_tool -add_rpath @executable_path "${EXECUTABLE}"-cli
|
install_name_tool -add_rpath @executable_path "${EXECUTABLE}"-cli
|
||||||
|
@ -370,3 +372,5 @@ rm -rf "${srcDir}"
|
||||||
CreateDmg
|
CreateDmg
|
||||||
msg "Finishing build:"
|
msg "Finishing build:"
|
||||||
echo "Script complete."
|
echo "Script complete."
|
||||||
|
#
|
||||||
|
# TODO filter out the benign errors
|
||||||
|
|
Loading…
Reference in New Issue