forked from redis/hiredis
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
44 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
INCLUDE(FindPkgConfig) | ||
# Check for GLib | ||
|
||
PKG_CHECK_MODULES(GLIB2 glib-2.0) | ||
if (GLIB2_FOUND) | ||
INCLUDE_DIRECTORIES(${GLIB2_INCLUDE_DIRS}) | ||
LINK_DIRECTORIES(${GLIB2_LIBRARY_DIRS}) | ||
ADD_EXECUTABLE(example-glib example-glib.c) | ||
TARGET_LINK_LIBRARIES(example-glib hiredis ${GLIB2_LIBRARIES}) | ||
ENDIF(GLIB2_FOUND) | ||
|
||
FIND_PATH(LIBEV ev.h | ||
HINTS /usr/local /usr/opt/local | ||
ENV LIBEV_INCLUDE_DIR) | ||
|
||
if (LIBEV) | ||
# Just compile and link with libev | ||
ADD_EXECUTABLE(example-libev example-libev.c) | ||
TARGET_LINK_LIBRARIES(example-libev hiredis ev) | ||
ENDIF() | ||
|
||
FIND_PATH(LIBEVENT event.h) | ||
if (LIBEVENT) | ||
ADD_EXECUTABLE(example-libevent example-libevent) | ||
TARGET_LINK_LIBRARIES(example-libevent hiredis event) | ||
ENDIF() | ||
|
||
FIND_PATH(LIBUV uv.h) | ||
IF (LIBUV) | ||
ADD_EXECUTABLE(example-libuv example-libuv.c) | ||
TARGET_LINK_LIBRARIES(example-libuv hiredis uv) | ||
ENDIF() | ||
|
||
IF (APPLE) | ||
FIND_LIBRARY(CF CoreFoundation) | ||
ADD_EXECUTABLE(example-macosx example-macosx.c) | ||
TARGET_LINK_LIBRARIES(example-macosx hiredis ${CF}) | ||
ENDIF() | ||
|
||
ADD_EXECUTABLE(example example.c) | ||
TARGET_LINK_LIBRARIES(example hiredis) |