forked from freesurfer/freesurfer
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
96 additions
and
85 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,45 +1,35 @@ | ||
# Qt Find Module | ||
|
||
# default search path | ||
if(USE_QT4) | ||
set(PACKAGES_QT ${FS_PACKAGES_DIR}/qt/4.8.5) | ||
if(NOT QT_QMAKE_EXECUTABLE AND EXISTS ${PACKAGES_QT}) | ||
set(QT_INSTALL_DIR ${PACKAGES_QT}) | ||
set(QT_QMAKE_EXECUTABLE ${QT_INSTALL_DIR}/bin/qmake) | ||
if(NOT Qt5_DIR) | ||
# default search path | ||
if(EXISTS ${FS_PACKAGES_DIR}/qt/5.11/lib/cmake/Qt5) | ||
set(Qt5_DIR ${FS_PACKAGES_DIR}/qt/5.11/lib/cmake/Qt5) | ||
elseif(EXISTS ${FS_PACKAGES_DIR}/qt/5.6/lib/cmake/Qt5) | ||
set(Qt5_DIR ${FS_PACKAGES_DIR}/qt/5.6/lib/cmake/Qt5) | ||
endif() | ||
else() | ||
set(PACKAGES_QT ${FS_PACKAGES_DIR}/qt/5.6/lib/cmake/Qt5) | ||
if(NOT Qt5_DIR AND EXISTS ${PACKAGES_QT}) | ||
set(Qt5_DIR ${PACKAGES_QT}) | ||
endif() | ||
get_filename_component(QT_INSTALL_DIR "${Qt5_DIR}/../../.." ABSOLUTE) | ||
endif() | ||
get_filename_component(QT_INSTALL_DIR "${Qt5_DIR}/../../.." ABSOLUTE) | ||
|
||
# find Qt components and trace back root of install | ||
if(USE_QT4) | ||
set(QT_COMPONENTS QtCore QtGui) | ||
find_package(Qt4 COMPONENTS ${QT_COMPONENTS}) | ||
else() | ||
set(QT_COMPONENTS Core Widgets) | ||
if(NOT APPLE) | ||
set(QT_COMPONENTS ${QT_COMPONENTS} X11Extras) | ||
endif() | ||
find_package(Qt5 COMPONENTS ${QT_COMPONENTS}) | ||
set(QT_COMPONENTS Core Widgets) | ||
if(NOT APPLE) | ||
set(QT_COMPONENTS ${QT_COMPONENTS} X11Extras) | ||
endif() | ||
|
||
find_package(Qt5 COMPONENTS ${QT_COMPONENTS}) | ||
|
||
# install the shared libraries to the freesurfer lib directory | ||
if(((NOT USE_QT4 AND Qt5_FOUND) OR (USE_QT4 AND Qt4_FOUND)) AND NOT APPLE) | ||
if(Qt5_FOUND AND NOT APPLE) | ||
file(GLOB QT_LIBRARIES_TO_INSTALL "${QT_INSTALL_DIR}/lib/lib*.so*") | ||
if(QT_LIBRARIES_TO_INSTALL) | ||
install(PROGRAMS ${QT_LIBRARIES_TO_INSTALL} DESTINATION lib/qt/lib) | ||
# add Qt library directory to rpath | ||
set(CMAKE_INSTALL_RPATH "$ORIGIN/../lib/qt/lib:${CMAKE_INSTALL_RPATH}") | ||
# install the platform plugins as well, and make sure executables know | ||
#where to find the plugins directory | ||
if(NOT USE_QT4 AND EXISTS ${QT_INSTALL_DIR}/plugins/platforms) | ||
# where to find the plugins directory | ||
if(EXISTS ${QT_INSTALL_DIR}/plugins/platforms) | ||
install(DIRECTORY ${QT_INSTALL_DIR}/plugins/platforms DESTINATION lib/qt/plugins) | ||
install(FILES ${CMAKE_SOURCE_DIR}/cmake/qt.conf DESTINATION bin) | ||
install(FILES ${CMAKE_SOURCE_DIR}/qt/qt.conf DESTINATION bin) | ||
endif() | ||
endif() | ||
endif() | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
#!/usr/bin/env bash | ||
|
||
set -e | ||
|
||
# input checks | ||
if [ "$#" -ne "2" ]; then | ||
echo "error: mac_deploy requires 2 arguments" | ||
echo "usage: mac_deploy <qt-directory> <bundle-directory>" | ||
exit 1 | ||
fi | ||
|
||
qtdir="$1" | ||
if [ ! -d "$qtdir" ]; then | ||
echo "error: qt directory '$qtdir' does not exist" | ||
exit 1 | ||
fi | ||
|
||
bundle="$2" | ||
if [ ! -d "$bundle" ]; then | ||
echo "error: bundle directory '$bundle' does not exist" | ||
exit 1 | ||
fi | ||
|
||
# create the proj language directory | ||
mkdir -p ${bundle}/Contents/Resources/English.lproj | ||
|
||
# locate the bundle binary | ||
binary="$(ls ${bundle}/Contents/MacOS)" | ||
if [ "$(echo $binary | wc -w)" -ne "1" ] ; then | ||
echo "error: more than 1 file found in ${bundle}/Contents/MacOS" | ||
exit 1 | ||
fi | ||
binarypath="${bundle}/Contents/MacOS/${binary}" | ||
|
||
# run macdeployqt | ||
${qtdir}/bin/macdeployqt ${bundle} -always-overwrite | ||
|
||
# if the final binary references the Qt frameworks via rpath, we need to actually | ||
# add a relative rpath, since macdeployqt completely ignores this | ||
if [ -n "$(otool -L $binarypath | grep '@rpath/Qt')" ] ; then | ||
if [ -z "$(otool -l $binarypath | grep '@executable_path/../Frameworks')" ] ; then | ||
install_name_tool -add_rpath "@executable_path/../Frameworks" $binarypath | ||
fi | ||
fi |
File renamed without changes.