summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlbrecht Schlosser <albrechts.fltk@online.de>2025-04-02 19:59:56 +0200
committerAlbrecht Schlosser <albrechts.fltk@online.de>2025-04-02 19:59:56 +0200
commit794d493eb685674a964cee1b68d81ee455987252 (patch)
treed3addc9079f2e778af9a2dd72df9361667a673d1
parent8b28e38942ce8b61966da90af644c9948a007eda (diff)
CMake: check version for some properties in fl_debug_target()
Debug only, if fl_debug_target() is used: Prior to CMake 3.19 some properties of "INTERFACE_LIBRARY targets" can't be read with get_property(). These properties are now excluded if the CMake version is lower than 3.19.
-rw-r--r--CMake/fl_debug_var.cmake18
1 files changed, 11 insertions, 7 deletions
diff --git a/CMake/fl_debug_var.cmake b/CMake/fl_debug_var.cmake
index 815e97dc1..d583d7d0c 100644
--- a/CMake/fl_debug_var.cmake
+++ b/CMake/fl_debug_var.cmake
@@ -117,16 +117,20 @@ function(fl_debug_target name)
### INTERFACE_LOCATION)
### endif()
- list(APPEND _props
+ if(NOT _type STREQUAL "INTERFACE_LIBRARY" OR CMAKE_VERSION VERSION_GREATER_EQUAL "3.19")
+ # Before 3.19: "INTERFACE_LIBRARY targets may only have whitelisted properties"
+ list(APPEND _props
INCLUDE_DIRECTORIES
LINK_DIRECTORIES
LINK_LIBRARIES
- COMPILE_DEFINITIONS
- INTERFACE_COMPILE_DEFINITIONS
- INTERFACE_COMPILE_FEATURES
- INTERFACE_INCLUDE_DIRECTORIES
- INTERFACE_LINK_DIRECTORIES
- INTERFACE_LINK_LIBRARIES)
+ COMPILE_DEFINITIONS)
+ endif()
+
+ list(APPEND _props
+ INTERFACE_COMPILE_DEFINITIONS
+ INTERFACE_INCLUDE_DIRECTORIES
+ INTERFACE_LINK_DIRECTORIES
+ INTERFACE_LINK_LIBRARIES)
foreach(prop ${_props})
get_target_property(${prop} ${name} ${prop})