From ee404d7449d19ba777a7b662f9c2bc4f107045f3 Mon Sep 17 00:00:00 2001 From: Andy Green Date: Wed, 12 Aug 2020 06:48:32 +0100 Subject: [PATCH] uv: cmake: use find_ only if no commandline paths Libuv override paths were broken since the CMakeLists.txt refactor, find_library worked OK. This should go back to allowing both. --- lib/event-libs/libuv/CMakeLists.txt | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/lib/event-libs/libuv/CMakeLists.txt b/lib/event-libs/libuv/CMakeLists.txt index 8154aa25e..5193c7257 100644 --- a/lib/event-libs/libuv/CMakeLists.txt +++ b/lib/event-libs/libuv/CMakeLists.txt @@ -33,21 +33,22 @@ include_directories(.) set(LWS_LIBUV_LIBRARIES CACHE PATH "Path to the libuv library") set(LWS_LIBUV_INCLUDE_DIRS CACHE PATH "Path to the libuv include directory") -if (NOT LIBUV_FOUND) - find_path(LIBUV_INCLUDE_DIRS NAMES uv.h) - find_library(LIBUV_LIBRARIES NAMES uv) -endif() -message("libuv include dir: ${LIBUV_INCLUDE_DIRS}") -message("libuv libraries: ${LIBUV_LIBRARIES}") -include_directories("${LIBUV_INCLUDE_DIRS}") -list(APPEND LIB_LIST ${LIBUV_LIBRARIES}) - if ("${LWS_LIBUV_LIBRARIES}" STREQUAL "" OR "${LWS_LIBUV_INCLUDE_DIRS}" STREQUAL "") + if (NOT LIBUV_FOUND) + find_path(LIBUV_INCLUDE_DIRS NAMES uv.h) + find_library(LIBUV_LIBRARIES NAMES uv) + endif() else() set(LIBUV_LIBRARIES ${LWS_LIBUV_LIBRARIES}) set(LIBUV_INCLUDE_DIRS ${LWS_LIBUV_INCLUDE_DIRS}) endif() +message("libuv include dir: ${LIBUV_INCLUDE_DIRS}") +message("libuv libraries: ${LIBUV_LIBRARIES}") + +include_directories("${LIBUV_INCLUDE_DIRS}") +list(APPEND LIB_LIST ${LIBUV_LIBRARIES}) + CHECK_INCLUDE_FILE(uv-version.h LWS_HAVE_UV_VERSION_H) # libuv changed the location in 1.21.0. Retain both # checks temporarily to ensure a smooth transition.