Alexander Neundorf wrote:

Not so easy.  Those variables have to be around at make time, and not
just cmake time.  I suppose you could push all that to the command line
of the compiler.   You would have to modify the -I and -LIBPATH for all
invocations of the compiler.

Some file like Modules/Platforms/Windows-cl.cmake could on the first run:
-get these env vars
-convert them to cmake vars
-call include_directories(<the converted INCLUDE>)
-call link_directories(<the converted LIBPATH>)
-call link_libraries(<the converted LIB>)

Would this or something in that direction work ?

I think PATH is going to be the tough one. The toolchain will need to find all of its dll's, and there is no way to set the path for make time. I am not sure what LIB and LIBPATH are. LIB contains paths so they might be the same. I think the only way this could work reliably is if we ran a wrapper around the compiler/linker, etc and actually set the environment variables at make time.

Here is what I have to set to use cl from the command line:

export INCLUDE="C:\Program Files\Microsoft Visual Studio 9.0\VC\ATLMFC\INCLUDE;C:\Program Files\Micro soft Visual Studio 9.0\VC\INCLUDE;C:\Program Files\\Microsoft SDKs\Windows\v6.0A\include;"

export LIB="C:\Program Files\Microsoft Visual Studio 9.0\VC\ATLMFC\LIB;C:\Program Files\Microsoft Vis
ual Studio 9.0\VC\LIB;C:\Program Files\\Microsoft SDKs\Windows\v6.0A\lib;"

export LIBPATH="C:\WINDOWS\Microsoft.NET\Framework\v3.5;C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727 ;C:\Program Files\Microsoft Visual Studio 9.0\VC\ATLMFC\LIB;C:\Program Files\Microsoft Visual Studio
9.0\VC\LIB;"

export PATH=/cygdrive/c/Program\ Files/Microsoft\ Visual\ Studio\ 9.0/Common7/IDE:/cygdrive/c/Program \ Files/Microsoft\ Visual\ Studio\ 9.0/VC/BIN:/cygdrive/c/Program\ Files/Microsoft\ Visual\ Studio\ 9
.0/Common7/Tools:/cygdrive/c/WINDOWS/Microsoft.NET/Framework/v3.5:/cygdrive/c/WINDOWS/Microsoft.NET/F
ramework/v2.0.50727:/cygdrive/c/Program\ Files/Microsoft\ Visual\ Studio\ 9.0/VC/VCPackages:/cygdrive /c/Program\ Files//Microsoft\ SDKs/Windows/v6.0A/bin:/cygdrive/c/emacs/emacs-21.3/bin/:${PATH}



-Bill
_______________________________________________
CMake mailing list
CMake@cmake.org
http://www.cmake.org/mailman/listinfo/cmake

Reply via email to