Commit 03f2bac4 authored by jcfr's avatar jcfr

COMP: Add Slicer_ADDITIONAL_REQUIRED_QT_MODULES to add QT modules

 * Manually prefix the modules because some modules (e.g. PHONON) may not
have the "QT" prefix.
 * Synchronize the required modules with the packaged modules

From: Julien Finet <julien.finet@kitware.com>

git-svn-id: http://svn.slicer.org/Slicer4/trunk@22756 3bd1e089-480b-0410-8dfb-8563597acbee
parent 0a8f8639
......@@ -39,11 +39,11 @@ macro(__SlicerBlockFindQtAndCheckVersion_find_qt)
set(command_separated_module_list)
# Check if all expected Qt modules have been discovered
foreach(module ${Slicer_REQUIRED_QT_MODULES})
if(NOT "${QT_QT${module}_FOUND}")
if(NOT "${QT_${module}_FOUND}")
message(FATAL_ERROR "error: Missing Qt module ${module}")
endif()
if(NOT ${module} STREQUAL "CORE" AND NOT ${module} STREQUAL "GUI")
set(QT_USE_QT${module} ON)
if(NOT ${module} STREQUAL "QTCORE" AND NOT ${module} STREQUAL "QTGUI")
set(QT_USE_${module} ON)
endif()
set(command_separated_module_list "${command_separated_module_list}${module}, ")
endforeach()
......
......@@ -3,11 +3,7 @@
# -------------------------------------------------------------------------
set(QT_INSTALL_LIB_DIR ${Slicer_INSTALL_LIB_DIR})
set(QTLIBLIST QTCORE QTGUI QTNETWORK QTXML QTTEST QTSCRIPT QTSQL QTSVG QTOPENGL QTWEBKIT PHONON QTXMLPATTERNS)
if(UNIX OR APPLE)
list(APPEND QTLIBLIST QTDBUS)
endif()
foreach(qtlib ${QTLIBLIST})
foreach(qtlib ${Slicer_REQUIRED_QT_MODULES})
if(QT_${qtlib}_LIBRARY_RELEASE)
if(APPLE)
install(DIRECTORY "${QT_${qtlib}_LIBRARY_RELEASE}"
......@@ -22,9 +18,10 @@ foreach(qtlib ${QTLIBLIST})
PATTERN "${QT_LIB_NAME_tmp}*.debug" EXCLUDE)
elseif(WIN32)
get_filename_component(QT_DLL_PATH_tmp ${QT_QMAKE_EXECUTABLE} PATH)
install(FILES ${QT_DLL_PATH_tmp}/${qtlib}4.dll
DESTINATION bin COMPONENT Runtime)
if(EXISTS "${QT_DLL_PATH_tmp}/${qtlib}4.dll")
install(FILES ${QT_DLL_PATH_tmp}/${qtlib}4.dll
DESTINATION bin COMPONENT Runtime)
endif()
endif()
endif()
endforeach()
......@@ -553,14 +553,26 @@ endif()
# Qt - Slicer_REQUIRED_QT_MODULES
#-----------------------------------------------------------------------------
# Module name should be specified as they appear in FindQt4.cmake
# For example, the module name associated with the variable QT_USE_QTXML is XML.
set(Slicer_REQUIRED_QT_MODULES CORE GUI NETWORK UITOOLS XML WEBKIT SVG SQL)
# For example, the module name associated with the variable QT_USE_QTXML is QTXML.
# Note that the modules will be installed when packaging.
set(Slicer_REQUIRED_QT_MODULES
QTCORE QTGUI
QTNETWORK QTOPENGL
QTUITOOLS #no dll
QTXML QTXMLPATTERNS
QTWEBKIT PHONON # webkit requires phonon
QTSVG QTSQL
)
if(UNIX OR APPLE)
list(APPEND QTLIBLIST QTDBUS)
endif()
if(Slicer_BUILD_EXTENSIONMANAGER_SUPPORT)
list(APPEND Slicer_REQUIRED_QT_MODULES SCRIPT)
list(APPEND Slicer_REQUIRED_QT_MODULES QTSCRIPT)
endif()
if(BUILD_TESTING)
list(APPEND Slicer_REQUIRED_QT_MODULES TEST)
list(APPEND Slicer_REQUIRED_QT_MODULES QTTEST)
endif()
list(APPEND Slicer_REQUIRED_QT_MODULES ${Slicer_ADDITIONAL_REQUIRED_QT_MODULES})
#-----------------------------------------------------------------------------
# Qt plugins (designer, imageformats, ...) relative directories
......
......@@ -229,6 +229,11 @@ if(WIN32)
list(APPEND EXTERNAL_PROJECT_OPTIONAL_ARGS -DSlicer_SKIP_ROOT_DIR_MAX_LENGTH_CHECK:BOOL=ON)
endif()
if(DEFINED Slicer_ADDITIONAL_REQUIRED_QT_MODULES)
list_to_string(${ep_list_separator} "${Slicer_ADDITIONAL_REQUIRED_QT_MODULES}" ep_Slicer_ADDITIONAL_REQUIRED_QT_MODULES)
list(APPEND EXTERNAL_PROJECT_OPTIONAL_ARGS -DSlicer_ADDITIONAL_REQUIRED_QT_MODULES:STRING=${ep_Slicer_ADDITIONAL_REQUIRED_QT_MODULES})
endif()
if(Slicer_USE_PYTHONQT)
list(APPEND EXTERNAL_PROJECT_OPTIONAL_ARGS
-DPYTHON_EXECUTABLE:FILEPATH=${PYTHON_EXECUTABLE}
......
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