mirror of
https://github.com/warmcat/libwebsockets.git
synced 2025-03-09 00:00:04 +01:00
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.
This commit is contained in:
parent
98f63c6c8d
commit
ee404d7449
1 changed files with 10 additions and 9 deletions
|
@ -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.
|
||||
|
|
Loading…
Add table
Reference in a new issue