Skip to content

Commit a672f65

Browse files
build: trace gnuplot commands option
1 parent bdf62ff commit a672f65

File tree

3 files changed

+10
-1
lines changed

3 files changed

+10
-1
lines changed

CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ option(MATPLOTPP_BUILD_HIGH_RESOLUTION_WORLD_MAP "Compile the high resolution ma
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)
5959
option(MATPLOTPP_WITH_OPENCV "Use OpenCV in CImg" ON)
60+
option(MATPLOT_TRACE_GNUPLOT_COMMANDS "Show gnuplot commands used for drawing" OFF)
6061

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

source/matplot/CMakeLists.txt

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -156,6 +156,14 @@ else ()
156156
message("Not including the high resolution maps for geoplots")
157157
endif ()
158158

159+
# Tracing gnuplot commands for debugging
160+
if (MATPLOT_TRACE_GNUPLOT_COMMANDS)
161+
if (MATPLOTPP_BUILD_FOR_DOCUMENTATION_IMAGES)
162+
message(FATAL_ERROR "MATPLOT_TRACE_GNUPLOT_COMMANDS is not compatible with MATPLOTPP_BUILD_FOR_DOCUMENTATION_IMAGES")
163+
endif()
164+
target_compile_definitions(matplot PUBLIC MATPLOT_TRACE_GNUPLOT_COMMANDS)
165+
endif ()
166+
159167
#######################################################
160168
### Library options ###
161169
#######################################################

source/matplot/backend/gnuplot.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ namespace matplot::backend {
7373
// http://www.gnuplot.info/files/gpReadMouseTest.c
7474
static constexpr bool allow_using_mouse = true;
7575

76-
#if defined(TRACE_GNUPLOT_COMMANDS) && \
76+
#if defined(MATPLOT_TRACE_GNUPLOT_COMMANDS) && \
7777
!defined(MATPLOT_BUILD_FOR_DOCUMENTATION_IMAGES)
7878
static constexpr bool trace_commands = true;
7979
#else

0 commit comments

Comments
 (0)