Fix macOS Qt4 build

- Dereference qt plugin symlinks
- Remove qt postgresql plugin because of missing dependency
This commit is contained in:
Peter Lama
2017-08-26 12:07:57 -04:00
committed by Yorik van Havre
parent a5322dfdcf
commit bbbac656ee
2 changed files with 19 additions and 2 deletions

View File

@@ -186,7 +186,9 @@ before_install:
brew install --verbose --only-dependencies freecad --with-qt4 --with-packaging-utils
brew install --verbose --only-dependencies freecad --with-qt4 --with-packaging-utils #Ensure all dependencies are satisfied
# qt4 bottle contains postgresql plugin even when --with-postgresql option is not specified
# and so postgresql dep is not installed. Delete it because the plugin is not included with qt5 bottle.
sudo rm -f /usr/local/lib/qt4/plugins/sqldrivers/libqsqlpsql.dylib
elif [ "${QT}" == "Qt5" ]; then
# Qt5: Replace Qt4 in ports-cache with Qt5, if necessary
brew ls --versions cartr/qt4/qt > /dev/null && \

View File

@@ -50,7 +50,22 @@ if(BUILD_QT5)
set(XCTEST_PATH "${XCODE_PATH}/Platforms/MacOSX.platform/Developer/Library/Frameworks/XCTest.framework/Versions/Current")
endif(BUILD_QT5)
install(DIRECTORY ${QT_PLUGINS_DIR}/ DESTINATION ${CMAKE_INSTALL_LIBDIR}/qtplugins )
# Ensure the actual plugin files are installed instead of symlinks.
file(GLOB _subdirs RELATIVE "${QT_PLUGINS_DIR}" "${QT_PLUGINS_DIR}/*")
foreach(_subdir ${_subdirs})
if(IS_DIRECTORY "${QT_PLUGINS_DIR}/${_subdir}")
set(_resolved_files "")
file(GLOB _plugin_files RELATIVE "${QT_PLUGINS_DIR}/${_subdir}" "${QT_PLUGINS_DIR}/${_subdir}/*")
foreach(_plugin_file ${_plugin_files})
get_filename_component(_resolved_file "${QT_PLUGINS_DIR}/${_subdir}/${_plugin_file}" REALPATH)
list(APPEND _resolved_files ${_resolved_file})
endforeach()
install(FILES ${_resolved_files} DESTINATION "${CMAKE_INSTALL_LIBDIR}/qtplugins/${_subdir}")
endif()
endforeach()
#files installed by homebrew do not have write permission for regular user
install(CODE "execute_process(COMMAND chmod -R a+w ${CMAKE_INSTALL_LIBDIR})")