~sil2100/libdbusmenu-qt/libdbusmenu-qt5-inline

« back to all changes in this revision

Viewing changes to CMakeLists.txt

  • Committer: Renato Araujo Oliveira Filho
  • Author(s): David Faure
  • Date: 2013-01-03 18:52:31 UTC
  • mfrom: (236.2.1 libdbusmenu-qt)
  • Revision ID: renato.filho@canonical.com-20130103185231-roh3ycm52e0km3zd
It makes it compile against Qt5 when Qt5 is found, but keeps full
compatibility with Qt4 otherwise.

Show diffs side-by-side

added added

removed removed

Lines of Context:
44
44
    )
45
45
add_dependencies(distcheck dist)
46
46
 
 
47
find_package(Qt5Widgets QUIET)
 
48
if (Qt5Widgets_FOUND)
 
49
   find_package(Qt5DBus REQUIRED)
 
50
   include_directories(${Qt5Widgets_INCLUDE_DIRS} ${Qt5DBus_INCLUDE_DIRS})
 
51
   find_package(extra-cmake-modules 0.0.2 REQUIRED)
 
52
   set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${EXTRA_CMAKE_MODULES_MODULE_PATH})
 
53
   find_package(Qt5Transitional REQUIRED Core)
 
54
   set(CMAKE_AUTOMOC ON)
 
55
   set(CMAKE_AUTOMOC_RELAXED_MODE ON)
 
56
else()
47
57
find_package(Qt4 REQUIRED)
48
 
 
49
58
include_directories(
50
59
    ${QT_INCLUDE_DIR}
51
60
    ${QT_QTCORE_INCLUDE_DIR}
52
61
    ${QT_QTDBUS_INCLUDE_DIR}
53
62
    ${QT_QTGUI_INCLUDE_DIR}
54
63
    )
 
64
endif()
 
65
 
55
66
 
56
67
configure_file(dbusmenu-qt.pc.in ${CMAKE_BINARY_DIR}/dbusmenu-qt.pc @ONLY)
57
68
 
60
71
    )
61
72
 
62
73
add_subdirectory(src)
 
74
if (NOT Qt5Widgets_FOUND) # TODO port tests to Qt5
63
75
add_subdirectory(tests)
 
76
endif()
64
77
add_subdirectory(tools)
65
78
 
66
79
if(WITH_DOC)