diff --git a/CMakeLists.txt b/CMakeLists.txt index bde3cbf76..be2584b4e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -184,6 +184,7 @@ option(ENABLE_FGCOM "Set to ON to build the FGCom application (default)" ON option(ENABLE_FLITE "Set to ON to build the Flite text-to-speech module" ON) option(ENABLE_QT "Set to ON to build the internal Qt launcher" ON) option(ENABLE_TRAFFIC "Set to ON to build the external traffic generator modules" ON) +option(ENABLE_FGQCANVAS "Set to ON to build the Qt-based remote canvas application" ON) include (DetectArch) @@ -301,7 +302,13 @@ if (ENABLE_QT) message(STATUS " Qt5Widgets version: ${Qt5Widgets_VERSION_STRING}") message(STATUS " Qt5Widgets include dir: ${Qt5Widgets_INCLUDE_DIRS}") set(HAVE_QT 1) + else() + # don't try to build FGQCanvas if Qt wasn't found correctly + set(ENABLE_FGQCANVAS OFF) endif() +else() + message(STATUS "Qt support disabled") + set(ENABLE_FGQCANVAS OFF) endif (ENABLE_QT) ############################################################################## diff --git a/utils/CMakeLists.txt b/utils/CMakeLists.txt index 28ae66fa1..fd4b1bbb7 100644 --- a/utils/CMakeLists.txt +++ b/utils/CMakeLists.txt @@ -35,4 +35,6 @@ if(ENABLE_TRAFFIC) add_subdirectory(traffic) endif() -add_subdirectory(fgqcanvas) +if (ENABLE_FGQCANVAS) + add_subdirectory(fgqcanvas) +endif() diff --git a/utils/fgqcanvas/CMakeLists.txt b/utils/fgqcanvas/CMakeLists.txt index 3bd54b566..3538ab1b5 100644 --- a/utils/fgqcanvas/CMakeLists.txt +++ b/utils/fgqcanvas/CMakeLists.txt @@ -4,12 +4,7 @@ set(CMAKE_CXX_STANDARD_REQUIRED YES) project(FGQCanvas) -find_package(Qt5 5.1 COMPONENTS Widgets WebSockets) -if (Qt5Widgets_FOUND) - message(STATUS " Qt5 version: ${Qt5Widgets_VERSION_STRING}") - message(STATUS " Qt5 include dir: ${Qt5Widgets_INCLUDE_DIRS}") -endif() - +find_package(Qt5 5.3 REQUIRED COMPONENTS Widgets WebSockets) set(SOURCES temporarywidget.cpp @@ -37,7 +32,6 @@ set(SOURCES canvastreemodel.h ) -if (Qt5Widgets_FOUND) qt5_wrap_ui(uic_sources temporarywidget.ui) add_executable(fgqcanvas ${SOURCES} ${uic_sources}) @@ -49,4 +43,3 @@ target_include_directories(fgqcanvas PRIVATE ${PROJECT_SOURCE_DIR}) # so ui_foo.h files are found target_include_directories(fgqcanvas PRIVATE ${PROJECT_BINARY_DIR}) -endif()