Skip to content

Commit 132ca0a

Browse files
committed
Update generate_examples target with new cmake command for examples
1 parent b2bfcdd commit 132ca0a

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

test/generate_examples/main.cpp

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -240,7 +240,7 @@ int main() {
240240

241241
// Enqueue all executable source files in the order defined by CMakeLists.txt
242242
vector<fs::path> cpps = {};
243-
e = regex(R"(add_executable\([^ ]+ ([^\) ]+\.cpp)\))");
243+
e = regex(R"(add_matplot_example\([^ ]+ ([^\) ]+\.cpp)\))");
244244
iter = sregex_iterator(cmake_content.begin(), cmake_content.end(), e);
245245
while (iter != sregex_iterator{}) {
246246
for(unsigned i = 1; i < iter->size(); ++i) {
@@ -403,15 +403,21 @@ int main() {
403403
// because we might be updating the png image from a new
404404
// svg we put there with this intention for some reason
405405
string cmd = "rsvg-convert \"" + figure_destination_svg.string() + "\" > \"" + figure_destination_png.string() + "\"";
406-
system(cmd.c_str());
406+
int r = system(cmd.c_str());
407+
if (r != 0) {
408+
std::cerr << "Could not execute " << cmd << std::endl;
409+
}
407410

408411
// Create a png thumbnail as well
409412
// We create the thumbnail even if it already exists
410413
// because we might be updating the thumbnail from a new
411414
// svg we put there with this intention for some reason
412415
// rsvg-convert -h 100 filename.svg > filename-100.png
413416
cmd = "rsvg-convert -h 100 \"" + figure_destination_svg.string() + "\" > \"" + figure_destination_thumbnail_png.string() + "\"";
414-
system(cmd.c_str());
417+
r = system(cmd.c_str());
418+
if (r != 0) {
419+
std::cerr << "Could not execute " << cmd << std::endl;
420+
}
415421

416422
// Keep only the smallest image (svg or png) for the large gallery
417423
// We need to do that because some svg examples would be huge

0 commit comments

Comments
 (0)