diff --git a/CMake/fl_create_example.cmake b/CMake/fl_create_example.cmake index 3ea51be74..a245bb5ea 100644 --- a/CMake/fl_create_example.cmake +++ b/CMake/fl_create_example.cmake @@ -116,7 +116,11 @@ macro (CREATE_EXAMPLE NAME SOURCES LIBRARIES) target_link_libraries (${TARGET_NAME} ${LIBRARIES}) if (FLTK_HAVE_CAIRO) - target_link_directories (${TARGET_NAME} PUBLIC ${PKG_CAIRO_LIBRARY_DIRS}) + if (CMAKE_VERSION VERSION_LESS "3.13") + link_directories (${TARGET_NAME} PUBLIC ${PKG_CAIRO_LIBRARY_DIRS}) + else() + target_link_directories (${TARGET_NAME} PUBLIC ${PKG_CAIRO_LIBRARY_DIRS}) + endif() endif (FLTK_HAVE_CAIRO) if (ICON_PATH) diff --git a/fluid/CMakeLists.txt b/fluid/CMakeLists.txt index fcf4cedb1..1b98c17e2 100644 --- a/fluid/CMakeLists.txt +++ b/fluid/CMakeLists.txt @@ -71,7 +71,11 @@ endif (APPLE AND (NOT OPTION_APPLE_X11) AND (NOT OPTION_APPLE_SDL)) target_link_libraries (fluid fltk fltk_images fltk_forms) if (FLTK_HAVE_CAIRO) - target_link_directories (fluid PUBLIC ${PKG_CAIRO_LIBRARY_DIRS}) + if (CMAKE_VERSION VERSION_LESS "3.13") + link_directories (fluid PUBLIC ${PKG_CAIRO_LIBRARY_DIRS}) + else() + target_link_directories (fluid PUBLIC ${PKG_CAIRO_LIBRARY_DIRS}) + endif() endif (FLTK_HAVE_CAIRO) # install fluid