Subversion Repositories QNX 8.QNX8 LLVM/Clang compiler suite

Rev

Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
14 pmbaty 1
# Returns library name for a given path.
2
function(get_library_name path name)
3
  get_filename_component(path ${path} NAME)
4
  set(prefixes ${CMAKE_FIND_LIBRARY_PREFIXES})
5
  set(suffixes ${CMAKE_FIND_LIBRARY_SUFFIXES})
6
  list(FILTER prefixes EXCLUDE REGEX "^\\s*$")
7
  list(FILTER suffixes EXCLUDE REGEX "^\\s*$")
8
  if(prefixes)
9
    string(REPLACE ";" "|" prefixes "${prefixes}")
10
    string(REGEX REPLACE "^(${prefixes})" "" path ${path})
11
  endif()
12
  if(suffixes)
13
    string(REPLACE ";" "|" suffixes "${suffixes}")
14
    string(REGEX REPLACE "(${suffixes})$" "" path ${path})
15
  endif()
16
  set(${name} "${path}" PARENT_SCOPE)
17
endfunction()