Skip to content

Commit

Permalink
bugfix for incorrect behaviour in caffe_parse_linker_libs function wh…
Browse files Browse the repository at this point in the history
…ile extracting libflags from absolute library path with multiple (dots)
  • Loading branch information
Abhijit Kundu committed Feb 9, 2016
1 parent b590f1d commit 68c751c
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions cmake/Utils.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -346,10 +346,11 @@ function(caffe_parse_linker_libs Caffe_LINKER_LIBS_variable folders_var flags_va
elseif(lib MATCHES "^-l.*")
list(APPEND libflags ${lib})
elseif(IS_ABSOLUTE ${lib})
get_filename_component(name_we ${lib} NAME_WE)
get_filename_component(folder ${lib} PATH)
get_filename_component(filename ${lib} NAME)
string(REGEX REPLACE "\\.[^.]*$" "" filename_without_shortest_ext ${filename})

string(REGEX MATCH "^lib(.*)" __match ${name_we})
string(REGEX MATCH "^lib(.*)" __match ${filename_without_shortest_ext})
list(APPEND libflags -l${CMAKE_MATCH_1})
list(APPEND folders ${folder})
else()
Expand Down

0 comments on commit 68c751c

Please sign in to comment.