FLTK logo

[master] 2555e3b - Fix build with Cairo for CMake < 3.13

FLTK matrix user chat room
(using Element browser app)   FLTK gitter user chat room   GitHub FLTK Project   FLTK News RSS Feed  
  FLTK Apps      FLTK Library      Forums      Links     Login 
 All Forums  |  Back to fltk.commit  ]
 
Previous Message ]Next Message ]

[master] 2555e3b - Fix build with Cairo for CMake < 3.13 "Albrecht Schlosser" Apr 30, 2021  
 
commit 2555e3b37e6218378e7becbb2b62ab6e7f1c1cd1
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 12:46:58 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 3ea51be..a245bb5 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 fcf4ced..1b98c17 100644
--- fluid/CMakeLists.txt
+++ 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
Direct Link to Message ]
 
     
Previous Message ]Next Message ]
 
 

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