diff options
author | Ian Scott <ian.m.scott@stud.man.ac.uk> | 2001-10-16 19:32:38 (GMT) |
---|---|---|
committer | Ian Scott <ian.m.scott@stud.man.ac.uk> | 2001-10-16 19:32:38 (GMT) |
commit | 99423f444a61ee12733aaa35102298a93390e24f (patch) | |
tree | 7fd29c97eac5b320bd3f1b21a44e2f3bd5503a73 | |
parent | 1830690a0dc0719922bd7cb51dc8502d884c873e (diff) | |
download | CMake-99423f444a61ee12733aaa35102298a93390e24f.zip CMake-99423f444a61ee12733aaa35102298a93390e24f.tar.gz CMake-99423f444a61ee12733aaa35102298a93390e24f.tar.bz2 |
Some simple modules for finding and linking qt
-rw-r--r-- | Modules/FindQt.cmake | 64 | ||||
-rw-r--r-- | Modules/LinkQT.cmake | 10 |
2 files changed, 74 insertions, 0 deletions
diff --git a/Modules/FindQt.cmake b/Modules/FindQt.cmake new file mode 100644 index 0000000..db78d71 --- /dev/null +++ b/Modules/FindQt.cmake @@ -0,0 +1,64 @@ +# Locate Qt include paths and libraries + +# This module defines +QT_INCLUDE_PATH, where to find qt.h, etc. +QT_QT_LIBRARY, where to find the qt library +QT_MOX_EXE, where to find the moc tool +USE_QT_FILE, a file for any CMakeLists.txt file to include to actually link against qt +QT_WRAP_CPP, This allows the QT_WRAP_CPP command to work. + + +IF (UNIX) + + FIND_PATH(QT_INCLUDE_PATH qt.h + ${QTDIR}/include + /usr/local/qt/include + /usr/local/include + /usr/include + ) + + FIND_LIBRARY(QT_QT_LIBRARY qt + ${QTDIR}/lib + /usr/local/qt/lib + /usr/local/lib + /usr/lib + ) + + FIND_FILE(QT_MOC_EXE moc + ${QTDIR}/bin + ${path} + ) + + LINK_LIBRARIES( ${QT_QT_LIBRARY} ) + +ENDIF (UNIX) + +IF (WIN32) + # Not sure where to look for Qt under windows + # Assume that QTDIR has been set + + FIND_PATH(QT_INCLUDE_PATH qt.h + ${QTDIR}/include + ) + + FIND_LIBRARY(QT_QT_LIBRARY qt + ${QTDIR}/lib + ) + + FIND_FILE(QT_MOC_EXE moc.exe + ${QTDIR}/bin + ${path} + ) + +ENDIF (WIN32) + + +IF (QT_MOC_EXE) + SET ( QT_WRAP_CPP 1 CACHE BOOL "Can we honour the QT_WRAP_CPP command" ) +ENDIF (QT_MOC_EXE) + +SET (USE_QT_FILE ${CMAKE_ROOT}/Modules/LinkQT.cmake CACHE STRING "Include this file to actually link against QT") + + + + diff --git a/Modules/LinkQT.cmake b/Modules/LinkQT.cmake new file mode 100644 index 0000000..213c1af --- /dev/null +++ b/Modules/LinkQT.cmake @@ -0,0 +1,10 @@ +# Link in QT + + +IF (WIN32) + LINK_LIBRARIES( imm32.lib ws2_32.lib) +#Ensure that qt.lib is last +ENDIF (WIN32) + + +LINK_LIBRARIES( ${QT_QT_LIBRARY}) |