summaryrefslogtreecommitdiff
path: root/test/CMakeLists.txt
diff options
context:
space:
mode:
authorAlbrecht Schlosser <albrechts.fltk@online.de>2024-03-16 23:24:01 +0100
committerAlbrecht Schlosser <albrechts.fltk@online.de>2024-03-16 23:24:01 +0100
commit193c5285cde3fa642c39c601dee973e313faa3c2 (patch)
tree23f98c85c6f7baef7a683ffc6f951c71baed978a /test/CMakeLists.txt
parent29aba21b7885d436dba3db87c33d08378b57d23c (diff)
Improve linking of test/cairo_test.cxx demo program
With modern CMake libcairo doesn't need to linked explicitly in the test/cairo_test.cxx demo program. Either '-lcairo' is implied by linking with fltk::fltk or it is not used at all. This fixes a linker warning on macOS: "ld: warning: ignoring duplicate libraries ..."
Diffstat (limited to 'test/CMakeLists.txt')
-rw-r--r--test/CMakeLists.txt17
1 files changed, 4 insertions, 13 deletions
diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt
index 2dfb39883..5ff5cff78 100644
--- a/test/CMakeLists.txt
+++ b/test/CMakeLists.txt
@@ -89,6 +89,8 @@ fl_create_example(boxtype boxtype.cxx fltk::fltk)
fl_create_example(browser browser.cxx fltk::fltk)
fl_create_example(button button.cxx fltk::fltk)
fl_create_example(buttons buttons.cxx fltk::fltk)
+# Cairo demo, built with and w/o Cairo (libcairo is linked implicitly - or not at all)
+fl_create_example(cairo_test cairo_test.cxx fltk::fltk)
fl_create_example(checkers "checkers.cxx;checkers_pieces.fl;checkers.icns" fltk::images)
fl_create_example(clipboard clipboard.cxx fltk::images)
fl_create_example(clock clock.cxx fltk::fltk)
@@ -214,13 +216,6 @@ if(OPENGL_FOUND)
fl_create_example(shape shape.cxx "${GLDEMO_LIBS}")
endif(OPENGL_FOUND)
-# Cairo demo - must also be built w/o Cairo (displays a message box)
-if(FLTK_HAVE_CAIRO)
- fl_create_example(cairo_test cairo_test.cxx "fltk::fltk;cairo")
-else()
- fl_create_example(cairo_test cairo_test.cxx fltk::fltk)
-endif(FLTK_HAVE_CAIRO)
-
# *** EXPERIMENTAL ***
# Build some of the demo programs linked against the shared FLTK lib(s).
# This is currently pretty complicated and should be improved.
@@ -267,8 +262,9 @@ if(FLTK_BUILD_SHARED_LIBS)
else() # not MSVC
+ fl_create_example(cairo_test-shared cairo_test.cxx fltk::fltk-shared)
fl_create_example(hello-shared hello.cxx fltk::fltk-shared)
- fl_create_example(pixmap_browser-shared pixmap_browser.cxx "fltk::images-shared")
+ fl_create_example(pixmap_browser-shared pixmap_browser.cxx fltk::images-shared)
fl_create_example(unittests-shared "${UNITTEST_SRCS}" "${GLDEMO_SHARED}")
if(OPENGL_FOUND)
@@ -276,11 +272,6 @@ if(FLTK_BUILD_SHARED_LIBS)
fl_create_example(shape-shared shape.cxx "${GLDEMO_SHARED}")
endif(OPENGL_FOUND)
- if(FLTK_HAVE_CAIRO)
- fl_create_example(cairo_test-shared cairo_test.cxx "fltk::fltk-shared;cairo")
- else()
- fl_create_example(cairo_test-shared cairo_test.cxx "fltk::fltk-shared")
- endif()
endif(MSVC) # (not MSVC)