OS X: Fix .app creation for non-system Qt

This commit is contained in:
Markus Goetz 2014-10-09 16:49:36 +02:00
parent 7eb10a08b8
commit f0fef4f232
2 changed files with 8 additions and 5 deletions

View file

@ -23,7 +23,7 @@ import sys
from glob import glob from glob import glob
def QueryQMake(attrib): def QueryQMake(attrib):
return subprocess.check_output(['qmake', '-query', attrib]).rstrip('\n') return subprocess.check_output([qmake_path, '-query', attrib]).rstrip('\n')
FRAMEWORK_SEARCH_PATH=[ FRAMEWORK_SEARCH_PATH=[
'/Library/Frameworks', '/Library/Frameworks',
@ -71,14 +71,15 @@ class CouldNotFindScriptPluginError(Error):
class CouldNotFindFrameworkError(Error): class CouldNotFindFrameworkError(Error):
pass pass
if len(sys.argv) < 2: if len(sys.argv) < 3:
print 'Usage: %s <bundle.app>' % sys.argv[0] print 'Usage: %s <bundle.app> <path-to-qmake>' % sys.argv[0]
exit() exit()
def is_exe(fpath): def is_exe(fpath):
return os.path.isfile(fpath) and os.access(fpath, os.X_OK) return os.path.isfile(fpath) and os.access(fpath, os.X_OK)
bundle_dir = sys.argv[1] bundle_dir = sys.argv[1]
qmake_path = sys.argv[2]
bundle_name = os.path.basename(bundle_dir).split('.')[0] bundle_name = os.path.basename(bundle_dir).split('.')[0]

View file

@ -383,7 +383,8 @@ if(NOT BUILD_LIBRARIES_ONLY)
RUNTIME_OUTPUT_DIRECTORY ${BIN_OUTPUT_DIRECTORY} RUNTIME_OUTPUT_DIRECTORY ${BIN_OUTPUT_DIRECTORY}
) )
set_target_properties( ${APPLICATION_EXECUTABLE} PROPERTIES set_target_properties( ${APPLICATION_EXECUTABLE} PROPERTIES
INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/${LIB_INSTALL_DIR}/${APPLICATION_EXECUTABLE}" ) INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/${LIB_INSTALL_DIR}/" )
target_link_libraries( ${APPLICATION_EXECUTABLE} ${QT_LIBRARIES} ) target_link_libraries( ${APPLICATION_EXECUTABLE} ${QT_LIBRARIES} )
target_link_libraries( ${APPLICATION_EXECUTABLE} ${synclib_NAME} ) target_link_libraries( ${APPLICATION_EXECUTABLE} ${synclib_NAME} )
@ -442,8 +443,9 @@ endif()
# currently it needs to be done because the code right above needs to be executed no matter # currently it needs to be done because the code right above needs to be executed no matter
# if building a bundle or not and the install_qt4_executable needs to be called afterwards # if building a bundle or not and the install_qt4_executable needs to be called afterwards
if(BUILD_OWNCLOUD_OSX_BUNDLE AND NOT BUILD_LIBRARIES_ONLY) if(BUILD_OWNCLOUD_OSX_BUNDLE AND NOT BUILD_LIBRARIES_ONLY)
get_target_property (QT_QMAKE_EXECUTABLE Qt5::qmake IMPORTED_LOCATION)
install(CODE " install(CODE "
message(STATUS \"Deploying (Qt) dependencies and fixing library pathes...\") message(STATUS \"Deploying (Qt) dependencies and fixing library pathes...\")
execute_process(COMMAND \"${CMAKE_SOURCE_DIR}/admin/osx/macdeployqt.py\" ${CMAKE_INSTALL_PREFIX}/${OWNCLOUD_OSX_BUNDLE}) execute_process(COMMAND \"${CMAKE_SOURCE_DIR}/admin/osx/macdeployqt.py\" ${CMAKE_INSTALL_PREFIX}/${OWNCLOUD_OSX_BUNDLE} ${QT_QMAKE_EXECUTABLE})
" COMPONENT RUNTIME) " COMPONENT RUNTIME)
endif() endif()