From 34e01580a425eb5fc13f5495a9a602fb26a3a589 Mon Sep 17 00:00:00 2001
From: Florent Pruvost <florent.pruvost@inria.fr>
Date: Mon, 17 Jun 2024 11:07:17 +0200
Subject: [PATCH] morse_export_imported_target: add
 INTERFACE_COMPILE_DEFINITIONS in export target if exists

---
 modules/find/FindMorseCommon.cmake | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/modules/find/FindMorseCommon.cmake b/modules/find/FindMorseCommon.cmake
index 49b6619..004d341 100644
--- a/modules/find/FindMorseCommon.cmake
+++ b/modules/find/FindMorseCommon.cmake
@@ -203,6 +203,7 @@ macro(morse_export_imported_target namespace1 namespace2 targetname cmakesubdir)
     get_target_property(_LIBDIRS   ${namespace1}::${namespace2} INTERFACE_LINK_DIRECTORIES)
     get_target_property(_LIBRARIES ${namespace1}::${namespace2} INTERFACE_LINK_LIBRARIES)
     get_target_property(_CFLAGS    ${namespace1}::${namespace2} INTERFACE_COMPILE_OPTIONS)
+    get_target_property(_DEFS      ${namespace1}::${namespace2} INTERFACE_COMPILE_DEFINITIONS)
     get_target_property(_LDFLAGS   ${namespace1}::${namespace2} INTERFACE_LINK_OPTIONS)
     if (NOT _INCLUDES)
       set(_INCLUDES "")
@@ -216,6 +217,9 @@ macro(morse_export_imported_target namespace1 namespace2 targetname cmakesubdir)
     if (NOT _CFLAGS)
       set(_CFLAGS "")
     endif()
+    if (NOT _DEFS)
+      set(_DEFS "")
+    endif()
     if (NOT _LDFLAGS)
       set(_LDFLAGS "")
     endif()
@@ -227,6 +231,7 @@ set_target_properties(${namespace1}::${namespace2} PROPERTIES INTERFACE_INCLUDE_
 set_target_properties(${namespace1}::${namespace2} PROPERTIES INTERFACE_LINK_DIRECTORIES    \"${_LIBDIRS}\")
 set_target_properties(${namespace1}::${namespace2} PROPERTIES INTERFACE_LINK_LIBRARIES      \"${_LIBRARIES}\")
 set_target_properties(${namespace1}::${namespace2} PROPERTIES INTERFACE_COMPILE_OPTIONS     \"${_CFLAGS}\")
+set_target_properties(${namespace1}::${namespace2} PROPERTIES INTERFACE_COMPILE_DEFINITIONS \"${_DEFS}\")
 set_target_properties(${namespace1}::${namespace2} PROPERTIES INTERFACE_LINK_OPTIONS        \"${_LDFLAGS}\")
 endif()
 ")
-- 
GitLab