1
0
Fork 0

Make FGQCanvas a bit more optional.

This commit is contained in:
James Turner 2016-12-19 17:54:37 +00:00
parent 351dfdb498
commit 106b62caa5
3 changed files with 11 additions and 9 deletions

View file

@ -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)
##############################################################################

View file

@ -35,4 +35,6 @@ if(ENABLE_TRAFFIC)
add_subdirectory(traffic)
endif()
add_subdirectory(fgqcanvas)
if (ENABLE_FGQCANVAS)
add_subdirectory(fgqcanvas)
endif()

View file

@ -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()