Skip to content

Commit

Permalink
Cmake: Fix including the wx libs for versions more complex than e.g. 3.1
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
dghart authored and dghart committed May 21, 2019
1 parent e106b91 commit f55151d
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions LiteEditor/CMakeLists.txt
Expand Up @@ -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<SomeGitVersion> 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
Expand Down

0 comments on commit f55151d

Please sign in to comment.