From 809ceea075d0636263de2db7e35735555c151d67 Mon Sep 17 00:00:00 2001 From: Albrecht Schlosser Date: Fri, 9 Feb 2024 19:41:45 +0100 Subject: Fix Cairo related build issues (missing Cairo lib) ... particularly for shared libs --- CMake/fl_add_library.cmake | 1 + test/CMakeLists.txt | 6 +++++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/CMake/fl_add_library.cmake b/CMake/fl_add_library.cmake index 150125a0f..fe1671f93 100644 --- a/CMake/fl_add_library.cmake +++ b/CMake/fl_add_library.cmake @@ -161,6 +161,7 @@ function(fl_add_library LIBNAME LIBTYPE SOURCES) if(FLTK_HAVE_CAIRO OR FLTK_USE_CAIRO) target_include_directories(${TARGET_NAME} PUBLIC ${PKG_CAIRO_INCLUDE_DIRS}) target_link_directories(${TARGET_NAME} PUBLIC ${PKG_CAIRO_LIBRARY_DIRS}) + target_link_libraries(${TARGET_NAME} PUBLIC ${PKG_CAIRO_LIBRARIES}) endif() endif(LIBNAME STREQUAL "fltk") diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index 53e9fad7e..a59679faf 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -275,7 +275,11 @@ if(FLTK_BUILD_SHARED_LIBS) fl_create_example(shape-shared shape.cxx "${GLDEMO_SHARED}") endif(OPENGL_FOUND) - fl_create_example(cairo_test-shared cairo_test.cxx "fltk::fltk-shared;cairo") + 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) -- cgit v1.2.3