File: Find.cmake

package info (click to toggle)
neovim 0.10.4-8
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 63,144 kB
  • sloc: ansic: 255,334; python: 1,470; lisp: 1,213; sh: 1,103; makefile: 363; xml: 78; ruby: 6
file content (39 lines) | stat: -rw-r--r-- 1,185 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
# Functions to aid the built-in find_ functions

# Same as find_path, but always search in .deps directory first and then everything else.
function(find_path2)
  find_path_nvim(${ARGV})
  find_path(${ARGV})
endfunction()

function(find_path_nvim)
  set(CMAKE_FIND_FRAMEWORK NEVER)
  set(CMAKE_FIND_APPBUNDLE NEVER)
  find_path(${ARGV} NO_CMAKE_SYSTEM_PATH NO_CMAKE_ENVIRONMENT_PATH NO_SYSTEM_ENVIRONMENT_PATH)
endfunction()

# Same as find_library, but with the following search order:
# 1. Only search in .deps directory. Only search for static libraries.
# 2. Only search in .deps directory. Search all libraries
# 3. Search everywhere, all libraries
function(find_library2)
  find_library_nvim(STATIC ${ARGV})
  find_library_nvim(${ARGV})
  find_library(${ARGV})
endfunction()

function(find_library_nvim)
  cmake_parse_arguments(ARG
    "STATIC"
    ""
    ""
    ${ARGN})
  list(REMOVE_ITEM ARGN STATIC)

  if(ARG_STATIC)
    set(CMAKE_FIND_LIBRARY_SUFFIXES ${CMAKE_STATIC_LIBRARY_SUFFIX})
  endif()
  set(CMAKE_FIND_FRAMEWORK NEVER)
  set(CMAKE_FIND_APPBUNDLE NEVER)
  find_library(${ARGN} NO_CMAKE_SYSTEM_PATH NO_CMAKE_ENVIRONMENT_PATH NO_SYSTEM_ENVIRONMENT_PATH)
endfunction()