Skip to content

Commit fe308e1

Browse files
authored
build: CMake option to disable OpenCV with CImg
1 parent 4afebf1 commit fe308e1

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

CMakeLists.txt

+1
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ option(MATPLOTPP_BUILD_WITH_EXCEPTIONS "Add compiler flags to use exceptions." O
5656
option(MATPLOTPP_BUILD_HIGH_RESOLUTION_WORLD_MAP "Compile the high resolution maps for geoplots" ON)
5757
option(MATPLOTPP_BUILD_FOR_DOCUMENTATION_IMAGES "Bypass show() commands and save figures as .svg at destruction" OFF)
5858
option(MATPLOTPP_BUILD_EXPERIMENTAL_OPENGL_BACKEND "Compile target with the experimental OpenGL backend" OFF)
59+
option(MATPLOTPP_WITH_OPENCV "Use OpenCV in CImg" ON)
5960

6061
# Where to find dependencies
6162
option(MATPLOTPP_WITH_SYSTEM_CIMG "Use system-provided CImg.h instead of bundled" OFF)

source/3rd_party/CMakeLists.txt

+3-1
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,9 @@ endif()
117117
if (CMAKE_MODULE_PATH)
118118
find_package(OpenCV QUIET)
119119
if (OpenCV_FOUND)
120-
target_compile_definitions(cimg INTERFACE cimg_use_opencv)
120+
if (MATPLOTPP_WITH_OPENCV)
121+
target_compile_definitions(cimg INTERFACE cimg_use_opencv)
122+
endif()
121123
target_link_libraries(cimg INTERFACE ${OpenCV_LIBRARIES})
122124
target_include_directories(cimg INTERFACE ${OpenCV_INCLUDE_DIRS})
123125
endif()

0 commit comments

Comments
 (0)