From a6d1d527e71cb6bef7dc52f5484e08db4795ec83 Mon Sep 17 00:00:00 2001 From: Florent Pruvost <florent.pruvost@inria.fr> Date: Tue, 20 Aug 2024 14:26:17 +0200 Subject: [PATCH] morse_check_static_or_dynamic: we may not find the libraries extension, if given by the user as a list of linker flags (can be many different things), e.g. -Wl,-rpath,/opt/lib -L/opt/lib -lfoo -lbar, so that we replace FATAL_ERROR by WARNING in the message if extension not found --- modules/find/FindMorseCommon.cmake | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/modules/find/FindMorseCommon.cmake b/modules/find/FindMorseCommon.cmake index 004d341..930c145 100644 --- a/modules/find/FindMorseCommon.cmake +++ b/modules/find/FindMorseCommon.cmake @@ -70,8 +70,9 @@ macro(morse_finds_remove_duplicates) endif() endmacro() -# add imported target for non-cmake projects or projects which do not provide -# "PROJECT"Config.cmake file at installation +# try to guess libraries extension, if dyanmic or static +# if dynamic we set ${package}_STATIC to 0, else to 1 +# if we do not find the extension ${package}_STATIC is not set at all macro(morse_check_static_or_dynamic package libraries) list(GET ${libraries} 0 _first_lib) get_filename_component(_suffix ${_first_lib} EXT) @@ -124,7 +125,7 @@ macro(morse_check_static_or_dynamic package libraries) endif() endif() else() - message(FATAL_ERROR "${package} could not detect library extension") + message( WARNING "${package} could not detect library extension") endif() endmacro() -- GitLab