Fix build with Cairo for CMake < 3.13

target_link_directories() was introduced in CMake 3.13
This commit is contained in:
Albrecht Schlosser 2021-04-30 12:46:58 +02:00
parent 4ba92a99bb
commit 2555e3b37e
2 changed files with 10 additions and 2 deletions

View File

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

View File

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