[master] 313212b - Adding Albrecht's CMakeLists.txt patch

FLTK matrix user chat room
(using Element browser app)   FLTK gitter user chat room   GitHub FLTK Project   FLTK News RSS Feed  
  FLTK Apps      FLTK Library      Forums      Links     Login 
 All Forums  |  Back to fltk.commit  ]
 
Previous Message ]Next Message ]

[master] 313212b - Adding Albrecht's CMakeLists.txt patch "Greg Ercolano" 15:47 Jan 16 top right image
 
commit 313212b4975b40c5a9af0c3ffe7afefcc17b8bd2
Author:     Greg Ercolano <erco@seriss.com>
AuthorDate: Sun Jan 16 15:42:23 2022 -0800
Commit:     Greg Ercolano <erco@seriss.com>
CommitDate: Sun Jan 16 15:42:23 2022 -0800

    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.

 examples/CMakeLists.txt | 26 ++++++++++++++++++++++++++
 1 file changed, 26 insertions(+)

diff --git examples/CMakeLists.txt examples/CMakeLists.txt
index 351aa54..ee0554d 100644
--- examples/CMakeLists.txt
+++ 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
 ############################################################
 
Direct Link to Message ]
 
bottom left image   bottom right image
Previous Message ]Next Message ]
 
 

Comments are owned by the poster. All other content is copyright 1998-2022 by Bill Spitzak and others. This project is hosted by The FLTK Team. Please report site problems to 'erco@seriss.com'.