Commit c621e0e6 authored by Manuel Grizonnet's avatar Manuel Grizonnet

BUG: fix qt5 compilation on ubuntu 18.04

This commit not only includes the bugfix for qt5 on ubuntu but also some improvments in the qt5 external project.

The fix concern only the following modification:

- add -qt-harfbuzz in the configure script to fix libz conflict

Other minor updates:

- upgrade qt version to last stable release 5.11.1
- remove commented cmake configuration related to qt4
- add options -optimize-size and -silent options in the configure script to optimize the package

see https://blog.qt.io/blog/2017/05/31/qt-lite-qt-5-9-lts/ for detail about the size optimization (contrl compiler flags)

silent option reduce the output generated in the build tree. Perhaps not a good idea...
parent 4db72a15
......@@ -22,17 +22,6 @@ INCLUDE_ONCE_MACRO(QT5)
SETUP_SUPERBUILD(QT5)
#RK: are we ready for QT4 build on linux?.
#This comment here scares me away.
#Installing QT4 from packages also need sqlite otherwise there is issue
# if(UNIX AND NOT APPLE)
# message(STATUS " SuperBuild may fail to compile Qt4. If so, you should install it via package manager.")
# endif()
#set(QT4_SB_ENABLE_GTK OFF CACHE INTERNAL "Enable GTK+ style with qt using -gtkstlye. Default is OFF")
#NOTE: make sure your superbuild install directory does not contain any
#Qt files from previous install of superbuild QT.
# declare dependencies
......@@ -102,30 +91,14 @@ set(QT5_SB_CONFIG
-skip qtwinextras \
-skip qtx11extras \
-skip qtxmlpatterns \
-system-libpng -system-libjpeg -system-zlib -system-freetype")
# "-prefix ${QT4_INSTALL_PREFIX_NATIVE} -L ${QT4_LIB_PREFIX_NATIVE} \
# -I ${QT4_INCLUDE_PREFIX_NATIVE} -I ${QT4_INCLUDE_FREETYPE_NATIVE} \
# -opensource -confirm-license -release -shared -nomake demos \
# -nomake examples -nomake tools -no-phonon-backend -no-phonon -no-script \
# -no-scripttools -no-multimedia -no-audio-backend -no-webkit -no-declarative \
# -no-accessibility -no-qt3support -no-xmlpatterns -no-sql-sqlite -no-openssl \
# -no-libtiff -no-libmng -system-libpng -system-libjpeg -system-zlib")
#RK: building faling on mac. png include is in a macframework
# if(USE_SYSTEM_PNG)
# set(QT4_SB_CONFIG "${QT4_SB_CONFIG} -I ${PNG_PNG_INCLUDE_DIR}")
# endif()
-system-libpng -system-libjpeg -system-zlib -system-freetype -qt-harfbuzz -optimize-size -silent")
if(UNIX)
if(APPLE)
set(QT5_SB_CONFIG "${QT5_SB_CONFIG} -no-framework")
else() #Linux
# if(QT5_SB_ENABLE_GTK)
# message(WARNING "QT5_SB_ENABLE_GTK support is experimental")
# set(QT5_SB_CONFIG "${QT5_SB_CONFIG} -sm -xrender -xrandr -gtkstyle")
# else()
else()
#Linux
set(QT5_SB_CONFIG "${QT5_SB_CONFIG} -no-glib -no-fontconfig")
# endif()
endif()
#common for all unix
set(QT5_SB_CONFIG "${QT5_SB_CONFIG} -no-dbus -no-icu -v")
......@@ -151,52 +124,20 @@ endif()
configure_file( ${QT5_CONFIGURE_COMMAND_IN} ${QT5_CONFIGURE_COMMAND} @ONLY )
#Remove left over or previous installation from install prefix.
#Existing files in install prefix was disturbing a second installation.
#even after the QT4 directory is removed from build
# add_custom_target(QT4-uninstall
# COMMAND ${CMAKE_COMMAND} -E remove_directory "${SB_INSTALL_PREFIX}/include/QtCore"
# COMMAND ${CMAKE_COMMAND} -E remove_directory "${SB_INSTALL_PREFIX}/include/QtDBus"
# COMMAND ${CMAKE_COMMAND} -E remove_directory "${SB_INSTALL_PREFIX}/include/QtGui"
# COMMAND ${CMAKE_COMMAND} -E remove_directory "${SB_INSTALL_PREFIX}/include/QtNetwork"
# COMMAND ${CMAKE_COMMAND} -E remove_directory "${SB_INSTALL_PREFIX}/include/QtOpenGL"
# COMMAND ${CMAKE_COMMAND} -E remove_directory "${SB_INSTALL_PREFIX}/include/QtSql"
# COMMAND ${CMAKE_COMMAND} -E remove_directory "${SB_INSTALL_PREFIX}/include/QtSvg"
# COMMAND ${CMAKE_COMMAND} -E remove_directory "${SB_INSTALL_PREFIX}/include/QtTest"
# COMMAND ${CMAKE_COMMAND} -E remove_directory "${SB_INSTALL_PREFIX}/include/QtXml"
# COMMAND ${CMAKE_COMMAND} -E remove_directory "${SB_INSTALL_PREFIX}/include/Qt"
# COMMAND ${CMAKE_COMMAND} -E remove_directory "${SB_INSTALL_PREFIX}/mkspecs"
# COMMAND ${CMAKE_COMMAND} -E remove_directory "${SB_INSTALL_PREFIX}/plugins"
# COMMAND ${CMAKE_COMMAND} -E remove_directory "${SB_INSTALL_PREFIX}/translations"
# COMMAND ${CMAKE_COMMAND} -E remove -f "${SB_INSTALL_PREFIX}/lib/libQt*"
# COMMAND ${CMAKE_COMMAND} -E remove -f "${SB_INSTALL_PREFIX}/lib/pkgconfig/Qt*"
# COMMAND ${CMAKE_COMMAND} -E remove -f "${SB_INSTALL_PREFIX}/bin/qmake${QT4_BIN_EXT}"
# COMMAND ${CMAKE_COMMAND} -E remove -f "${SB_INSTALL_PREFIX}/bin/lrelease${QT4_BIN_EXT}"
# COMMAND ${CMAKE_COMMAND} -E remove -f "${SB_INSTALL_PREFIX}/bin/moc${QT4_BIN_EXT}"
# COMMAND ${CMAKE_COMMAND} -E remove -f "${SB_INSTALL_PREFIX}/bin/rcc${QT4_BIN_EXT}"
# COMMAND ${CMAKE_COMMAND} -E remove -f "${SB_INSTALL_PREFIX}/bin/uic${QT4_BIN_EXT}"
# COMMAND ${CMAKE_COMMAND} -E remove -f "${SB_INSTALL_PREFIX}/bin/libQt*"
# WORKING_DIRECTORY "${SB_INSTALL_PREFIX}"
# )
#adding it to dependencies will remove the files when configure QWT
#list(APPEND QT4_DEPENDENCIES QT4-uninstall)
ExternalProject_Add(QT5
PREFIX QT5
URL "http://download.qt.io/official_releases/qt/5.10/5.10.1/single/qt-everywhere-src-5.10.1.tar.xz"
URL_MD5 7e167b9617e7bd64012daaacb85477af
BINARY_DIR ${QT5_SB_BUILD_DIR}
INSTALL_DIR ${SB_INSTALL_PREFIX}
DOWNLOAD_DIR ${DOWNLOAD_LOCATION}
CONFIGURE_COMMAND ${QT5_CONFIGURE_COMMAND}
DEPENDS ${QT5_DEPENDENCIES}
LOG_DOWNLOAD 1
LOG_CONFIGURE 1
LOG_BUILD 1
LOG_INSTALL 1
)
ExternalProject_Add(QT5
PREFIX QT5
URL "http://download.qt.io/official_releases/qt/5.11/5.11.1/single/qt-everywhere-src-5.11.1.tar.xz"
URL_MD5 c6f0854d7de7bde80cfd8cc85bb7152b
BINARY_DIR ${QT5_SB_BUILD_DIR}
INSTALL_DIR ${SB_INSTALL_PREFIX}
DOWNLOAD_DIR ${DOWNLOAD_LOCATION}
CONFIGURE_COMMAND ${QT5_CONFIGURE_COMMAND}
DEPENDS ${QT5_DEPENDENCIES}
LOG_DOWNLOAD 1
LOG_CONFIGURE 1
LOG_BUILD 1
LOG_INSTALL 1
)
SUPERBUILD_PATCH_SOURCE(QT5)
......@@ -204,11 +145,11 @@ set(_SB_QT_QMAKE_EXECUTABLE ${SB_INSTALL_PREFIX}/bin/qmake)
if(UNIX AND NOT APPLE)
ExternalProject_Add_Step(QT5 adding_font
COMMAND ${CMAKE_COMMAND}
-D BUILD_DIR=${QT5_SB_BUILD_DIR}
-D INSTALL_DIR=${SB_INSTALL_PREFIX}
-D DOWNLOAD_LOCATION=${DOWNLOAD_LOCATION}
-P ${CMAKE_SOURCE_DIR}/CMake/External_font.cmake
COMMAND ${CMAKE_COMMAND}
-D BUILD_DIR=${QT5_SB_BUILD_DIR}
-D INSTALL_DIR=${SB_INSTALL_PREFIX}
-D DOWNLOAD_LOCATION=${DOWNLOAD_LOCATION}
-P ${CMAKE_SOURCE_DIR}/CMake/External_font.cmake
DEPENDEES install
WORKING_DIRECTORY ${SB_INSTALL_PREFIX} )
endif()
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment