Skip to content

Commit

Permalink
add libuv dependencies
Browse files Browse the repository at this point in the history
Signed-off-by: xiehuc <[email protected]>
  • Loading branch information
xiehuc committed Jul 13, 2013
1 parent a59a372 commit 459c18b
Show file tree
Hide file tree
Showing 2 changed files with 64 additions and 3 deletions.
14 changes: 11 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,20 @@ if(UNIX)
endif(UNIX)

if(WIN32)
set(CMAKE_PREFIX_PATH "../win32-dev/libcurl-7.18.0-win32-msvc")
set(CMAKE_PREFIX_PATH "${WIN32_LIBS_DIR}/win32-dev/libcurl-7.18.0-win32-msvc")
find_package(CURL REQUIRED)
set(CMAKE_PREFIX_PATH "../win32-dev/sqlite3")
set(CMAKE_PREFIX_PATH "${WIN32_LIBS_DIR}/win32-dev/sqlite3")
find_package(Sqlite3 REQUIRED)
set(CMAKE_PREFIX_PATH "../win32-dev/zlib-1.28/include" "../win32-dev/zlib-1.28/lib")
set(CMAKE_PREFIX_PATH
"${WIN32_LIBS_DIR}/win32-dev/zlib-1.28/include"
"${WIN32_LIBS_DIR}/win32-dev/zlib-1.28/lib"
)
find_package(ZLIB REQUIRED)
set(CMAKE_PREFIX_PATH
"${WIN32_LIBS_DIR}/win32-dev/libuv/include"
"${WIN32_LIBS_DIR}/win32-dev/libuv/Release"
"${WIN32_LIBS_DIR}/win32-dev/libuv/Debug")
find_package(Libuv REQUIRED)
endif(WIN32)

add_definitions(-Wall)
Expand Down
53 changes: 53 additions & 0 deletions cmake/FindLibuv.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
# -*- cmake -*-

# - Find uv library (libuv)
# Find the uv includes and library
# This module defines
# UV_INCLUDE_DIR, where to find db.h, etc.
# UV_LIBRARIES, the libraries needed to use libuv.
# UV_FOUND, If false, do not try to use libuv.
# also defined, but not for general use are
# UV_LIBRARY, where to find the libuv library.

FIND_PATH(UV_INCLUDE_DIR uv.h
/usr/include
/usr/include/libuv
/usr/local/include
/usr/local/include/libuv
)

SET(UV_NAMES ${UV_NAMES} uv)
FIND_LIBRARY(UV_LIBRARY
NAMES ${UV_NAMES}
PATHS /usr/lib /usr/local/lib /usr/lib64 /usr/local/lib64
)

IF (UV_LIBRARY AND UV_INCLUDE_DIR)
SET(UV_LIBRARIES ${UV_LIBRARY})
SET(UV_FOUND "YES")
ELSE (UV_LIBRARY AND UV_INCLUDE_DIR)
SET(UV_FOUND "NO")
ENDIF (UV_LIBRARY AND UV_INCLUDE_DIR)


IF (UV_FOUND)
IF (NOT UV_FIND_QUIETLY)
MESSAGE(STATUS "Found libuv: ${UV_LIBRARIES}")
ENDIF (NOT UV_FIND_QUIETLY)
ELSE (UV_FOUND)
IF (UV_FIND_REQUIRED)
MESSAGE(FATAL_ERROR "Could not find libuv library")
ENDIF (UV_FIND_REQUIRED)
ENDIF (UV_FOUND)

# Deprecated declarations.
SET (NATIVE_UV_INCLUDE_PATH ${UV_INCLUDE_DIR} )
GET_FILENAME_COMPONENT (NATIVE_UV_LIB_PATH ${UV_LIBRARY} PATH)

SET (UV_LIBRARIES ${UV_LIBRARY})
SET (UV_INCLUDE_DIRS ${UV_INCLUDE_DIR})

MARK_AS_ADVANCED(
UV_LIBRARIES
UV_INCLUDE_DIRS
)

0 comments on commit 459c18b

Please sign in to comment.