Skip to content

Commit

Permalink
Align version with zenoh-c (eclipse-zenoh#138)
Browse files Browse the repository at this point in the history
As per eclipse-zenoh/zenoh-c#466, align how we
configure zenoh CMake based projects version.
  • Loading branch information
diogomatsubara committed Jun 25, 2024
1 parent 87f29b2 commit c9ef484
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,16 @@ project(
set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake ${CMAKE_MODULE_PATH})
include(helpers)

set(project_version "${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}.${PROJECT_VERSION_PATCH}")
if(NOT DEFINED PROJECT_VERSION_TWEAK)
set(project_version "${project_version}")
elseif(PROJECT_VERSION_TWEAK EQUAL 0)
set(project_version "${project_version}-dev")
elseif(PROJECT_VERSION_TWEAK GREATER 1)
set(project_version "${project_version}-pre.${PROJECT_VERSION_TWEAK}")
endif()
status_print(project_version)

if(${CMAKE_SOURCE_DIR} STREQUAL ${CMAKE_CURRENT_SOURCE_DIR})
# Temporary measure. Ideally zenoh-cpp should work with any variant
# of zenoh-c build
Expand Down

0 comments on commit c9ef484

Please sign in to comment.