Fix Cairo related build issues (missing Cairo lib)

... particularly for shared libs
This commit is contained in:
Albrecht Schlosser 2024-02-09 19:41:45 +01:00
parent ede53b8a50
commit 809ceea075
2 changed files with 6 additions and 1 deletions

View File

@ -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")

View File

@ -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)