BUG: Fix #10021 don't specify libraries Qt depends on unless Qt is static.
This commit is contained in:
parent
633c296552
commit
56ee3b43a9
|
@ -22,8 +22,7 @@
|
||||||
|
|
||||||
# find dependencies for some Qt modules
|
# find dependencies for some Qt modules
|
||||||
# when doing builds against a static Qt, they are required
|
# when doing builds against a static Qt, they are required
|
||||||
# when doing builds against a shared Qt, they are sometimes not required
|
# when doing builds against a shared Qt, they are not required
|
||||||
# even some Linux distros do not require these dependencies
|
|
||||||
# if a user needs the dependencies, and they couldn't be found, they can set
|
# if a user needs the dependencies, and they couldn't be found, they can set
|
||||||
# the variables themselves.
|
# the variables themselves.
|
||||||
|
|
||||||
|
@ -35,12 +34,31 @@ SET(QT_QTDBUS_LIB_DEPENDENCIES "")
|
||||||
SET(QT_QTHELP_LIB_DEPENDENCIES ${QT_QTCLUCENE_LIBRARY})
|
SET(QT_QTHELP_LIB_DEPENDENCIES ${QT_QTCLUCENE_LIBRARY})
|
||||||
|
|
||||||
|
|
||||||
# build using shared Qt needs -DQT_DLL
|
IF(WIN32)
|
||||||
IF(WIN32 AND NOT QT_CONFIG MATCHES "static")
|
# On Windows, qconfig.pri has "static" for static library builds
|
||||||
# warning currently only qconfig.pri on Windows potentially contains "static"
|
IF(QT_CONFIG MATCHES "static")
|
||||||
# so QT_DLL might not get defined properly on other platforms.
|
SET(QT_IS_STATIC 1)
|
||||||
|
ENDIF(QT_CONFIG MATCHES "static")
|
||||||
|
ELSE(WIN32)
|
||||||
|
# On other platforms, check file extension to know if its static
|
||||||
|
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)
|
||||||
|
ENDIF(${qtcore_lib_ext} STREQUAL ${CMAKE_STATIC_LIBRARY_SUFFIX})
|
||||||
|
ENDIF(QT_QTCORE_LIBRARY_RELEASE)
|
||||||
|
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)
|
||||||
|
ENDIF(${qtcore_lib_ext} STREQUAL ${CMAKE_STATIC_LIBRARY_SUFFIX})
|
||||||
|
ENDIF(QT_QTCORE_LIBRARY_DEBUG)
|
||||||
|
ENDIF(WIN32)
|
||||||
|
|
||||||
|
# build using shared Qt needs -DQT_DLL on Windows
|
||||||
|
IF(WIN32 AND NOT QT_IS_STATIC)
|
||||||
SET(QT_DEFINITIONS ${QT_DEFINITIONS} -DQT_DLL)
|
SET(QT_DEFINITIONS ${QT_DEFINITIONS} -DQT_DLL)
|
||||||
ENDIF(WIN32 AND NOT QT_CONFIG MATCHES "static")
|
ENDIF(WIN32 AND NOT QT_IS_STATIC)
|
||||||
|
|
||||||
|
|
||||||
# QtOpenGL dependencies
|
# QtOpenGL dependencies
|
||||||
|
|
|
@ -80,7 +80,10 @@ FOREACH(module QT3SUPPORT QTOPENGL QTASSISTANT QTDESIGNER QTMOTIF QTNSPLUGIN
|
||||||
ADD_DEFINITIONS(-DQT_${qt_module_def}_LIB)
|
ADD_DEFINITIONS(-DQT_${qt_module_def}_LIB)
|
||||||
INCLUDE_DIRECTORIES(${QT_${module}_INCLUDE_DIR})
|
INCLUDE_DIRECTORIES(${QT_${module}_INCLUDE_DIR})
|
||||||
ENDIF(QT_USE_${module})
|
ENDIF(QT_USE_${module})
|
||||||
SET(QT_LIBRARIES ${QT_LIBRARIES} ${QT_${module}_LIBRARY} ${QT_${module}_LIB_DEPENDENCIES})
|
SET(QT_LIBRARIES ${QT_LIBRARIES} ${QT_${module}_LIBRARY})
|
||||||
|
IF(QT_IS_STATIC)
|
||||||
|
SET(QT_LIBRARIES ${QT_LIBRARIES} ${QT_${module}_LIB_DEPENDENCIES})
|
||||||
|
ENDIF(QT_IS_STATIC)
|
||||||
FOREACH(depend_module ${QT_${module}_MODULE_DEPENDS})
|
FOREACH(depend_module ${QT_${module}_MODULE_DEPENDS})
|
||||||
SET(QT_USE_${depend_module}_DEPENDS 1)
|
SET(QT_USE_${depend_module}_DEPENDS 1)
|
||||||
ENDFOREACH(depend_module ${QT_${module}_MODULE_DEPENDS})
|
ENDFOREACH(depend_module ${QT_${module}_MODULE_DEPENDS})
|
||||||
|
|
Loading…
Reference in New Issue