Skip to content

Commit

Permalink
Get CMake minimally functional.
Browse files Browse the repository at this point in the history
  • Loading branch information
michael-grunder committed Jun 23, 2024
1 parent d0ac532 commit a638c73
Show file tree
Hide file tree
Showing 8 changed files with 20 additions and 18 deletions.
34 changes: 19 additions & 15 deletions src/CMakeLists.txt → CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ CMAKE_MINIMUM_REQUIRED(VERSION 3.0.0)

MACRO(getVersionBit name)
SET(VERSION_REGEX "^#define ${name} (.+)$")
FILE(STRINGS "${CMAKE_CURRENT_SOURCE_DIR}/valkey.h"
FILE(STRINGS "${CMAKE_CURRENT_SOURCE_DIR}/include/valkey/valkey.h"
VERSION_BIT REGEX ${VERSION_REGEX})
STRING(REGEX REPLACE ${VERSION_REGEX} "\\1" ${name} "${VERSION_BIT}")
ENDMACRO(getVersionBit)
Expand Down Expand Up @@ -32,19 +32,19 @@ SET(CMAKE_C_STANDARD 99)
SET(CMAKE_DEBUG_POSTFIX d)

SET(valkey_sources
adlist.c
alloc.c
async.c
command.c
crc16.c
net.c
read.c
sds.c
sockcompat.c
valkey.c
valkeycluster.c
vkarray.c
vkutil.c)
src/adlist.c
src/alloc.c
src/async.c
src/command.c
src/crc16.c
src/net.c
src/read.c
src/sds.c
src/sockcompat.c
src/valkey.c
src/valkeycluster.c
src/vkarray.c
src/vkutil.c)

SET(valkey_sources ${valkey_sources})

Expand Down Expand Up @@ -72,7 +72,11 @@ ELSEIF(CMAKE_SYSTEM_NAME MATCHES "SunOS")
TARGET_LINK_LIBRARIES(valkey PUBLIC socket)
ENDIF()

TARGET_INCLUDE_DIRECTORIES(valkey PUBLIC $<INSTALL_INTERFACE:include> $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>)
TARGET_INCLUDE_DIRECTORIES(valkey
PUBLIC
$<INSTALL_INTERFACE:include/valkey>
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include/valkey>
)

CONFIGURE_FILE(valkey.pc.in valkey.pc @ONLY)

Expand Down
4 changes: 1 addition & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,6 @@ endif

OBJS = $(patsubst $(SRC_DIR)/%.c,$(OBJ_DIR)/%.o,$(SOURCES))

TESTS=libvalkey-test

LIBNAME=libvalkey
PKGCONFNAME=$(LIB_DIR)/valkey.pc

Expand Down Expand Up @@ -203,7 +201,7 @@ static: $(STLIBNAME) $(SSL_STLIB)

pkgconfig: $(PKGCONFNAME) $(SSL_PKGCONF)

-include $(OBJS:.o=.d)
-include $(OBJS:.o=.d)

TEST_LIBS = $(STLIBNAME) $(SSL_STLIB)
TEST_LDFLAGS = $(SSL_LDFLAGS)
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 comments on commit a638c73

Please sign in to comment.