2016-09-27 22:01:08 +03:00
|
|
|
# Distributed under the OSI-approved BSD 3-Clause License. See accompanying
|
|
|
|
# file Copyright.txt or https://cmake.org/licensing for details.
|
|
|
|
|
2013-10-15 19:17:36 +04:00
|
|
|
#.rst:
|
|
|
|
# Qt4ConfigDependentSettings
|
|
|
|
# --------------------------
|
|
|
|
#
|
|
|
|
#
|
|
|
|
#
|
2009-11-15 21:02:19 +03:00
|
|
|
# This file is included by FindQt4.cmake, don't include it directly.
|
|
|
|
|
|
|
|
###############################################
|
|
|
|
#
|
2012-08-13 21:42:58 +04:00
|
|
|
# configuration/system dependent settings
|
2009-11-15 21:02:19 +03:00
|
|
|
#
|
|
|
|
###############################################
|
|
|
|
|
|
|
|
# find dependencies for some Qt modules
|
|
|
|
# when doing builds against a static Qt, they are required
|
2009-12-16 00:16:45 +03:00
|
|
|
# when doing builds against a shared Qt, they are not required
|
2009-11-15 21:02:19 +03:00
|
|
|
# if a user needs the dependencies, and they couldn't be found, they can set
|
|
|
|
# the variables themselves.
|
|
|
|
|
2012-08-13 21:47:32 +04:00
|
|
|
set(QT_QTGUI_LIB_DEPENDENCIES "")
|
|
|
|
set(QT_QTCORE_LIB_DEPENDENCIES "")
|
|
|
|
set(QT_QTNETWORK_LIB_DEPENDENCIES "")
|
|
|
|
set(QT_QTOPENGL_LIB_DEPENDENCIES "")
|
|
|
|
set(QT_QTDBUS_LIB_DEPENDENCIES "")
|
|
|
|
set(QT_QTHELP_LIB_DEPENDENCIES ${QT_QTCLUCENE_LIBRARY})
|
2009-11-15 21:02:19 +03:00
|
|
|
|
|
|
|
|
2012-08-13 21:47:32 +04:00
|
|
|
if(Q_WS_WIN)
|
2010-11-24 02:01:43 +03:00
|
|
|
# On Windows, qconfig.pri has "shared" for shared library builds
|
2012-08-13 21:47:32 +04:00
|
|
|
if(NOT QT_CONFIG MATCHES "shared")
|
|
|
|
set(QT_IS_STATIC 1)
|
2012-08-13 21:50:14 +04:00
|
|
|
endif()
|
|
|
|
else()
|
2009-12-16 00:16:45 +03:00
|
|
|
# On other platforms, check file extension to know if its static
|
2012-08-13 21:47:32 +04:00
|
|
|
if(QT_QTCORE_LIBRARY_RELEASE)
|
|
|
|
get_filename_component(qtcore_lib_ext "${QT_QTCORE_LIBRARY_RELEASE}" EXT)
|
|
|
|
if("${qtcore_lib_ext}" STREQUAL "${CMAKE_STATIC_LIBRARY_SUFFIX}")
|
|
|
|
set(QT_IS_STATIC 1)
|
2012-08-13 21:50:14 +04:00
|
|
|
endif()
|
|
|
|
endif()
|
2012-08-13 21:47:32 +04:00
|
|
|
if(QT_QTCORE_LIBRARY_DEBUG)
|
|
|
|
get_filename_component(qtcore_lib_ext "${QT_QTCORE_LIBRARY_DEBUG}" EXT)
|
|
|
|
if(${qtcore_lib_ext} STREQUAL ${CMAKE_STATIC_LIBRARY_SUFFIX})
|
|
|
|
set(QT_IS_STATIC 1)
|
2012-08-13 21:50:14 +04:00
|
|
|
endif()
|
|
|
|
endif()
|
|
|
|
endif()
|
2009-12-16 00:16:45 +03:00
|
|
|
|
|
|
|
# build using shared Qt needs -DQT_DLL on Windows
|
2012-08-13 21:47:32 +04:00
|
|
|
if(Q_WS_WIN AND NOT QT_IS_STATIC)
|
|
|
|
set(QT_DEFINITIONS ${QT_DEFINITIONS} -DQT_DLL)
|
2012-08-13 21:50:14 +04:00
|
|
|
endif()
|
2009-11-15 21:02:19 +03:00
|
|
|
|
2012-08-13 21:47:32 +04:00
|
|
|
if(NOT QT_IS_STATIC)
|
|
|
|
return()
|
2012-08-13 21:50:14 +04:00
|
|
|
endif()
|
2009-11-15 21:02:19 +03:00
|
|
|
|
|
|
|
# QtOpenGL dependencies
|
2010-03-17 07:28:03 +03:00
|
|
|
find_package(OpenGL)
|
2012-08-13 21:47:32 +04:00
|
|
|
set (QT_QTOPENGL_LIB_DEPENDENCIES ${OPENGL_glu_LIBRARY} ${OPENGL_gl_LIBRARY})
|
2009-11-15 21:02:19 +03:00
|
|
|
|
|
|
|
|
|
|
|
## system png
|
2012-08-13 21:47:32 +04:00
|
|
|
if(QT_QCONFIG MATCHES "system-png")
|
2010-06-25 06:30:50 +04:00
|
|
|
find_package(PNG)
|
2012-08-13 21:47:32 +04:00
|
|
|
set(QT_QTGUI_LIB_DEPENDENCIES ${QT_QTGUI_LIB_DEPENDENCIES} ${PNG_LIBRARY})
|
2012-08-13 21:50:14 +04:00
|
|
|
endif()
|
2009-11-15 21:02:19 +03:00
|
|
|
|
2010-11-24 02:01:43 +03:00
|
|
|
## system jpeg
|
2012-08-13 21:47:32 +04:00
|
|
|
if(QT_QCONFIG MATCHES "system-jpeg")
|
2010-11-24 02:01:43 +03:00
|
|
|
find_package(JPEG)
|
2012-08-13 21:47:32 +04:00
|
|
|
set(QT_QTGUI_LIB_DEPENDENCIES ${QT_QTGUI_LIB_DEPENDENCIES} ${JPEG_LIBRARIES})
|
2012-08-13 21:50:14 +04:00
|
|
|
endif()
|
2010-11-24 02:01:43 +03:00
|
|
|
|
|
|
|
## system tiff
|
2012-08-13 21:47:32 +04:00
|
|
|
if(QT_QCONFIG MATCHES "system-tiff")
|
2010-11-24 02:01:43 +03:00
|
|
|
find_package(TIFF)
|
2012-08-13 21:47:32 +04:00
|
|
|
set(QT_QTGUI_LIB_DEPENDENCIES ${QT_QTGUI_LIB_DEPENDENCIES} ${TIFF_LIBRARIES})
|
2012-08-13 21:50:14 +04:00
|
|
|
endif()
|
2010-11-24 02:01:43 +03:00
|
|
|
|
|
|
|
## system mng
|
2012-08-13 21:47:32 +04:00
|
|
|
if(QT_QCONFIG MATCHES "system-mng")
|
2010-11-24 02:01:43 +03:00
|
|
|
find_library(MNG_LIBRARY NAMES mng)
|
2012-08-13 21:47:32 +04:00
|
|
|
set(QT_QTGUI_LIB_DEPENDENCIES ${QT_QTGUI_LIB_DEPENDENCIES} ${MNG_LIBRARY})
|
2012-08-13 21:50:14 +04:00
|
|
|
endif()
|
2009-11-15 21:02:19 +03:00
|
|
|
|
|
|
|
# for X11, get X11 library directory
|
2012-08-13 21:47:32 +04:00
|
|
|
if(Q_WS_X11)
|
|
|
|
find_package(X11)
|
2012-08-13 21:50:14 +04:00
|
|
|
endif()
|
2009-11-15 21:02:19 +03:00
|
|
|
|
|
|
|
|
|
|
|
## X11 SM
|
2012-08-13 21:47:32 +04:00
|
|
|
if(QT_QCONFIG MATCHES "x11sm")
|
|
|
|
if(X11_SM_LIB AND X11_ICE_LIB)
|
|
|
|
set(QT_QTGUI_LIB_DEPENDENCIES ${QT_QTGUI_LIB_DEPENDENCIES} ${X11_SM_LIB} ${X11_ICE_LIB})
|
2012-08-13 21:50:14 +04:00
|
|
|
endif()
|
|
|
|
endif()
|
2009-11-15 21:02:19 +03:00
|
|
|
|
|
|
|
|
|
|
|
## Xi
|
2012-08-13 21:47:32 +04:00
|
|
|
if(QT_QCONFIG MATCHES "tablet")
|
|
|
|
if(X11_Xi_LIB)
|
|
|
|
set(QT_QTGUI_LIB_DEPENDENCIES ${QT_QTGUI_LIB_DEPENDENCIES} ${X11_Xi_LIB})
|
2012-08-13 21:50:14 +04:00
|
|
|
endif()
|
|
|
|
endif()
|
2009-11-15 21:02:19 +03:00
|
|
|
|
|
|
|
|
|
|
|
## Xrender
|
2012-08-13 21:47:32 +04:00
|
|
|
if(QT_QCONFIG MATCHES "xrender")
|
|
|
|
if(X11_Xrender_LIB)
|
|
|
|
set(QT_QTGUI_LIB_DEPENDENCIES ${QT_QTGUI_LIB_DEPENDENCIES} ${X11_Xrender_LIB})
|
2012-08-13 21:50:14 +04:00
|
|
|
endif()
|
|
|
|
endif()
|
2009-11-15 21:02:19 +03:00
|
|
|
|
|
|
|
|
|
|
|
## Xrandr
|
2012-08-13 21:47:32 +04:00
|
|
|
if(QT_QCONFIG MATCHES "xrandr")
|
|
|
|
if(X11_Xrandr_LIB)
|
|
|
|
set(QT_QTGUI_LIB_DEPENDENCIES ${QT_QTGUI_LIB_DEPENDENCIES} ${X11_Xrandr_LIB})
|
2012-08-13 21:50:14 +04:00
|
|
|
endif()
|
|
|
|
endif()
|
2009-11-15 21:02:19 +03:00
|
|
|
|
|
|
|
|
|
|
|
## Xcursor
|
2012-08-13 21:47:32 +04:00
|
|
|
if(QT_QCONFIG MATCHES "xcursor")
|
|
|
|
if(X11_Xcursor_LIB)
|
|
|
|
set(QT_QTGUI_LIB_DEPENDENCIES ${QT_QTGUI_LIB_DEPENDENCIES} ${X11_Xcursor_LIB})
|
2012-08-13 21:50:14 +04:00
|
|
|
endif()
|
|
|
|
endif()
|
2009-11-15 21:02:19 +03:00
|
|
|
|
|
|
|
|
|
|
|
## Xinerama
|
2012-08-13 21:47:32 +04:00
|
|
|
if(QT_QCONFIG MATCHES "xinerama")
|
|
|
|
if(X11_Xinerama_LIB)
|
|
|
|
set(QT_QTGUI_LIB_DEPENDENCIES ${QT_QTGUI_LIB_DEPENDENCIES} ${X11_Xinerama_LIB})
|
2012-08-13 21:50:14 +04:00
|
|
|
endif()
|
|
|
|
endif()
|
2009-11-15 21:02:19 +03:00
|
|
|
|
|
|
|
|
|
|
|
## Xfixes
|
2012-08-13 21:47:32 +04:00
|
|
|
if(QT_QCONFIG MATCHES "xfixes")
|
|
|
|
if(X11_Xfixes_LIB)
|
|
|
|
set(QT_QTGUI_LIB_DEPENDENCIES ${QT_QTGUI_LIB_DEPENDENCIES} ${X11_Xfixes_LIB})
|
2012-08-13 21:50:14 +04:00
|
|
|
endif()
|
|
|
|
endif()
|
2009-11-15 21:02:19 +03:00
|
|
|
|
|
|
|
|
|
|
|
## fontconfig
|
2012-08-13 21:47:32 +04:00
|
|
|
if(QT_QCONFIG MATCHES "fontconfig")
|
|
|
|
find_library(QT_FONTCONFIG_LIBRARY NAMES fontconfig)
|
|
|
|
mark_as_advanced(QT_FONTCONFIG_LIBRARY)
|
|
|
|
if(QT_FONTCONFIG_LIBRARY)
|
|
|
|
set(QT_QTGUI_LIB_DEPENDENCIES ${QT_QTGUI_LIB_DEPENDENCIES} ${QT_FONTCONFIG_LIBRARY})
|
2012-08-13 21:50:14 +04:00
|
|
|
endif()
|
|
|
|
endif()
|
2009-11-15 21:02:19 +03:00
|
|
|
|
|
|
|
|
2010-06-25 06:30:50 +04:00
|
|
|
## system-freetype
|
2012-08-13 21:47:32 +04:00
|
|
|
if(QT_QCONFIG MATCHES "system-freetype")
|
2010-06-25 06:30:50 +04:00
|
|
|
find_package(Freetype)
|
|
|
|
if(FREETYPE_LIBRARIES)
|
2012-08-13 21:47:32 +04:00
|
|
|
set(QT_QTGUI_LIB_DEPENDENCIES ${QT_QTGUI_LIB_DEPENDENCIES} ${FREETYPE_LIBRARIES})
|
2012-08-13 21:50:14 +04:00
|
|
|
endif()
|
|
|
|
endif()
|
2010-06-25 06:30:50 +04:00
|
|
|
|
|
|
|
|
2009-11-15 21:02:19 +03:00
|
|
|
## system-zlib
|
2012-08-13 21:47:32 +04:00
|
|
|
if(QT_QCONFIG MATCHES "system-zlib")
|
2010-06-25 06:30:50 +04:00
|
|
|
find_package(ZLIB)
|
2012-08-13 21:47:32 +04:00
|
|
|
set(QT_QTCORE_LIB_DEPENDENCIES ${QT_QTCORE_LIB_DEPENDENCIES} ${ZLIB_LIBRARIES})
|
2012-08-13 21:50:14 +04:00
|
|
|
endif()
|
2009-11-15 21:02:19 +03:00
|
|
|
|
|
|
|
|
|
|
|
## openssl
|
2012-08-13 21:47:32 +04:00
|
|
|
if(NOT Q_WS_WIN)
|
|
|
|
set(_QT_NEED_OPENSSL 0)
|
|
|
|
if(QT_VERSION_MINOR LESS 4 AND QT_QCONFIG MATCHES "openssl")
|
|
|
|
set(_QT_NEED_OPENSSL 1)
|
2012-08-13 21:50:14 +04:00
|
|
|
endif()
|
2012-08-13 21:47:32 +04:00
|
|
|
if(QT_VERSION_MINOR GREATER 3 AND QT_QCONFIG MATCHES "openssl-linked")
|
|
|
|
set(_QT_NEED_OPENSSL 1)
|
2012-08-13 21:50:14 +04:00
|
|
|
endif()
|
2012-08-13 21:47:32 +04:00
|
|
|
if(_QT_NEED_OPENSSL)
|
|
|
|
find_package(OpenSSL)
|
|
|
|
if(OPENSSL_LIBRARIES)
|
|
|
|
set(QT_QTNETWORK_LIB_DEPENDENCIES ${QT_QTNETWORK_LIB_DEPENDENCIES} ${OPENSSL_LIBRARIES})
|
2012-08-13 21:50:14 +04:00
|
|
|
endif()
|
|
|
|
endif()
|
|
|
|
endif()
|
2009-11-15 21:02:19 +03:00
|
|
|
|
|
|
|
|
|
|
|
## dbus
|
2012-08-13 21:47:32 +04:00
|
|
|
if(QT_QCONFIG MATCHES "dbus")
|
2009-11-15 21:02:19 +03:00
|
|
|
|
2012-08-13 21:47:32 +04:00
|
|
|
find_library(QT_DBUS_LIBRARY NAMES dbus-1 )
|
|
|
|
if(QT_DBUS_LIBRARY)
|
|
|
|
set(QT_QTDBUS_LIB_DEPENDENCIES ${QT_QTDBUS_LIB_DEPENDENCIES} ${QT_DBUS_LIBRARY})
|
2012-08-13 21:50:14 +04:00
|
|
|
endif()
|
2012-08-13 21:47:32 +04:00
|
|
|
mark_as_advanced(QT_DBUS_LIBRARY)
|
2009-11-15 21:02:19 +03:00
|
|
|
|
2012-08-13 21:50:14 +04:00
|
|
|
endif()
|
2009-11-15 21:02:19 +03:00
|
|
|
|
|
|
|
|
|
|
|
## glib
|
2012-08-13 21:47:32 +04:00
|
|
|
if(QT_QCONFIG MATCHES "glib")
|
2009-11-15 21:02:19 +03:00
|
|
|
|
|
|
|
# Qt 4.2.0+ uses glib-2.0
|
2012-08-13 21:47:32 +04:00
|
|
|
find_library(QT_GLIB_LIBRARY NAMES glib-2.0 )
|
|
|
|
find_library(QT_GTHREAD_LIBRARY NAMES gthread-2.0 )
|
|
|
|
mark_as_advanced(QT_GLIB_LIBRARY)
|
|
|
|
mark_as_advanced(QT_GTHREAD_LIBRARY)
|
2009-11-15 21:02:19 +03:00
|
|
|
|
2012-08-13 21:47:32 +04:00
|
|
|
if(QT_GLIB_LIBRARY AND QT_GTHREAD_LIBRARY)
|
|
|
|
set(QT_QTCORE_LIB_DEPENDENCIES ${QT_QTCORE_LIB_DEPENDENCIES}
|
2009-11-15 21:02:19 +03:00
|
|
|
${QT_GTHREAD_LIBRARY} ${QT_GLIB_LIBRARY})
|
2012-08-13 21:50:14 +04:00
|
|
|
endif()
|
2009-11-15 21:02:19 +03:00
|
|
|
|
|
|
|
|
|
|
|
# Qt 4.5+ also links to gobject-2.0
|
2012-08-13 21:47:32 +04:00
|
|
|
if(QT_VERSION_MINOR GREATER 4)
|
|
|
|
find_library(QT_GOBJECT_LIBRARY NAMES gobject-2.0 PATHS ${_glib_query_output} )
|
|
|
|
mark_as_advanced(QT_GOBJECT_LIBRARY)
|
2009-11-15 21:02:19 +03:00
|
|
|
|
2012-08-13 21:47:32 +04:00
|
|
|
if(QT_GOBJECT_LIBRARY)
|
|
|
|
set(QT_QTCORE_LIB_DEPENDENCIES ${QT_QTCORE_LIB_DEPENDENCIES}
|
2009-11-15 21:02:19 +03:00
|
|
|
${QT_GOBJECT_LIBRARY})
|
2012-08-13 21:50:14 +04:00
|
|
|
endif()
|
|
|
|
endif()
|
2009-11-15 21:02:19 +03:00
|
|
|
|
2012-08-13 21:50:14 +04:00
|
|
|
endif()
|
2009-11-15 21:02:19 +03:00
|
|
|
|
|
|
|
|
|
|
|
## clock-monotonic, just see if we need to link with rt
|
2012-08-13 21:47:32 +04:00
|
|
|
if(QT_QCONFIG MATCHES "clock-monotonic")
|
|
|
|
set(CMAKE_REQUIRED_LIBRARIES_SAVE ${CMAKE_REQUIRED_LIBRARIES})
|
|
|
|
set(CMAKE_REQUIRED_LIBRARIES rt)
|
2009-11-15 21:02:19 +03:00
|
|
|
CHECK_SYMBOL_EXISTS(_POSIX_TIMERS "unistd.h;time.h" QT_POSIX_TIMERS)
|
2012-08-13 21:47:32 +04:00
|
|
|
set(CMAKE_REQUIRED_LIBRARIES ${CMAKE_REQUIRED_LIBRARIES_SAVE})
|
|
|
|
if(QT_POSIX_TIMERS)
|
|
|
|
find_library(QT_RT_LIBRARY NAMES rt)
|
|
|
|
mark_as_advanced(QT_RT_LIBRARY)
|
|
|
|
if(QT_RT_LIBRARY)
|
|
|
|
set(QT_QTCORE_LIB_DEPENDENCIES ${QT_QTCORE_LIB_DEPENDENCIES} ${QT_RT_LIBRARY})
|
2012-08-13 21:50:14 +04:00
|
|
|
endif()
|
|
|
|
endif()
|
|
|
|
endif()
|
2012-08-13 21:47:32 +04:00
|
|
|
|
|
|
|
|
|
|
|
if(Q_WS_X11)
|
2010-03-17 19:46:22 +03:00
|
|
|
# X11 libraries Qt always depends on
|
2012-08-13 21:47:32 +04:00
|
|
|
set(QT_QTGUI_LIB_DEPENDENCIES ${QT_QTGUI_LIB_DEPENDENCIES} ${X11_Xext_LIB} ${X11_X11_LIB})
|
2009-11-15 21:02:19 +03:00
|
|
|
|
2013-04-02 17:46:51 +04:00
|
|
|
set(CMAKE_THREAD_PREFER_PTHREAD 1)
|
2010-06-12 23:00:08 +04:00
|
|
|
find_package(Threads)
|
|
|
|
if(CMAKE_USE_PTHREADS_INIT)
|
2012-08-13 21:47:32 +04:00
|
|
|
set(QT_QTCORE_LIB_DEPENDENCIES ${QT_QTCORE_LIB_DEPENDENCIES} ${CMAKE_THREAD_LIBS_INIT})
|
2012-08-13 21:50:14 +04:00
|
|
|
endif()
|
2009-11-15 21:02:19 +03:00
|
|
|
|
2012-08-13 21:47:32 +04:00
|
|
|
set (QT_QTCORE_LIB_DEPENDENCIES ${QT_QTCORE_LIB_DEPENDENCIES} ${CMAKE_DL_LIBS})
|
2009-11-15 21:02:19 +03:00
|
|
|
|
2012-08-13 21:50:14 +04:00
|
|
|
endif()
|
2009-11-15 21:02:19 +03:00
|
|
|
|
|
|
|
|
2012-08-13 21:47:32 +04:00
|
|
|
if(Q_WS_WIN)
|
|
|
|
set(QT_QTGUI_LIB_DEPENDENCIES ${QT_QTGUI_LIB_DEPENDENCIES} imm32 winmm)
|
|
|
|
set(QT_QTCORE_LIB_DEPENDENCIES ${QT_QTCORE_LIB_DEPENDENCIES} ws2_32)
|
2012-08-13 21:50:14 +04:00
|
|
|
endif()
|
2009-11-15 21:02:19 +03:00
|
|
|
|
|
|
|
|
2012-08-13 21:47:32 +04:00
|
|
|
if(Q_WS_MAC)
|
|
|
|
set(QT_QTGUI_LIB_DEPENDENCIES ${QT_QTGUI_LIB_DEPENDENCIES} "-framework Carbon")
|
2009-11-15 21:02:19 +03:00
|
|
|
|
|
|
|
# Qt 4.0, 4.1, 4.2 use QuickTime
|
2012-08-13 21:47:32 +04:00
|
|
|
if(QT_VERSION_MINOR LESS 3)
|
|
|
|
set(QT_QTGUI_LIB_DEPENDENCIES ${QT_QTGUI_LIB_DEPENDENCIES} "-framework QuickTime")
|
2012-08-13 21:50:14 +04:00
|
|
|
endif()
|
2009-11-15 21:02:19 +03:00
|
|
|
|
|
|
|
# Qt 4.2+ use AppKit
|
2012-08-13 21:47:32 +04:00
|
|
|
if(QT_VERSION_MINOR GREATER 1)
|
|
|
|
set(QT_QTGUI_LIB_DEPENDENCIES ${QT_QTGUI_LIB_DEPENDENCIES} "-framework AppKit")
|
2012-08-13 21:50:14 +04:00
|
|
|
endif()
|
2009-11-15 21:02:19 +03:00
|
|
|
|
2012-08-13 21:47:32 +04:00
|
|
|
set(QT_QTCORE_LIB_DEPENDENCIES ${QT_QTCORE_LIB_DEPENDENCIES} "-framework ApplicationServices")
|
2012-08-13 21:50:14 +04:00
|
|
|
endif()
|
2009-11-15 21:02:19 +03:00
|
|
|
|