From 11bcb67ddc35c0b9af9616acb7ac83aca37fbda5 Mon Sep 17 00:00:00 2001
From: Florent Pruvost <florent.pruvost@inria.fr>
Date: Thu, 22 Dec 2022 15:18:40 +0100
Subject: [PATCH] Avoid to get -NOTFOUND definitions in targets exported

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

diff --git a/modules/find/FindMorseCommon.cmake b/modules/find/FindMorseCommon.cmake
index 26f0411..663df04 100644
--- a/modules/find/FindMorseCommon.cmake
+++ b/modules/find/FindMorseCommon.cmake
@@ -202,6 +202,21 @@ macro(morse_export_imported_target namespace1 namespace2 targetname cmakesubdir)
     get_target_property(_LIBRARIES ${namespace1}::${namespace2} INTERFACE_LINK_LIBRARIES)
     get_target_property(_CFLAGS    ${namespace1}::${namespace2} INTERFACE_COMPILE_OPTIONS)
     get_target_property(_LDFLAGS   ${namespace1}::${namespace2} INTERFACE_LINK_OPTIONS)
+    if (NOT _INCLUDES)
+      set(_INCLUDES "")
+    endif()
+    if (NOT _LIBDIRS)
+      set(_LIBDIRS "")
+    endif()
+    if (NOT _LIBRARIES)
+      set(_LIBRARIES "")
+    endif()
+    if (NOT _CFLAGS)
+      set(_CFLAGS "")
+    endif()
+    if (NOT _LDFLAGS)
+      set(_LDFLAGS "")
+    endif()
 
     file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/${targetname}Targets.cmake"
 "add_library(${namespace1}::${namespace2} INTERFACE IMPORTED)
-- 
GitLab