Skip to content

Commit

Permalink
fix version parsing (#257)
Browse files Browse the repository at this point in the history
  • Loading branch information
matkonnerth committed Apr 15, 2024
1 parent 9967a45 commit a6ef450
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -117,8 +117,15 @@ if(${ENABLE_BUILD_INTO_OPEN62541})
# v1.2.3-rc1-dirty
# v1.2.3-5-g4538abcd
# v1.2.3-5-g4538abcd-dirty


string(FIND ${OPEN62541_VERSION} "v" MAIN_VERSIONS_OPEN62541_BEGIN)
string(FIND ${OPEN62541_VERSION} "-" MAIN_VERSIONS_OPEN62541_END)

if(${MAIN_VERSIONS_OPEN62541_END} EQUAL -1)
string(LENGTH ${OPEN62541_VERSION} MAIN_VERSIONS_OPEN62541_END)
endif()

math(EXPR
MAIN_VERSIONS_OPEN62541_BEGIN
"${MAIN_VERSIONS_OPEN62541_BEGIN} + 1"
Expand All @@ -137,7 +144,6 @@ if(${ENABLE_BUILD_INTO_OPEN62541})
string(REPLACE "." ";" MAIN_VERSIONS_OPEN62541_LIST ${MAIN_VERSION_OPEN62541})
list(GET MAIN_VERSIONS_OPEN62541_LIST 0 OPEN62541_MAJOR)
list(GET MAIN_VERSIONS_OPEN62541_LIST 1 OPEN62541_MINOR)
list(GET MAIN_VERSIONS_OPEN62541_LIST 2 OPEN62541_SUBMINOR)

if(NOT(${OPEN62541_MAJOR} GREATER_EQUAL "1" AND ${OPEN62541_MINOR} GREATER_EQUAL "3"))
message(FATAL_ERROR "This version of nodesetLoader can be built with open62541 >= v1.3.2")
Expand Down

0 comments on commit a6ef450

Please sign in to comment.