@@ -33,29 +33,29 @@ set_optimization_flags() # detect and set default optimization flags
3333set_compiler_booleans() # detect compiler 
3434
3535# 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} )
4040
4141# 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} )
4545
4646# 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 )
5050
5151# 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 )
5555
5656# 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 )
5959
6060####################################################### 
6161### Apply global options                            ### 
@@ -64,23 +64,23 @@ option(WITH_SYSTEM_NODESOUP "Use system-provided nodesoup instead of bundled" OF
6464if  (MASTER_PROJECT)
6565    message ("Setting global options" )
6666    # Maybe add sanitizers to all targets 
67-     if  (BUILD_WITH_SANITIZERS  AND  NOT  EMSCRIPTEN)
67+     if  (MATPLOTPP_BUILD_WITH_SANITIZERS  AND  NOT  EMSCRIPTEN)
6868        add_sanitizers()
6969    endif  ()
7070
7171    # Allow exceptions in MSVC 
72-     if  (MSVC  AND  BUILD_WITH_EXCEPTIONS )
72+     if  (MSVC  AND  MATPLOTPP_BUILD_WITH_EXCEPTIONS )
7373        add_compile_options (/EHsc)
7474    endif  ()
7575
7676    # Allow utf-8 in MSVC 
77-     if  (BUILD_WITH_UTF8  AND  MSVC )
77+     if  (MATPLOTPP_BUILD_WITH_UTF8  AND  MSVC )
7878        set (CMAKE_CXX_FLAGS  "/utf-8" )
7979    endif  ()
8080
8181    # MSVC hack to disable windows min/max 
8282    # 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 )
8484        # Check for min in Windows.h 
8585        # include(CheckSymbolExists) 
8686        # check_symbol_exists(min "WinDef.h" HAVE_WINDOWS_MINMAX) 
@@ -101,7 +101,7 @@ add_subdirectory(source)
101101####################################################### 
102102### Tests                                           ### 
103103####################################################### 
104- if  (BUILD_TESTS )
104+ if  (MATPLOTPP_BUILD_TESTS )
105105    include (CTest)
106106    enable_testing ()
107107    add_subdirectory (test )
@@ -110,14 +110,14 @@ endif ()
110110####################################################### 
111111### Examples                                        ### 
112112####################################################### 
113- if  (BUILD_EXAMPLES )
113+ if  (MATPLOTPP_BUILD_EXAMPLES )
114114    add_subdirectory (examples)
115115endif  ()
116116
117117####################################################### 
118118### Installer                                       ### 
119119####################################################### 
120- if  (BUILD_INSTALLER )
120+ if  (MATPLOTPP_BUILD_INSTALLER )
121121    # https://cliutils.gitlab.io/modern-cmake/chapters/install/installing.html 
122122    # Set variable where the cmake config is 
123123    set (CONFIG_INSTALL_DIR ${CMAKE_INSTALL_LIBDIR} /cmake/Matplot++)
@@ -147,7 +147,7 @@ if (BUILD_INSTALLER)
147147            DESTINATION  ${CMAKE_INSTALL_LIBDIR} /cmake/Matplot++)
148148
149149    # Install cmake to find filesystem as a dependency 
150-     if  (NOT  BUILD_SHARED_LIBS )
150+     if  (NOT  MATPLOTPP_BUILD_SHARED_LIBS )
151151        install (FILES  ${CMAKE_CURRENT_SOURCE_DIR} /cmake/FindFilesystem.cmake
152152                DESTINATION  ${CMAKE_INSTALL_LIBDIR} /cmake/Matplot++)
153153    endif  ()
@@ -156,7 +156,7 @@ endif ()
156156####################################################### 
157157### Packages                                        ### 
158158####################################################### 
159- if  (BUILD_INSTALLER  AND  BUILD_PACKAGE )
159+ if  (MATPLOTPP_BUILD_INSTALLER  AND  MATPLOTPP_BUILD_PACKAGE )
160160    # Set the cpack variables 
161161    # https://cliutils.gitlab.io/modern-cmake/chapters/install/packaging.html 
162162
0 commit comments