[branch-1.3] b18c1d0 - Fix build with Cairo for CMake < 3.13

GitHub FLTK Project   FLTK News RSS Feed  
  FLTK Apps      FLTK Library      Forums      Links     Login 
 All Forums  |  Back to fltk.commit  ]
 
Previous Message ]Next Message ]

[branch-1.3] b18c1d0 - Fix build with Cairo for CMake < 3.13 "Albrecht Schlosser" 04:32 Apr 30 top right image
 
commit b18c1d00ada5a3ae9428e095fad1486ecbac0a64
Author:     Albrecht Schlosser <albrechts.fltk@online.de>
AuthorDate: Fri Apr 30 12:46:58 2021 +0200
Commit:     Albrecht Schlosser <albrechts.fltk@online.de>
CommitDate: Fri Apr 30 13:28:14 2021 +0200

    Fix build with Cairo for CMake < 3.13
    
    target_link_directories() was introduced in CMake 3.13

 CMake/fl_create_example.cmake | 6 +++++-
 fluid/CMakeLists.txt          | 6 +++++-
 2 files changed, 10 insertions(+), 2 deletions(-)

diff --git CMake/fl_create_example.cmake CMake/fl_create_example.cmake
index ad95a9e..72819eb 100644
--- CMake/fl_create_example.cmake
+++ 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 fluid/CMakeLists.txt fluid/CMakeLists.txt
index 0c74148..1ca8dd8 100644
--- fluid/CMakeLists.txt
+++ fluid/CMakeLists.txt
@@ -68,7 +68,11 @@ endif (APPLE AND (NOT OPTION_APPLE_X11))
 
 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
Direct Link to Message ]
 
bottom left image   bottom right image
Previous Message ]Next Message ]
 
 

Comments are owned by the poster. All other content is copyright 1998-2021 by Bill Spitzak and others. This project is hosted by The FLTK Team. Please report site problems to 'erco@seriss.com'.