From 56ee3b43a98642b734005d230b364ffdc71d605c Mon Sep 17 00:00:00 2001 From: Clinton Stimpson Date: Tue, 15 Dec 2009 16:16:45 -0500 Subject: BUG: Fix #10021 don't specify libraries Qt depends on unless Qt is static. --- Modules/Qt4ConfigDependentSettings.cmake | 32 +++++++++++++++++++++++++------- 1 file changed, 25 insertions(+), 7 deletions(-) (limited to 'Modules/Qt4ConfigDependentSettings.cmake') diff --git a/Modules/Qt4ConfigDependentSettings.cmake b/Modules/Qt4ConfigDependentSettings.cmake index 1fe77281ee..0c440b628a 100644 --- a/Modules/Qt4ConfigDependentSettings.cmake +++ b/Modules/Qt4ConfigDependentSettings.cmake @@ -22,8 +22,7 @@ # find dependencies for some Qt modules # when doing builds against a static Qt, they are required -# when doing builds against a shared Qt, they are sometimes not required -# even some Linux distros do not require these dependencies +# when doing builds against a shared Qt, they are not required # if a user needs the dependencies, and they couldn't be found, they can set # the variables themselves. @@ -35,12 +34,31 @@ SET(QT_QTDBUS_LIB_DEPENDENCIES "") SET(QT_QTHELP_LIB_DEPENDENCIES ${QT_QTCLUCENE_LIBRARY}) -# build using shared Qt needs -DQT_DLL -IF(WIN32 AND NOT QT_CONFIG MATCHES "static") - # warning currently only qconfig.pri on Windows potentially contains "static" - # so QT_DLL might not get defined properly on other platforms. +IF(WIN32) + # On Windows, qconfig.pri has "static" for static library builds + IF(QT_CONFIG MATCHES "static") + 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) -ENDIF(WIN32 AND NOT QT_CONFIG MATCHES "static") +ENDIF(WIN32 AND NOT QT_IS_STATIC) # QtOpenGL dependencies -- cgit v1.2.1