Skip to content

Commit edd2026

Browse files
committed
[CMake] Remove extra -D from XRootD's compile definitions.
Up to version 5.8.4, XRootD exports an extra -D in its compile definitions, which poses a problem when generating the rootcling commands. Until the minimum supported version of XRootD is 5.8.4 or higher, this can be fixed by reading the relevant property and overwriting it with a string without the "-D"s.
1 parent cc487eb commit edd2026

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

cmake/modules/SearchInstalledSoftware.cmake

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -968,6 +968,17 @@ if(xrootd AND NOT builtin_xrootd)
968968
endif()
969969
endif()
970970
endif()
971+
972+
if(XRootD_VERSION VERSION_LESS 5.8.4)
973+
# Remove -D from XRootD's exported compile definitions. https://github.com/xrootd/xrootd/issues/2543
974+
foreach(XRDTarget XRootD::XrdCl XRootD::XrdUtils)
975+
if(TARGET ${XRDTarget})
976+
get_target_property(PROP ${XRDTarget} INTERFACE_COMPILE_DEFINITIONS)
977+
list(TRANSFORM PROP REPLACE "^-D" "")
978+
set_property(TARGET ${XRDTarget} PROPERTY INTERFACE_COMPILE_DEFINITIONS ${PROP})
979+
endif()
980+
endforeach()
981+
endif()
971982
endif()
972983

973984
if(builtin_xrootd)

0 commit comments

Comments
 (0)