[clang][modules] Don't prevent translation of FW_Private includes when explicitly...
[llvm-project.git] / llvm / cmake / modules / GetLibraryName.cmake
blob13c0080671a3c6ee8d4b4681708ece07171966c7
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()