diff options
| -rw-r--r-- | modules/Qt4ConfigDependentSettings.cmake | 32 | 
1 files changed, 25 insertions, 7 deletions
| diff --git a/modules/Qt4ConfigDependentSettings.cmake b/modules/Qt4ConfigDependentSettings.cmake index 55f7097f..f6062a74 100644 --- a/modules/Qt4ConfigDependentSettings.cmake +++ b/modules/Qt4ConfigDependentSettings.cmake @@ -36,8 +36,7 @@ ENDIF(UNIX)  # 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. @@ -49,12 +48,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 | 
