Skip to content

Commit

Permalink
Adding Albrecht's CMakeLists.txt patch
Browse files Browse the repository at this point in the history
    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.
  • Loading branch information
erco77 committed Jan 16, 2022
1 parent 6546814 commit 313212b
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions examples/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,14 @@ set (IMAGE_SOURCES
howto-simple-svg
)

############################################################
# examples requiring cairo
############################################################

set (CAIRO_SOURCES
cairo-draw-x
)

############################################################
# examples requiring OpenGL + libGLEW
############################################################
Expand Down Expand Up @@ -115,6 +123,24 @@ foreach (src ${IMAGE_SOURCES})
CREATE_EXAMPLE (${src} ${src}.cxx "fltk_images;fltk")
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
############################################################
Expand Down

0 comments on commit 313212b

Please sign in to comment.