From 410a01c6db6363cb03bacf73800a60bb7a6bdafb Mon Sep 17 00:00:00 2001 From: Albrecht Schlosser Date: Mon, 26 Jul 2021 17:14:29 +0200 Subject: Add CMake compatibility functions and macros CMake/compatibility.cmake: define functions and macros to be used if a particular CMake functionality requires a higher CMake version than FLTK's minimum CMake version, see 'cmake_minimum_required(...)' in the root CMakeLists.txt. Note: target_link_directories() is available since CMake 3.13 --- CMake/fl_create_example.cmake | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) (limited to 'CMake/fl_create_example.cmake') diff --git a/CMake/fl_create_example.cmake b/CMake/fl_create_example.cmake index 38ffe98e1..66c8efc58 100644 --- a/CMake/fl_create_example.cmake +++ b/CMake/fl_create_example.cmake @@ -117,15 +117,12 @@ macro (CREATE_EXAMPLE NAME SOURCES LIBRARIES) target_link_libraries (${TARGET_NAME} ${LIBRARIES}) if (FLTK_HAVE_CAIRO) - if (CMAKE_VERSION VERSION_LESS "3.13") - link_directories (${PKG_CAIRO_LIBRARY_DIRS}) - else() - target_link_directories (${TARGET_NAME} PRIVATE ${PKG_CAIRO_LIBRARY_DIRS}) - endif() - endif (FLTK_HAVE_CAIRO) + fl_target_link_directories (${TARGET_NAME} PRIVATE "${PKG_CAIRO_LIBRARY_DIRS}") + endif () + if (USE_GDIPLUS) # can only be true on Windows target_link_libraries (${TARGET_NAME} gdiplus) - endif (USE_GDIPLUS) + endif () if (MAC_BUNDLE) if (PLIST) -- cgit v1.2.3