1 function(gcc_get_version var)
2 cmake_parse_arguments(args
4 "TRIPLET;PROGRAM_NAME;PROGRAM_PATH"
10 set(prog "${args_TRIPLET}-${prog}")
13 set(${args_PROGRAM_NAME} ${prog} PARENT_SCOPE)
16 find_program(gcc ${prog})
18 set(${var} OFF PARENT_SCOPE)
22 set(${args_PROGRAM_PATH} ${gcc} PARENT_SCOPE)
25 execute_process(COMMAND "${gcc}" -dumpversion
26 OUTPUT_STRIP_TRAILING_WHITESPACE
27 OUTPUT_VARIABLE version)
29 if("" STREQUAL version)
30 set(${var} OFF PARENT_SCOPE)
32 set(${var} ${version} PARENT_SCOPE)