@@ -88,6 +88,7 @@ add_library(matplot
88
88
target_include_directories (matplot
89
89
PUBLIC $< BUILD_INTERFACE:${MATPLOT_ROOT_DIR} /source>
90
90
$< INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR} > )
91
+
91
92
target_link_libraries (matplot
92
93
PRIVATE cimg nodesoup std::filesystem )
93
94
@@ -101,7 +102,6 @@ if(MSVC)
101
102
target_compile_options (matplot PUBLIC /wd4305 )
102
103
# Fix compile error caused by utf8 character in line_spec.cpp
103
104
target_compile_options (matplot PUBLIC /utf-8 )
104
-
105
105
endif ()
106
106
107
107
include (CheckSymbolExists )
@@ -123,13 +123,21 @@ endif()
123
123
if (BUILD_FOR_DOCUMENTATION_IMAGES )
124
124
message ("Building matplot for documentation images. wait() commands will be ignored. ~figure will save the files." )
125
125
target_compile_definitions (matplot PUBLIC MATPLOT_BUILD_FOR_DOCUMENTATION_IMAGES )
126
- endif ()
126
+ endif ()
127
127
128
128
if (BUILD_HIGH_RESOLUTION_WORLD_MAP )
129
129
target_compile_definitions (matplot PUBLIC MATPLOT_BUILD_HIGH_RESOLUTION_WORLD_MAP )
130
- else ()
130
+ else ()
131
131
message ("Not including the high resolution maps for geoplots" )
132
- endif ()
132
+ endif ()
133
+
134
+ if (BUILD_WITH_PEDANTIC_WARNINGS )
135
+ if (MSVC )
136
+ target_compile_options (matplot PRIVATE /W4 /WX )
137
+ else ()
138
+ target_compile_options (matplot PRIVATE -Wall -Wextra -pedantic -Werror )
139
+ endif ()
140
+ endif ()
133
141
134
142
if (BUILD_EXPERIMENTAL_OPENGL_BACKEND )
135
143
# Library for the OpenGL example
@@ -188,17 +196,24 @@ endif()
188
196
189
197
190
198
# Install
191
- if (MASTER_PROJECT )
199
+ if (BUILD_INSTALLER )
200
+ # Install targets
192
201
install (TARGETS matplot
193
- EXPORT Matplot++Targets
194
- LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
195
- ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} )
202
+ EXPORT Matplot++Targets
203
+ LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
204
+ ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
205
+ )
206
+
207
+ # Install headers
196
208
install (DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
197
- DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}
198
- FILES_MATCHING PATTERN "*.h" )
209
+ DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}
210
+ FILES_MATCHING PATTERN "*.h"
211
+ )
199
212
213
+ # Install cmake script
200
214
install (EXPORT Matplot++Targets
201
- FILE Matplot++Targets.cmake
202
- NAMESPACE Matplot++::
203
- DESTINATION ${CMAKE_INSTALL_LIBDIR} /cmake/Matplot++ )
215
+ FILE Matplot++Targets.cmake
216
+ NAMESPACE Matplot++::
217
+ DESTINATION ${CMAKE_INSTALL_LIBDIR} /cmake/Matplot++
218
+ )
204
219
endif ()
0 commit comments