tags:

views:

709

answers:

1

I am using some features that are provided in GCC v4+ and would like CMake to find GCC v4 compiler and if it does not find it, return an error stating GCC v4 is required.

Anyone have any modules / ideas on how to do something like this?

Thanks.

+2  A: 

Use the try_compile() command and try to compile the following program

#if __GNUC__ != 4
#error
#endif
int main() { return 0; }
JesperE