CMake: Skip compiler test

Viewed 2039

With over 200 projects, I want to skip the cmake compiler test that is done on every clean build. It sometimes takes more time than to build a project itself, and is absolutely not required for me after the very initial check upon installation (I'm willing to take the consequences).

defining the project with "NONE" language causes a "CMake can not determine linker language" error.

How can I do it?

2 Answers

CMake does not have this feature built in. But one thing you could try would be to generate your project once and save those files in a special directory outside the project. Then, instead of running CMake again when you want to do a clean build, just replace your build directory with a copy of the special directory. This will give you a "clean" build without regenerating the project, finding libraries and compilers, etc.

I have the same issue. We have only one project, but the way ROS/catkin works (Robot Operating System) each node is a CMake project. Currently we have over 60 nodes. Since catkin does a lot of stuff at configuration time we need to often run a clean.

Is there any way to get CMake to skip all these useless tests on a clean build?

Currently our Jenkins is running the unit tests additionally with sanitizers enabled. Each one needs a clean recompile. That 's 60 nodes with GCC, then Clang and ASan, UBSan, MSan. That's 4 x 60 x CMake slowness.

This seems like a basic issue which should somehow work in CMake. Did you make any headway here?

Related