neovim

Neovim text editor
git clone https://git.dasho.dev/neovim.git
Log | Files | Refs | README

Find.cmake (1185B)


      1 # Functions to aid the built-in find_ functions
      2 
      3 # Same as find_path, but always search in .deps directory first and then everything else.
      4 function(find_path2)
      5  find_path_nvim(${ARGV})
      6  find_path(${ARGV})
      7 endfunction()
      8 
      9 function(find_path_nvim)
     10  set(CMAKE_FIND_FRAMEWORK NEVER)
     11  set(CMAKE_FIND_APPBUNDLE NEVER)
     12  find_path(${ARGV} NO_CMAKE_SYSTEM_PATH NO_CMAKE_ENVIRONMENT_PATH NO_SYSTEM_ENVIRONMENT_PATH)
     13 endfunction()
     14 
     15 # Same as find_library, but with the following search order:
     16 # 1. Only search in .deps directory. Only search for static libraries.
     17 # 2. Only search in .deps directory. Search all libraries
     18 # 3. Search everywhere, all libraries
     19 function(find_library2)
     20  find_library_nvim(STATIC ${ARGV})
     21  find_library_nvim(${ARGV})
     22  find_library(${ARGV})
     23 endfunction()
     24 
     25 function(find_library_nvim)
     26  cmake_parse_arguments(ARG
     27    "STATIC"
     28    ""
     29    ""
     30    ${ARGN})
     31  list(REMOVE_ITEM ARGN STATIC)
     32 
     33  if(ARG_STATIC)
     34    set(CMAKE_FIND_LIBRARY_SUFFIXES ${CMAKE_STATIC_LIBRARY_SUFFIX})
     35  endif()
     36  set(CMAKE_FIND_FRAMEWORK NEVER)
     37  set(CMAKE_FIND_APPBUNDLE NEVER)
     38  find_library(${ARGN} NO_CMAKE_SYSTEM_PATH NO_CMAKE_ENVIRONMENT_PATH NO_SYSTEM_ENVIRONMENT_PATH)
     39 endfunction()