From: Drew Fisher Date: Sun, 13 Nov 2011 03:36:33 +0000 (-0800) Subject: Make qtview example optional. X-Git-Url: http://git.zarvox.org/signup?a=commitdiff_plain;h=900945f37c9742ce8b093b510ef7b749196b9a0e;p=libtouchmouse.git Make qtview example optional. Signed-off-by: Drew Fisher --- diff --git a/examples/qtview/CMakeLists.txt b/examples/qtview/CMakeLists.txt index 8e7a2f4..0bd704b 100644 --- a/examples/qtview/CMakeLists.txt +++ b/examples/qtview/CMakeLists.txt @@ -1,20 +1,25 @@ -find_package(Qt4 REQUIRED QtCore QtGui) -include(${QT_USE_FILE}) -include_directories(${QT_INCLUDES}) +find_package(Qt4) -set (QTVIEW_HEADERS mousepoller.h mouseviewer.h) -set (QTVIEW_SOURCES mousepoller.cpp mouseviewer.cpp main.cpp) +if(QT4_FOUND) + message(STATUS "Found Qt4, will build qtview example") + include(${QT_USE_FILE}) + include_directories(${QT_INCLUDES}) -QT4_WRAP_CPP(QTVIEW_MOC_OUTFILES ${QTVIEW_HEADERS} ) + set (QTVIEW_HEADERS mousepoller.h mouseviewer.h) + set (QTVIEW_SOURCES mousepoller.cpp mouseviewer.cpp main.cpp) -add_executable(qtview ${QTVIEW_SOURCES} ${QTVIEW_MOC_OUTFILES}) -if(WIN32) - target_link_libraries(qtview touchmouse ${QT_LIBRARIES} setupapi) -elseif(NOT APPLE) - target_link_libraries(qtview touchmouse ${QT_LIBRARIES} usb-1.0 pthread rt) -else() - target_link_libraries(qtview touchmouse ${QT_LIBRARIES}) -endif() + QT4_WRAP_CPP(QTVIEW_MOC_OUTFILES ${QTVIEW_HEADERS} ) + add_executable(qtview ${QTVIEW_SOURCES} ${QTVIEW_MOC_OUTFILES}) + if(WIN32) + target_link_libraries(qtview touchmouse ${QT_LIBRARIES} setupapi) + elseif(NOT APPLE) + target_link_libraries(qtview touchmouse ${QT_LIBRARIES} usb-1.0 pthread rt) + else() + target_link_libraries(qtview touchmouse ${QT_LIBRARIES}) + endif() +else() + message(STATUS "Didn't find Qt, will not build qtview example") +endif()