summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--CMake/fl_add_library.cmake1
-rw-r--r--test/CMakeLists.txt6
2 files changed, 6 insertions, 1 deletions
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)