cmake HAS_GL option, by default true, affect graphic and qglview
This commit is contained in:
@@ -31,6 +31,7 @@ endif()
|
|||||||
|
|
||||||
option(UTILS "Build various utils" ${_plugins_default_})
|
option(UTILS "Build various utils" ${_plugins_default_})
|
||||||
option(DESIGNER_PLUGINS "Build Qt designer plugins" ${_plugins_default_})
|
option(DESIGNER_PLUGINS "Build Qt designer plugins" ${_plugins_default_})
|
||||||
|
option(HAS_GL "Build with OpenGL" ${_plugins_default_})
|
||||||
|
|
||||||
macro(qad_library NAME _MODULES _LIBS)
|
macro(qad_library NAME _MODULES _LIBS)
|
||||||
shstk_qad_project(qad_${NAME} FALSE "qad" "${_MODULES}" "${_LIBS}" ${ARGN})
|
shstk_qad_project(qad_${NAME} FALSE "qad" "${_MODULES}" "${_LIBS}" ${ARGN})
|
||||||
|
|||||||
@@ -1 +1,10 @@
|
|||||||
qad_library(graphic "Gui;Widgets;OpenGL;OpenGLWidgets" "qad_widgets;${OPENGL_LIBRARIES}")
|
set(_mods Gui Widgets)
|
||||||
|
set(_libs qad_widgets)
|
||||||
|
if (HAS_GL)
|
||||||
|
list(APPEND _mods OpenGL OpenGLWidgets)
|
||||||
|
list(APPEND _libs ${OPENGL_LIBRARIES})
|
||||||
|
endif()
|
||||||
|
qad_library(graphic "${_mods}" "${_libs}")
|
||||||
|
if (NOT HAS_GL)
|
||||||
|
qad_target_compile_definitions(qad_graphic PRIVATE FORCE_NO_GL)
|
||||||
|
endif()
|
||||||
|
|||||||
@@ -15,7 +15,9 @@
|
|||||||
# include <QRandomGenerator>
|
# include <QRandomGenerator>
|
||||||
#endif
|
#endif
|
||||||
#ifndef Q_OS_ANDROID
|
#ifndef Q_OS_ANDROID
|
||||||
# define HAS_GL
|
# ifndef FORCE_NO_GL
|
||||||
|
# define HAS_GL
|
||||||
|
# endif
|
||||||
#endif
|
#endif
|
||||||
#ifdef HAS_GL
|
#ifdef HAS_GL
|
||||||
# ifndef GL_MULTISAMPLE
|
# ifndef GL_MULTISAMPLE
|
||||||
@@ -361,7 +363,7 @@ void Graphic::canvasPaintEvent() {
|
|||||||
if (grid)
|
if (grid)
|
||||||
drawGrid();
|
drawGrid();
|
||||||
p.setRenderHint(QPainter::Antialiasing, aalias);
|
p.setRenderHint(QPainter::Antialiasing, aalias);
|
||||||
#ifndef ANDROID
|
#ifdef HAS_GL
|
||||||
if (isOGL) {
|
if (isOGL) {
|
||||||
if (aalias) glEnable(GL_MULTISAMPLE);
|
if (aalias) glEnable(GL_MULTISAMPLE);
|
||||||
else glDisable(GL_MULTISAMPLE);
|
else glDisable(GL_MULTISAMPLE);
|
||||||
@@ -1627,6 +1629,10 @@ void Graphic::on_graphic_buttonConfigure_clicked() {
|
|||||||
conf->ui->comboStyleGrid->setCurrentIndex((int)grid_pen.style());
|
conf->ui->comboStyleGrid->setCurrentIndex((int)grid_pen.style());
|
||||||
conf->ui->spinWidthGrid->setValue(grid_pen.widthF());
|
conf->ui->spinWidthGrid->setValue(grid_pen.widthF());
|
||||||
conf->ui->checkOGL->setChecked(isOGL);
|
conf->ui->checkOGL->setChecked(isOGL);
|
||||||
|
#ifndef HAS_GL
|
||||||
|
conf->ui->checkOGL->setEnabled(false);
|
||||||
|
conf->ui->checkOGL->setChecked(false);
|
||||||
|
#endif
|
||||||
conf->ui->checkAAlias->setChecked(aalias);
|
conf->ui->checkAAlias->setChecked(aalias);
|
||||||
conf->ui->checkInputs->setChecked(borderInputsVisible());
|
conf->ui->checkInputs->setChecked(borderInputsVisible());
|
||||||
conf->ui->checkStatus->setChecked(statusVisible());
|
conf->ui->checkStatus->setChecked(statusVisible());
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
if (((DEFINED QGLVIEW) AND QGLVIEW) OR (NOT DEFINED QGLVIEW))
|
if (((DEFINED QGLVIEW) AND QGLVIEW AND HAS_GL) OR (NOT DEFINED QGLVIEW))
|
||||||
find_package(OpenGL REQUIRED)
|
find_package(OpenGL REQUIRED)
|
||||||
shstk_qad_project(qglview FALSE "qad" "Gui;OpenGL;Xml" "qad_widgets;qad_utils;${OPENGL_LIBRARIES}")
|
shstk_qad_project(qglview FALSE "qad" "Gui;OpenGL;Xml" "qad_widgets;qad_utils;${OPENGL_LIBRARIES}")
|
||||||
shstk_qad_install("qad" FALSE qglview "${out_HDR}" "${out_QM}")
|
shstk_qad_install("qad" FALSE qglview "${out_HDR}" "${out_QM}")
|
||||||
|
|||||||
Reference in New Issue
Block a user