From f55151d5ad0132139b17448a1203fa0eab0a7168 Mon Sep 17 00:00:00 2001 From: dghart Date: Tue, 21 May 2019 15:52:21 +0100 Subject: [PATCH] Cmake: Fix including the wx libs for versions more complex than e.g. 3.1 In its wisdom, fedora doesn't emit '-L/usr/lib64' from wx-config --libs. Previously this was worked-around by using find_file(...libwx_baseu-3.1.so..." but this fails for e.g. libwxbase3u or with git versions in the name (and find_file doesn't do globs/regex). So use the standard 'find' instead. --- LiteEditor/CMakeLists.txt | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/LiteEditor/CMakeLists.txt b/LiteEditor/CMakeLists.txt index c89f835ae7..deb090bfde 100644 --- a/LiteEditor/CMakeLists.txt +++ b/LiteEditor/CMakeLists.txt @@ -179,9 +179,10 @@ if(NOT APPLE) if (${WX_LIBSOUTPUT} MATCHES "^-L.+") # In recent, multi-architecture, distro versions it'll start with -L/foo/bar string(REGEX REPLACE "^-L([^ ;]+).*" "\\1" WX_LIBS_DIR ${WX_LIBSOUTPUT}) else() - # In recent fedoras, which do things with wx-config that might politely be described as 'strange, wx-config doesn't emit -L/usr/lib64 - find_file( USRLIBSIXTYFOUR "libwx_baseu-3.1.so" "/usr/lib64" ) - if ( NOT USRLIBSIXTYFOUR MATCHES ".*NOTFOUND" ) + # In recent fedoras, which do things with wx-config that might politely be described as 'strange', wx-config doesn't emit -L/usr/lib64 + #find_file( USRLIBSIXTYFOUR "libwx_baseu-3.1.so" "/usr/lib64" ) No, this can't cope with e.g. libwx_base2u, or 3.1.3 and find_file doesn't do globs/regex + execute_process(COMMAND "find /usr/lib64/ -iname libwx_base*3.1*" OUTPUT_VARIABLE wxBASELIBDIR) + if ( NOT wxBASELIBDIR MATCHES ".*NOTFOUND" ) set(WX_LIBS_DIR "/usr/lib64") else() set(WX_LIBS_DIR "/usr/lib") # ${WX_LIBS_DIR} will be empty for older, non multi-architecture, distro versions that still use /usr/lib