Medical Imaging Interaction Toolkit  2016.11.0
Medical Imaging Interaction Toolkit
usFunctionGetGccVersion.cmake
Go to the documentation of this file.
1 
2 #! \brief Get the gcc version
3 function(usFunctionGetGccVersion path_to_gcc output_var)
4  if(CMAKE_COMPILER_IS_GNUCXX)
5  execute_process(
6  COMMAND ${path_to_gcc} -dumpversion
7  RESULT_VARIABLE result
8  OUTPUT_VARIABLE output
9  ERROR_VARIABLE error
10  OUTPUT_STRIP_TRAILING_WHITESPACE
11  ERROR_STRIP_TRAILING_WHITESPACE
12  )
13  if(result)
14  message(FATAL_ERROR "Failed to obtain compiler version running [${path_to_gcc} -dumpversion]: ${error}")
15  endif()
16  set(${output_var} ${output} PARENT_SCOPE)
17  endif()
18 endfunction()
usFunctionGetGccVersion(path_to_gcc, output_var)
Get the gcc version.