Fix parsing of version for nvhpc

As the first line of the version is empty it crashes,
so delete first line if it is empty


(cherry picked from commit 001a57519a7aa909d3bf0cd8c6ec8a9cd19d9c70)
This commit is contained in:
Nicolas Cornu 2021-06-08 15:48:21 +02:00 committed by Rasmus Munk Larsen
parent cbb6ae6296
commit 85868564df

View File

@ -478,6 +478,7 @@ macro(ei_get_compilerver VAR)
execute_process(COMMAND ${CMAKE_CXX_COMPILER} ${EIGEN_CXX_FLAG_VERSION}
OUTPUT_VARIABLE eigen_cxx_compiler_version_string OUTPUT_STRIP_TRAILING_WHITESPACE)
string(REGEX REPLACE "^[ \n\r]+" "" eigen_cxx_compiler_version_string ${eigen_cxx_compiler_version_string})
string(REGEX REPLACE "[\n\r].*" "" eigen_cxx_compiler_version_string ${eigen_cxx_compiler_version_string})
ei_get_compilerver_from_cxx_version_string("${eigen_cxx_compiler_version_string}" CNAME CVER)