From 0aee40de52e378aee96147f2df4c54e44b2b3e8a Mon Sep 17 00:00:00 2001 From: clintlombard Date: Tue, 11 Oct 2022 11:46:11 +0200 Subject: [PATCH] Add CMake flag FORCE_OPENGL_ENABLED --- CMakeLists.txt | 3 ++- src/feature/sift.cc | 2 -- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 4759a9424..9c368659a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -60,6 +60,7 @@ option(IPO_ENABLED "Whether to enable interprocedural optimization" ON) option(CUDA_ENABLED "Whether to enable CUDA, if available" ON) option(GUI_ENABLED "Whether to enable the graphical UI" ON) option(OPENGL_ENABLED "Whether to enable OpenGL, if available" ON) +option(FORCE_OPENGL_ENABLED "Force enable OpenGL even if GUI_ENABLED=OFF" OFF) option(TESTS_ENABLED "Whether to build test binaries" OFF) option(ASAN_ENABLED "Whether to enable AddressSanitizer flags" OFF) option(PROFILING_ENABLED "Whether to enable google-perftools linker flags" OFF) @@ -131,7 +132,7 @@ if(GUI_ENABLED) endif() endif() -if(OPENGL_ENABLED AND NOT GUI_ENABLED) +if(OPENGL_ENABLED AND NOT GUI_ENABLED AND NOT FORCE_OPENGL_ENABLED) message(STATUS "Disabling GUI will also disable OpenGL") set(OPENGL_ENABLED OFF) endif() diff --git a/src/feature/sift.cc b/src/feature/sift.cc index be90e2cd9..863251808 100644 --- a/src/feature/sift.cc +++ b/src/feature/sift.cc @@ -36,9 +36,7 @@ #include #include "FLANN/flann.hpp" -#if !defined(GUI_ENABLED) && !defined(CUDA_ENABLED) #include "GL/glew.h" -#endif #include "SiftGPU/SiftGPU.h" #include "VLFeat/covdet.h" #include "VLFeat/sift.h"