mirror of
				https://github.com/neovim/neovim.git
				synced 2025-10-26 12:27:24 +00:00 
			
		
		
		
	automatically discover libuv in CMake
Idiomatically discover if libuv is installed.
This commit is contained in:
		 Rich Wareham
					Rich Wareham
				
			
				
					committed by
					
						 Thiago de Arruda
						Thiago de Arruda
					
				
			
			
				
	
			
			
			 Thiago de Arruda
						Thiago de Arruda
					
				
			
						parent
						
							8aa1d8c71a
						
					
				
				
					commit
					00ca93fb50
				
			| @@ -27,6 +27,9 @@ if(NOT CMAKE_USE_PTHREADS_INIT) | ||||
|   message(SEND_ERROR "The pthread library must be installed on your system.") | ||||
| endif(NOT CMAKE_USE_PTHREADS_INIT) | ||||
|  | ||||
| # Require libuv | ||||
| find_package(LibUV REQUIRED) | ||||
|  | ||||
| # add dependencies to include/lib directories | ||||
| link_directories ("${PROJECT_SOURCE_DIR}/.deps/usr/lib") | ||||
| include_directories ("${PROJECT_SOURCE_DIR}/.deps/usr/include")  | ||||
|   | ||||
							
								
								
									
										24
									
								
								cmake/FindLibUV.cmake
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										24
									
								
								cmake/FindLibUV.cmake
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,24 @@ | ||||
| # - Try to find libuv | ||||
| # Once done, this will define | ||||
| # | ||||
| #  LibUV_FOUND - system has libuv | ||||
| #  LibUV_INCLUDE_DIRS - the libuv include directories | ||||
| #  LibUV_LIBRARIES - link these to use libuv | ||||
|  | ||||
| include(LibFindMacros) | ||||
|  | ||||
| # Include dir | ||||
| find_path(LibUV_INCLUDE_DIR | ||||
|     NAMES uv.h | ||||
| ) | ||||
|  | ||||
| # The library itself | ||||
| find_library(LibUV_LIBRARY | ||||
|     NAMES uv | ||||
| ) | ||||
|  | ||||
| # Set the include dir variables and the libraries and let libfind_process do the rest. | ||||
| # NOTE: Singular variables for this library, plural for libraries this this lib depends on. | ||||
| set(LibUV_PROCESS_INCLUDES LibUV_INCLUDE_DIR) | ||||
| set(LibUV_PROCESS_LIBS LibUV_LIBRARY) | ||||
| libfind_process(LibUV) | ||||
		Reference in New Issue
	
	Block a user