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 7496b5b
Show file tree
Hide file tree
Showing 7 changed files with 19 additions and 15 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
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 7496b5b

Please sign in to comment.