summaryrefslogtreecommitdiffstats
path: root/Modules/FindQt.cmake
blob: c82e32ac4bfc55a415622405b9c89df2b0b44b1e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
# 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_MOC_EXE, where to find the moc tool
# QT_UIC_EXE, where to find the uic 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.
# QT_WRAP_UI, This allows the QT_WRAP_UI 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}
  )

  FIND_FILE(QT_UIC_EXE uic
    ${QTDIR}/bin
    ${path}
  )

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}
  )

  FIND_FILE(QT_UIC_EXE uic.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)

IF (QT_UIC_EXE)
  SET ( QT_WRAP_UI 1 CACHE BOOL "Can we honour the QT_WRAP_UI command" )
ENDIF (QT_UIC_EXE)