UseQt4.cmake 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  1. # - Use Module for QT4
  2. # Sets up C and C++ to use Qt 4. It is assumed that FindQt.cmake
  3. # has already been loaded. See FindQt.cmake for information on
  4. # how to load Qt 4 into your CMake project.
  5. ADD_DEFINITIONS(${QT_DEFINITIONS})
  6. INCLUDE_DIRECTORIES(${QT_INCLUDE_DIR})
  7. SET(QT_LIBRARIES "")
  8. IF (QT_USE_QTMAIN)
  9. IF (WIN32)
  10. SET(QT_LIBRARIES ${QT_LIBRARIES} ${QT_QTMAIN_LIBRARY})
  11. ENDIF (WIN32)
  12. ENDIF (QT_USE_QTMAIN)
  13. # Macro for setting up compile flags for Qt modules
  14. MACRO(QT_MODULE_SETUP module)
  15. IF (QT_QT${module}_FOUND)
  16. ADD_DEFINITIONS(-DQT_${module}_LIB)
  17. INCLUDE_DIRECTORIES(${QT_QT${module}_INCLUDE_DIR})
  18. SET(QT_LIBRARIES ${QT_LIBRARIES} ${QT_QT${module}_LIBRARY})
  19. SET(QT_LIBRARIES ${QT_LIBRARIES} ${QT_${module}_LIB_DEPENDENCIES})
  20. ELSE (QT_QT${module}_FOUND)
  21. MESSAGE("Qt ${module} library not found.")
  22. ENDIF (QT_QT${module}_FOUND)
  23. ENDMACRO(QT_MODULE_SETUP)
  24. # Qt modules (in order of dependence)
  25. IF (QT_USE_QT3SUPPORT)
  26. QT_MODULE_SETUP(3SUPPORT)
  27. ADD_DEFINITIONS(-DQT3_SUPPORT)
  28. ENDIF (QT_USE_QT3SUPPORT)
  29. IF (QT_USE_QTOPENGL)
  30. QT_MODULE_SETUP(OPENGL)
  31. ENDIF (QT_USE_QTOPENGL)
  32. IF (QT_USE_QTASSISTANT)
  33. QT_MODULE_SETUP(ASSISTANT)
  34. ENDIF (QT_USE_QTASSISTANT)
  35. IF (QT_USE_QTDESIGNER)
  36. QT_MODULE_SETUP(DESIGNER)
  37. ENDIF (QT_USE_QTDESIGNER)
  38. IF (QT_USE_QTMOTIF)
  39. QT_MODULE_SETUP(MOTIF)
  40. ENDIF (QT_USE_QTMOTIF)
  41. IF (QT_USE_QTNSPLUGIN)
  42. QT_MODULE_SETUP(NSPLUGIN)
  43. ENDIF (QT_USE_QTNSPLUGIN)
  44. IF (QT_USE_QTSVG)
  45. QT_MODULE_SETUP(SVG)
  46. ENDIF (QT_USE_QTSVG)
  47. IF (QT_USE_QTUITOOLS)
  48. QT_MODULE_SETUP(UITOOLS)
  49. ENDIF (QT_USE_QTUITOOLS)
  50. IF (NOT QT_DONT_USE_QTGUI)
  51. QT_MODULE_SETUP(GUI)
  52. ENDIF (NOT QT_DONT_USE_QTGUI)
  53. IF (QT_USE_QTTEST)
  54. QT_MODULE_SETUP(TEST)
  55. ENDIF (QT_USE_QTTEST)
  56. IF (QT_USE_QTXML)
  57. QT_MODULE_SETUP(XML)
  58. ENDIF (QT_USE_QTXML)
  59. IF (QT_USE_QTSQL)
  60. QT_MODULE_SETUP(SQL)
  61. ENDIF (QT_USE_QTSQL)
  62. IF (QT_USE_QTNETWORK)
  63. QT_MODULE_SETUP(NETWORK)
  64. ENDIF (QT_USE_QTNETWORK)
  65. IF (NOT QT_DONT_USE_QTCORE)
  66. QT_MODULE_SETUP(CORE)
  67. ENDIF (NOT QT_DONT_USE_QTCORE)