Skip to content

Commit 8d506be

Browse files
committed
Update cmake
1 parent 18be45b commit 8d506be

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

CMakeLists.txt

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -33,14 +33,15 @@ set(XCPP_TAGCONFS_DIR ${CMAKE_CURRENT_SOURCE_DIR}/etc/xeus-cpp/tags.d)
3333
# Versionning
3434
# ===========
3535

36-
# Set the version
37-
set(XEUS_CPP_VERSION_MAJOR 0)
38-
set(XEUS_CPP_VERSION_MINOR 4)
39-
set(XEUS_CPP_VERSION_PATCH 0)
36+
file(STRINGS "VERSION" XEUS_CPP_VERSION)
37+
string(REPLACE "." ";" VERSION_LIST "${XEUS_CPP_VERSION}")
38+
list(GET VERSION_LIST 0 XEUS_CPP_VERSION_MAJOR)
39+
list(GET VERSION_LIST 1 XEUS_CPP_VERSION_MINOR)
40+
list(GET VERSION_LIST 2 XEUS_CPP_VERSION_PATCH)
4041

4142
set(${PROJECT_NAME}_VERSION
4243
${XEUS_CPP_VERSION_MAJOR}.${XEUS_CPP_VERSION_MINOR}.${XEUS_CPP_VERSION_PATCH})
43-
message(STATUS "Building xeus-cpp v${${PROJECT_NAME}_VERSION}")
44+
message(STATUS "Building xeus-cpp v${XEUS_CPP_VERSION}")
4445

4546
# Build options
4647
# =============

0 commit comments

Comments
 (0)