FLTK logo

[master] f194d85 - CMake/debug: add more properties to fl_debug_target()

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] f194d85 - CMake/debug: add more properties to fl_debug_target() "Albrecht Schlosser" 08:32 May 01  
 
commit f194d8596f4a9761fa180ae5cc49b0f9d421bfb5
Author:     Albrecht Schlosser <albrechts.fltk@online.de>
AuthorDate: Wed May 1 17:25:26 2024 +0200
Commit:     Albrecht Schlosser <albrechts.fltk@online.de>
CommitDate: Wed May 1 17:25:26 2024 +0200

    CMake/debug: add more properties to fl_debug_target()
    
    This commit is only for CMake debugging.

 CMake/fl_debug_var.cmake | 24 +++++++++++++++++++-----
 1 file changed, 19 insertions(+), 5 deletions(-)

diff --git CMake/fl_debug_var.cmake CMake/fl_debug_var.cmake
index 8f42988..6b52e4d 100644
--- CMake/fl_debug_var.cmake
+++ CMake/fl_debug_var.cmake
@@ -96,13 +96,27 @@ function(fl_debug_target name)
   message(STATUS "+++ fl_debug_target(${name})")
   set(var "${name}")
   fl_expand_name(var "${name}" 40)
+
+  # these properties are always supported:
+  set(_props ALIASED_TARGET TYPE)
+
+  # these properties are not supported before 3.20 for *some* target types
+  if(CMAKE_VERSION VERSION_GREATER_EQUAL 3.20)
+    list(APPEND _props
+          LOCATION
+          IMPORTED_LOCATION
+          INTERFACE_LOCATION)
+  endif()
+
+  # these properties are always supported:
+  list(APPEND _props
+          INTERFACE_INCLUDE_DIRECTORIES
+          INTERFACE_LINK_DIRECTORIES
+          INTERFACE_LINK_LIBRARIES)
+
   if(TARGET ${name})
     message(STATUS "${var} = <target>")
-    foreach(prop
-              ALIASED_TARGET
-              INTERFACE_INCLUDE_DIRECTORIES
-              INTERFACE_LINK_DIRECTORIES
-              INTERFACE_LINK_LIBRARIES)
+    foreach(prop ${_props})
       get_target_property(${prop} ${name} ${prop})
       if(NOT ${prop})
         set(${prop} "")
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'.