@@ -33,29 +33,29 @@ set_optimization_flags() # detect and set default optimization flags
33
33
set_compiler_booleans() # detect compiler
34
34
35
35
# What to build
36
- option (BUILD_EXAMPLES "Build examples" ${MASTER_PROJECT} )
37
- option (BUILD_TESTS "Build tests" ${MASTER_PROJECT} )
38
- option (BUILD_INSTALLER "Build installer target" ${MASTER_PROJECT} )
39
- option (BUILD_PACKAGE "Build package" ${MASTER_PROJECT} )
36
+ option (MATPLOTPP_BUILD_EXAMPLES "Build examples" ${MASTER_PROJECT} )
37
+ option (MATPLOTPP_BUILD_TESTS "Build tests" ${MASTER_PROJECT} )
38
+ option (MATPLOTPP_BUILD_INSTALLER "Build installer target" ${MASTER_PROJECT} )
39
+ option (MATPLOTPP_BUILD_PACKAGE "Build package" ${MASTER_PROJECT} )
40
40
41
41
# How to build
42
- option (BUILD_WITH_PEDANTIC_WARNINGS "Use pedantic warnings. This is useful for developers because many of these warnings will be in continuous integration anyway." ${DEBUG_MODE} )
43
- option (BUILD_SHARED_LIBS "Build shared libraries" OFF )
44
- option (BUILD_WITH_SANITIZERS "Use pedantic warnings." ${DEBUG_MODE} )
42
+ option (MATPLOTPP_BUILD_WITH_PEDANTIC_WARNINGS "Use pedantic warnings. This is useful for developers because many of these warnings will be in continuous integration anyway." ${DEBUG_MODE} )
43
+ option (MATPLOTPP_BUILD_SHARED_LIBS "Build shared libraries" ${BUILD_SHARED_LIBS} )
44
+ option (MATPLOTPP_BUILD_WITH_SANITIZERS "Use pedantic warnings." ${DEBUG_MODE} )
45
45
46
46
# MSVC hacks
47
- option (BUILD_WITH_MSVC_HACKS "Accept utf-8 in MSVC by default." ON )
48
- option (BUILD_WITH_UTF8 "Accept utf-8 in MSVC by default." ON )
49
- option (BUILD_WITH_EXCEPTIONS "Add compiler flags to use exceptions." ON )
47
+ option (MATPLOTPP_BUILD_WITH_MSVC_HACKS "Accept utf-8 in MSVC by default." ON )
48
+ option (MATPLOTPP_BUILD_WITH_UTF8 "Accept utf-8 in MSVC by default." ON )
49
+ option (MATPLOTPP_BUILD_WITH_EXCEPTIONS "Add compiler flags to use exceptions." ON )
50
50
51
51
# Features
52
- option (BUILD_HIGH_RESOLUTION_WORLD_MAP "Compile the high resolution maps for geoplots" ON )
53
- option (BUILD_FOR_DOCUMENTATION_IMAGES "Bypass show() commands and save figures as .svg at destruction" OFF )
54
- option (BUILD_EXPERIMENTAL_OPENGL_BACKEND "Compile target with the experimental OpenGL backend" OFF )
52
+ option (MATPLOTPP_BUILD_HIGH_RESOLUTION_WORLD_MAP "Compile the high resolution maps for geoplots" ON )
53
+ option (MATPLOTPP_BUILD_FOR_DOCUMENTATION_IMAGES "Bypass show() commands and save figures as .svg at destruction" OFF )
54
+ option (MATPLOTPP_BUILD_EXPERIMENTAL_OPENGL_BACKEND "Compile target with the experimental OpenGL backend" OFF )
55
55
56
56
# Where to find dependencies
57
- option (WITH_SYSTEM_CIMG "Use system-provided CImg.h instead of bundled" OFF )
58
- option (WITH_SYSTEM_NODESOUP "Use system-provided nodesoup instead of bundled" OFF )
57
+ option (MATPLOTPP_WITH_SYSTEM_CIMG "Use system-provided CImg.h instead of bundled" OFF )
58
+ option (MATPLOTPP_WITH_SYSTEM_NODESOUP "Use system-provided nodesoup instead of bundled" OFF )
59
59
60
60
#######################################################
61
61
### Apply global options ###
@@ -64,23 +64,23 @@ option(WITH_SYSTEM_NODESOUP "Use system-provided nodesoup instead of bundled" OF
64
64
if (MASTER_PROJECT)
65
65
message ("Setting global options" )
66
66
# Maybe add sanitizers to all targets
67
- if (BUILD_WITH_SANITIZERS AND NOT EMSCRIPTEN)
67
+ if (MATPLOTPP_BUILD_WITH_SANITIZERS AND NOT EMSCRIPTEN)
68
68
add_sanitizers()
69
69
endif ()
70
70
71
71
# Allow exceptions in MSVC
72
- if (MSVC AND BUILD_WITH_EXCEPTIONS )
72
+ if (MSVC AND MATPLOTPP_BUILD_WITH_EXCEPTIONS )
73
73
add_compile_options (/EHsc)
74
74
endif ()
75
75
76
76
# Allow utf-8 in MSVC
77
- if (BUILD_WITH_UTF8 AND MSVC )
77
+ if (MATPLOTPP_BUILD_WITH_UTF8 AND MSVC )
78
78
set (CMAKE_CXX_FLAGS "/utf-8" )
79
79
endif ()
80
80
81
81
# MSVC hack to disable windows min/max
82
82
# http://www.suodenjoki.dk/us/archive/2010/min-max.htm
83
- if (MSVC AND BUILD_WITH_MSVC_HACKS )
83
+ if (MSVC AND MATPLOTPP_BUILD_WITH_MSVC_HACKS )
84
84
# Check for min in Windows.h
85
85
# include(CheckSymbolExists)
86
86
# check_symbol_exists(min "WinDef.h" HAVE_WINDOWS_MINMAX)
@@ -101,7 +101,7 @@ add_subdirectory(source)
101
101
#######################################################
102
102
### Tests ###
103
103
#######################################################
104
- if (BUILD_TESTS )
104
+ if (MATPLOTPP_BUILD_TESTS )
105
105
include (CTest)
106
106
enable_testing ()
107
107
add_subdirectory (test )
@@ -110,14 +110,14 @@ endif ()
110
110
#######################################################
111
111
### Examples ###
112
112
#######################################################
113
- if (BUILD_EXAMPLES )
113
+ if (MATPLOTPP_BUILD_EXAMPLES )
114
114
add_subdirectory (examples)
115
115
endif ()
116
116
117
117
#######################################################
118
118
### Installer ###
119
119
#######################################################
120
- if (BUILD_INSTALLER )
120
+ if (MATPLOTPP_BUILD_INSTALLER )
121
121
# https://cliutils.gitlab.io/modern-cmake/chapters/install/installing.html
122
122
# Set variable where the cmake config is
123
123
set (CONFIG_INSTALL_DIR ${CMAKE_INSTALL_LIBDIR} /cmake/Matplot++)
@@ -147,7 +147,7 @@ if (BUILD_INSTALLER)
147
147
DESTINATION ${CMAKE_INSTALL_LIBDIR} /cmake/Matplot++)
148
148
149
149
# Install cmake to find filesystem as a dependency
150
- if (NOT BUILD_SHARED_LIBS )
150
+ if (NOT MATPLOTPP_BUILD_SHARED_LIBS )
151
151
install (FILES ${CMAKE_CURRENT_SOURCE_DIR} /cmake/FindFilesystem.cmake
152
152
DESTINATION ${CMAKE_INSTALL_LIBDIR} /cmake/Matplot++)
153
153
endif ()
@@ -156,7 +156,7 @@ endif ()
156
156
#######################################################
157
157
### Packages ###
158
158
#######################################################
159
- if (BUILD_INSTALLER AND BUILD_PACKAGE )
159
+ if (MATPLOTPP_BUILD_INSTALLER AND MATPLOTPP_BUILD_PACKAGE )
160
160
# Set the cpack variables
161
161
# https://cliutils.gitlab.io/modern-cmake/chapters/install/packaging.html
162
162
0 commit comments