SET(VERSION "2.11")
STRING(REGEX MATCHALL "[0-9]+" VERSION_PARTS "${VERSION}")
LIST(GET VERSION_PARTS 0 VERSION_MAJOR)
LIST(GET VERSION_PARTS 1 VERSION_MINOR)
LIST(GET VERSION_PARTS 2 VERSION_PATCH) <========== there is no 3rd field
So as suggested above changing to "2.11.0" fixes the problem.
Cmake error :
CMake Error at cmake/versions.cmake:6 (LIST):
LIST index: 2 out of range (-2, 1)
Call Stack (most recent call first):
CMakeLists.txt:13 (include)
Can a new release be made, since we are building this in an automated way, and would want to avoid that I need to adjust the build script to 'sed' a solution ;-)
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi,
Apologies in advance if there is a naive configuration leading to this issue.
I am trying to compile cppcheck 2.11 from source using CMake v3.24.3 and I run into the following issue:
Has anyone run into this issue?
Yes
https://sourceforge.net/p/cppcheck/discussion/development/thread/e57efb2b62/
It works if you add .0 to the version string in cmake/versions.cmake.
also with cmake 3.26.4.
The problem is cmake/versions.cmake
SET(VERSION "2.11")
STRING(REGEX MATCHALL "[0-9]+" VERSION_PARTS "${VERSION}")
LIST(GET VERSION_PARTS 0 VERSION_MAJOR)
LIST(GET VERSION_PARTS 1 VERSION_MINOR)
LIST(GET VERSION_PARTS 2 VERSION_PATCH) <========== there is no 3rd field
So as suggested above changing to "2.11.0" fixes the problem.
Cmake error :
CMake Error at cmake/versions.cmake:6 (LIST):
LIST index: 2 out of range (-2, 1)
Call Stack (most recent call first):
CMakeLists.txt:13 (include)
Can a new release be made, since we are building this in an automated way, and would want to avoid that I need to adjust the build script to 'sed' a solution ;-)
I have tagged 2.11.1 that should fix this