summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGreg Ercolano <erco@seriss.com>2022-01-16 15:42:23 -0800
committerGreg Ercolano <erco@seriss.com>2022-01-16 15:42:23 -0800
commit313212b4975b40c5a9af0c3ffe7afefcc17b8bd2 (patch)
tree32ae8d1492cc23d1bf061a8e5c1fe72515b7438a
parent6546814a23ac8653916ca9a5e97f2110889ade3d (diff)
Adding Albrecht's CMakeLists.txt patch
Albrecht submitted this in issue 358. Tested the variations: cmake .. -- examples and cairo off cmake -D FLTK_BUILD_EXAMPLES=on -- examples on, cairo off cmake -D FLTK_BUILD_EXAMPLES=on -D OPTION_CAIRO=on .. -- examples on, cairo on When examples are 'on', they build into the bin/examples directory.
-rw-r--r--examples/CMakeLists.txt26
1 files changed, 26 insertions, 0 deletions
diff --git a/examples/CMakeLists.txt b/examples/CMakeLists.txt
index 351aa5424..ee0554d4b 100644
--- a/examples/CMakeLists.txt
+++ b/examples/CMakeLists.txt
@@ -83,6 +83,14 @@ set (IMAGE_SOURCES
)
############################################################
+# examples requiring cairo
+############################################################
+
+set (CAIRO_SOURCES
+ cairo-draw-x
+)
+
+############################################################
# examples requiring OpenGL + libGLEW
############################################################
@@ -116,6 +124,24 @@ foreach (src ${IMAGE_SOURCES})
endforeach (src)
############################################################
+# create example programs requiring cairo
+############################################################
+
+if (FLTK_HAVE_CAIRO)
+ set (cairo_libs "fltk;cairo")
+ if (TARGET fltk_cairo)
+ set (cairo_libs fltk_cairo ${cairo_libs})
+ endif ()
+else ()
+ set(cairo_libs "fltk")
+endif ()
+
+foreach (src ${CAIRO_SOURCES})
+ message(STATUS "CAIRO: ${src} (${cairo_libs})")
+ CREATE_EXAMPLE (${src} ${src}.cxx "${cairo_libs}")
+endforeach (src)
+
+############################################################
# create example programs with OpenGL + libGLEW
############################################################