Skip to content

Commit e8b3e31

Browse files
authored
Correct cmake variables
* correct cmake install target condition The cmake variable BUILD_INSTALLER was renamed to MATPLOTPP_BUILD_INSTALLER, but it was not updated in source/matplot/CMakeLists.txt. As a result Matplot++ was not installed completely via cmake install target with cmake presets provided. This patch completes the renaming and now cmake install works as expected. * correct more cmake variable names after rename I found more variables that seemed to be missed by the recent renaming. This patch completes renaming of variables: - BUILD_FOR_DOCUMENTATION_IMAGES - BUILD_HIGH_RESOLUTION_WORLD_MAP - BUILD_WITH_PEDANTIC_WARNINGS - BUILD_EXPERIMENTAL_OPENGL_BACKEND
1 parent 7b757c0 commit e8b3e31

File tree

6 files changed

+13
-13
lines changed

6 files changed

+13
-13
lines changed

cmake/functions/target_options.cmake

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ endfunction()
1111

1212
# @brief Maybe enable pedantic warnings for a target
1313
function(maybe_target_pedantic_warnings TARGET_NAME)
14-
if (BUILD_WITH_PEDANTIC_WARNINGS)
14+
if (MATPLOTPP_BUILD_WITH_PEDANTIC_WARNINGS)
1515
target_pedantic_warnings(${TARGET_NAME})
1616
endif ()
1717
endfunction ()
@@ -30,7 +30,7 @@ endmacro()
3030

3131
# @brief Maybe set pedantic compiler options for all targets
3232
macro(maybe_add_pedantic_warnings)
33-
if (BUILD_WITH_PEDANTIC_WARNINGS)
33+
if (MATPLOTPP_BUILD_WITH_PEDANTIC_WARNINGS)
3434
add_pedantic_warnings()
3535
endif ()
3636
endmacro()
@@ -93,4 +93,4 @@ endfunction()
9393
# based on check_symbol_exists hasn't been enough.
9494
function(target_nominmax_definition TARGET_NAME)
9595
target_compile_definitions(${TARGET_NAME} PUBLIC NOMINMAX)
96-
endfunction()
96+
endfunction()

index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2215,7 +2215,7 @@ There are two dependencies in [`source/3rd_party`](source/3rd_party). These depe
22152215

22162216
You can define `WITH_SYSTEM_NODESOUP=ON` or `WITH_SYSTEM_CIMG=ON` in the cmake command line to use a system-provided version of these dependencies.
22172217

2218-
There's an extra target `matplot_opengl` with the experimental [OpenGL backend](#backends). You need to define `BUILD_EXPERIMENTAL_OPENGL_BACKEND=ON` in the CMake command line to build that target. In that case, the build script will also look for these extra dependencies:
2218+
There's an extra target `matplot_opengl` with the experimental [OpenGL backend](#backends). You need to define `MATPLOTPP_BUILD_EXPERIMENTAL_OPENGL_BACKEND=ON` in the CMake command line to build that target. In that case, the build script will also look for these extra dependencies:
22192219

22202220
* OpenGL
22212221
* GLAD

source/matplot/CMakeLists.txt

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -144,13 +144,13 @@ if (HAVE_FBUFSIZE)
144144
endif()
145145

146146
# Build for documentation
147-
if (BUILD_FOR_DOCUMENTATION_IMAGES)
147+
if (MATPLOTPP_BUILD_FOR_DOCUMENTATION_IMAGES)
148148
message("Building matplot for documentation images. wait() commands will be ignored. ~figure will save the files.")
149149
target_compile_definitions(matplot PUBLIC MATPLOT_BUILD_FOR_DOCUMENTATION_IMAGES)
150150
endif ()
151151

152152
# Include high-resolution world map in the binary
153-
if (BUILD_HIGH_RESOLUTION_WORLD_MAP)
153+
if (MATPLOTPP_BUILD_HIGH_RESOLUTION_WORLD_MAP)
154154
target_compile_definitions(matplot PUBLIC MATPLOT_BUILD_HIGH_RESOLUTION_WORLD_MAP)
155155
else ()
156156
message("Not including the high resolution maps for geoplots")
@@ -163,7 +163,7 @@ endif ()
163163
# Maybe add pedantic warning
164164

165165

166-
#if (BUILD_WITH_PEDANTIC_WARNINGS)
166+
#if (MATPLOTPP_BUILD_WITH_PEDANTIC_WARNINGS)
167167
# if (MSVC)
168168
# target_compile_options(matplot PRIVATE /W4 /WX)
169169
# else ()
@@ -182,7 +182,7 @@ endif ()
182182
#######################################################
183183
### Experimental OpenGL backend ###
184184
#######################################################
185-
if (BUILD_EXPERIMENTAL_OPENGL_BACKEND)
185+
if (MATPLOTPP_BUILD_EXPERIMENTAL_OPENGL_BACKEND)
186186
# Library for the OpenGL example
187187
# This is an example of what an OpenGL backend *could* look like.
188188
# The opengl backend is currently incomplete.
@@ -252,7 +252,7 @@ endif()
252252
#######################################################
253253
### Installer ###
254254
#######################################################
255-
if (BUILD_INSTALLER)
255+
if (MATPLOTPP_BUILD_INSTALLER)
256256
# Install targets
257257
install(TARGETS matplot
258258
EXPORT Matplot++Targets

test/backends/CMakeLists.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
if (BUILD_EXPERIMENTAL_OPENGL_BACKEND)
1+
if (MATPLOTPP_BUILD_EXPERIMENTAL_OPENGL_BACKEND)
22
# Use this to create an OpenGL window as backend
33
add_executable(matplot_opengl_test ogl_main.cpp)
44
target_link_libraries(matplot_opengl_test PUBLIC matplot_opengl)
55

66
# Use this to create plots inside an existing OpenGL application
77
add_executable(matplot_opengl_embed_test ogl_embed_main.cpp)
88
target_link_libraries(matplot_opengl_embed_test PUBLIC matplot_opengl)
9-
endif ()
9+
endif ()

test/generate_examples/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,4 @@ This is a visual unit test where the `generate_examples` target will run all oth
44

55
Everytime we update the library, we regenerate the examples to make sure everything is not only working ok but also *looking* good.
66

7-
The library needs to be compiled with the CMake option `BUILD_FOR_DOCUMENTATION_IMAGES` for this test to work. Also, you need to run this target from the project root directory so that the filesystem can find the build and documentation directories.
7+
The library needs to be compiled with the CMake option `MATPLOTPP_BUILD_FOR_DOCUMENTATION_IMAGES` for this test to work. Also, you need to run this target from the project root directory so that the filesystem can find the build and documentation directories.

test/generate_examples/main.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
#include <regex>
66

77
int main() {
8-
// Set CMake option BUILD_FOR_DOCUMENTATION_IMAGES to ON and
8+
// Set CMake option MATPLOTPP_BUILD_FOR_DOCUMENTATION_IMAGES to ON and
99
// run this executable from the root directory as working
1010
// directory to run all examples.
1111
// If will set 1) the figure object to save the figure when being destroyed

0 commit comments

Comments
 (0)