Error during cmake with gcc version parsing
When using cmake (3.9.1 on Lubuntu 17.10 32bit), an error occurs:
CMake Error at CMakeLists.txt:80 (list): list index: 1 out of range (-1, 0)
It happens when gcc -dumpversion return something like "7" (in my case), not "major.minor".
I temporarily fixed that by doing the following:
IF(GCC_VERSION_COMPONENTS_LENGTH GREATER 1) list(GET GCC_VERSION_COMPONENTS 1 GCC_MINOR) ELSE() SET(GCC_MINOR 0) ENDIF()
Updated by Robin Mills about 2 years ago
- Category set to build
- Status changed from New to Closed
- Assignee set to Robin Mills
- Target version set to 0.27
- % Done changed from 0 to 100
- Estimated time set to 1.00 h
This is a known issue and fixed on master http://github.com/exiv2/exiv2.git
Our CMake code has been totally rewritten for v0.27. I don't recalled exactly how this issue was addressed on 'master', however your workaround looks fine. If it's working OK for you, that's fine with me.