Skip to content

Commit 82e4fd1

Browse files
committed
add version number to cmake
1 parent 1ceac6d commit 82e4fd1

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

mooncake-store/CMakeLists.txt

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,13 @@
1-
project(MooncakeStore)
1+
cmake_minimum_required(VERSION 3.16)
2+
project(MooncakeStore VERSION 1.0.0)
3+
4+
# Extract version components for C++ usage
5+
set(MOONCAKE_VERSION_MAJOR ${PROJECT_VERSION_MAJOR})
6+
set(MOONCAKE_VERSION_MINOR ${PROJECT_VERSION_MINOR})
7+
set(MOONCAKE_VERSION_PATCH ${PROJECT_VERSION_PATCH})
8+
set(MOONCAKE_VERSION ${PROJECT_VERSION})
9+
10+
configure_file(include/version.h.in ${CMAKE_CURRENT_BINARY_DIR}/include/version.h @ONLY)
211

312
if (STORE_USE_ETCD)
413
set(ETCD_WRAPPER_INCLUDE ${CMAKE_CURRENT_BINARY_DIR}/../mooncake-common/etcd/)
@@ -14,6 +23,7 @@ include_directories(
1423
${CMAKE_CURRENT_SOURCE_DIR}/include/cachelib_memory_allocator/
1524
${CMAKE_CURRENT_SOURCE_DIR}/include/mooncake-store/proto/
1625
${CMAKE_CURRENT_SOURCE_DIR}/include/
26+
${CMAKE_CURRENT_BINARY_DIR}/include/
1727
${CMAKE_CURRENT_SOURCE_DIR}/../mooncake-transfer-engine/include
1828
${ETCD_WRAPPER_INCLUDE}
1929
)
@@ -24,4 +34,4 @@ add_subdirectory(src)
2434
if (BUILD_UNIT_TESTS)
2535
add_subdirectory(tests)
2636
add_subdirectory(benchmarks)
27-
endif()
37+
endif()

0 commit comments

Comments
 (0)