[Cmake] Is it possible to run CMAKE without compiler in the PATH?

Bernhard Zach bzach at hyperwave . com
Fri, 5 Dec 2003 11:56:27 +0100


Hi!

We compile with nmake on Windows and have to change between different
compiler versions.

Till now we solved the problem setting the PATH (and the LIB and
INCLUDE) environment variable at compiletime in our makefiles to a path
where the compiler resides.

I tried something similar in CMake with ADD_CUSTOM_COMMAND and the
PRE_BUILD option, but it seems that the compiler must always be
accessible through the Path-variable.

The error is:
CMake Error: your C++ compiler: cl was not found in your path.   For
CMake to correctly use try compile commands, the compiler must be in
your path.   Please add the compiler to your PATH environment, and
re-run CMake.
 
I also tried to set the CMAKE_C_COMPILER_WORKS and
CMAKE_CXX_COMPILER_WORKS flags in cache.

Any suggestions how I could implement such an environment?

Thanks,
Bernhard