ENH: when linking in QT, we should also link DL, since QT uses them

This commit is contained in:
Andy Cedilnik 2003-07-30 15:38:58 -04:00
parent 9549a5f1dd
commit 7762431bb0
1 changed files with 62 additions and 59 deletions

View File

@ -64,45 +64,48 @@ IF (QT_UIC_EXECUTABLE)
ENDIF (QT_UIC_EXECUTABLE)
IF(QT_INCLUDE_DIR)
IF(QT_INCLUDE_DIR)
IF(QT_QT_LIBRARY)
SET( QT_LIBRARIES ${QT_LIBRARIES} ${QT_QT_LIBRARY} )
SET( QT_LIBRARIES ${QT_LIBRARIES} ${QT_QT_LIBRARY} )
SET( QT_FOUND "YES" )
SET( QT_DEFINITIONS "")
IF (WIN32)
IF (QT_QTMAIN_LIBRARY)
# for version 3
IF (QT_QTMAIN_LIBRARY)
# for version 3
SET (QT_DEFINITIONS -DQT_DLL)
SET (QT_LIBRARIES imm32.lib ${QT_QT_LIBRARY} ${QT_QTMAIN_LIBRARY} )
ELSE (QT_QTMAIN_LIBRARY)
# for version 2
ELSE (QT_QTMAIN_LIBRARY)
# for version 2
SET (QT_LIBRARIES imm32.lib ws2_32.lib ${QT_QT_LIBRARY} )
ENDIF (QT_QTMAIN_LIBRARY)
ELSE (WIN32)
SET (QT_LIBRARIES ${QT_QT_LIBRARY} )
ENDIF (WIN32)
ENDIF (WIN32)
# Backwards compatibility for CMake1.4 and 1.2
SET (QT_MOC_EXE ${QT_MOC_EXECUTABLE} )
SET (QT_UIC_EXE ${QT_UIC_EXECUTABLE} )
SET (QT_UIC_EXE ${QT_UIC_EXECUTABLE} )
IF(UNIX)
INCLUDE( ${CMAKE_ROOT}/Modules/FindX11.cmake )
IF (X11_FOUND)
SET (QT_LIBRARIES ${QT_LIBRARIES} ${X11_LIBRARIES})
ENDIF (X11_FOUND)
ENDIF(UNIX)
IF (CMAKE_DL_LIBS)
SET (QT_LIBRARIES ${QT_LIBRARIES} ${CMAKE_DL_LIBS})
ENDIF (CMAKE_DL_LIBS)
ENDIF(UNIX)
IF(QT_QT_LIBRARY MATCHES "qt-mt")
INCLUDE( ${CMAKE_ROOT}/Modules/FindThreads.cmake )
SET(QT_LIBRARIES ${QT_LIBRARIES} ${CMAKE_THREAD_LIBS_INIT})
SET(QT_LIBRARIES ${QT_LIBRARIES} ${CMAKE_THREAD_LIBS_INIT})
ENDIF(QT_QT_LIBRARY MATCHES "qt-mt")
ENDIF(QT_QT_LIBRARY)
ENDIF(QT_INCLUDE_DIR)
MARK_AS_ADVANCED(
MARK_AS_ADVANCED(
QT_INCLUDE_DIR
QT_QT_LIBRARY
QT_QTMAIN_LIBRARY
@ -110,4 +113,4 @@ MARK_AS_ADVANCED(
QT_MOC_EXECUTABLE
QT_WRAP_CPP
QT_WRAP_UI
)
)