forked from valkey-io/libvalkey
-
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.
Build the examples using an installed libvalkey. Build and install with combinations of Makefile and CMake.
- Loading branch information
Showing
9 changed files
with
61 additions
and
242 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
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 |
---|---|---|
@@ -1,89 +1,92 @@ | ||
cmake_minimum_required(VERSION 3.0.0) | ||
project(examples LANGUAGES C) | ||
|
||
# Add path to enable <valkey/x.h> includes | ||
include_directories(${CMAKE_SOURCE_DIR}/include) | ||
find_package(valkey QUIET) | ||
if(NOT valkey_FOUND) | ||
# Add path to enable <valkey/x.h> includes | ||
include_directories(${CMAKE_SOURCE_DIR}/include) | ||
endif() | ||
|
||
# Check for GLib | ||
include(FindPkgConfig) | ||
pkg_check_modules(GLIB2 glib-2.0) | ||
if(GLIB2_FOUND) | ||
add_executable(example-async-glib async-glib.c) | ||
target_include_directories(example-async-glib PUBLIC ${GLIB2_INCLUDE_DIRS}) | ||
target_link_libraries(example-async-glib valkey ${GLIB2_LIBRARIES}) | ||
target_link_libraries(example-async-glib valkey::valkey ${GLIB2_LIBRARIES}) | ||
endif() | ||
|
||
find_path(LIBEV ev.h | ||
HINTS /usr/local /usr/opt/local | ||
ENV LIBEV_INCLUDE_DIR) | ||
if(LIBEV) | ||
add_executable(example-async-libev async-libev.c) | ||
target_link_libraries(example-async-libev valkey ev) | ||
target_link_libraries(example-async-libev valkey::valkey ev) | ||
endif() | ||
|
||
find_path(LIBEVENT event.h) | ||
if(LIBEVENT) | ||
add_executable(example-async-libevent async-libevent.c) | ||
target_link_libraries(example-async-libevent valkey event) | ||
target_link_libraries(example-async-libevent valkey::valkey event) | ||
|
||
if(ENABLE_SSL) | ||
add_executable(example-async-libevent-ssl async-libevent-ssl.c) | ||
target_link_libraries(example-async-libevent-ssl valkey valkey_ssl event) | ||
target_link_libraries(example-async-libevent-ssl valkey::valkey valkey::valkey_ssl event) | ||
endif() | ||
endif() | ||
|
||
find_path(LIBHV hv/hv.h) | ||
if(LIBHV) | ||
add_executable(example-async-libhv async-libhv.c) | ||
target_link_libraries(example-async-libhv valkey hv) | ||
target_link_libraries(example-async-libhv valkey::valkey hv) | ||
endif() | ||
|
||
find_path(LIBUV uv.h) | ||
if(LIBUV) | ||
add_executable(example-async-libuv async-libuv.c) | ||
target_link_libraries(example-async-libuv valkey uv) | ||
target_link_libraries(example-async-libuv valkey::valkey uv) | ||
endif() | ||
|
||
find_path(LIBSDEVENT systemd/sd-event.h) | ||
if(LIBSDEVENT) | ||
add_executable(example-async-libsdevent async-libsdevent.c) | ||
target_link_libraries(example-async-libsdevent valkey systemd) | ||
target_link_libraries(example-async-libsdevent valkey::valkey systemd) | ||
endif() | ||
|
||
if(APPLE) | ||
find_library(CF CoreFoundation) | ||
add_executable(example-async-macosx async-macosx.c) | ||
target_link_libraries(example-async-macosx valkey ${CF}) | ||
target_link_libraries(example-async-macosx valkey::valkey ${CF}) | ||
endif() | ||
|
||
if(ENABLE_SSL) | ||
add_executable(example-blocking-ssl blocking-ssl.c) | ||
target_link_libraries(example-blocking-ssl valkey valkey_ssl) | ||
target_link_libraries(example-blocking-ssl valkey::valkey valkey::valkey_ssl) | ||
endif() | ||
|
||
add_executable(example-blocking blocking.c) | ||
target_link_libraries(example-blocking valkey) | ||
target_link_libraries(example-blocking valkey::valkey) | ||
|
||
add_executable(example-blocking-push blocking-push.c) | ||
target_link_libraries(example-blocking-push valkey) | ||
target_link_libraries(example-blocking-push valkey::valkey) | ||
|
||
if(LIBEVENT) | ||
add_executable(example-cluster-async cluster-async.c) | ||
target_link_libraries(example-cluster-async valkey event) | ||
target_link_libraries(example-cluster-async valkey::valkey event) | ||
|
||
if(ENABLE_SSL) | ||
add_executable(example-cluster-async-tls cluster-async-tls.c) | ||
target_link_libraries(example-cluster-async-tls valkey valkey_ssl event) | ||
target_link_libraries(example-cluster-async-tls valkey::valkey valkey::valkey_ssl event) | ||
endif() | ||
|
||
add_executable(example-cluster-clientside-caching-async cluster-clientside-caching-async.c) | ||
target_link_libraries(example-cluster-clientside-caching-async valkey event) | ||
target_link_libraries(example-cluster-clientside-caching-async valkey::valkey event) | ||
endif() | ||
|
||
add_executable(example-cluster-simple cluster-simple.c) | ||
target_link_libraries(example-cluster-simple valkey) | ||
target_link_libraries(example-cluster-simple valkey::valkey) | ||
|
||
if(ENABLE_SSL) | ||
add_executable(example-cluster-tls cluster-tls.c) | ||
target_link_libraries(example-cluster-tls valkey valkey_ssl) | ||
target_link_libraries(example-cluster-tls valkey::valkey valkey::valkey_ssl) | ||
endif() |
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
36 changes: 0 additions & 36 deletions
36
libvalkeycluster/examples/using_cmake_and_make_mixed/build.sh
This file was deleted.
Oops, something went wrong.
40 changes: 0 additions & 40 deletions
40
libvalkeycluster/examples/using_cmake_externalproject/CMakeLists.txt
This file was deleted.
Oops, something went wrong.
18 changes: 0 additions & 18 deletions
18
libvalkeycluster/examples/using_cmake_externalproject/build.sh
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.