]> git.zarvox.org Git - libtouchmouse.git/commitdiff
Make qtview example optional.
authorDrew Fisher <drew.m.fisher@gmail.com>
Sun, 13 Nov 2011 03:36:33 +0000 (19:36 -0800)
committerDrew Fisher <drew.m.fisher@gmail.com>
Sun, 13 Nov 2011 03:36:33 +0000 (19:36 -0800)
Signed-off-by: Drew Fisher <drew.m.fisher@gmail.com>
examples/qtview/CMakeLists.txt

index 8e7a2f4959f723d4add22059e9f78897553e2b88..0bd704b5fd46b5ac9b75d59aafa77f3e8c773ea5 100644 (file)
@@ -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()