robin/laufey
git clone https://git.robinwobin.dev/robin/laufey
b80a8e2c16
master
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. 4function ( find_path2 ) 5find_path_nvim ( $ { ARGV }) 6find_path ( $ { ARGV }) 7endfunction () 8 9function ( find_path_nvim ) 10set ( CMAKE_FIND_FRAMEWORK NEVER ) 11set ( CMAKE_FIND_APPBUNDLE NEVER ) 12find_path ( $ { ARGV } NO_CMAKE_SYSTEM_PATH NO_CMAKE_ENVIRONMENT_PATH NO_SYSTEM_ENVIRONMENT_PATH ) 13endfunction () 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 19function ( find_library2 ) 20find_library_nvim ( STATIC ${ ARGV }) 21find_library_nvim ( $ { ARGV }) 22find_library ( $ { ARGV }) 23endfunction () 24 25function ( find_library_nvim ) 26cmake_parse_arguments ( ARG 27"STATIC" 28"" 29"" 30${ ARGN }) 31list ( REMOVE_ITEM ARGN STATIC ) 32 33if ( ARG_STATIC) 34set ( CMAKE_FIND_LIBRARY_SUFFIXES ${ CMAKE_STATIC_LIBRARY_SUFFIX }) 35endif () 36set ( CMAKE_FIND_FRAMEWORK NEVER ) 37set ( CMAKE_FIND_APPBUNDLE NEVER ) 38find_library ( $ { ARGN } NO_CMAKE_SYSTEM_PATH NO_CMAKE_ENVIRONMENT_PATH NO_SYSTEM_ENVIRONMENT_PATH ) 39endfunction ()