[CMake] is it possbile to export environment varibles from cmake scripts?

Andreas Pakulat apaku at gmx.de
Mon Jul 7 08:29:44 EDT 2008


On 07.07.08 16:07:54, Alexander Bubnov wrote:
> It is clear. I just would like to know a similiar command of cmake.
> ...it is a pity there is no one.

You're misunderstanding. Its not possible for any given process (or
program) to modify the environment of its parent process. So if you run
an application "foo" from a shell, any modifications to environment
variables done inside that application are not visible once the
application has exited. This is not a limitation of CMake, its a
limitation of the operating system (and I don't think there's one
without this limitation). 

Even with just a shell and shell scripts you cannot change the
environment of the parent shell. All you can do is execute a shell
script in the current shell instead of inside a sub-shell (the default
if you just execute the script).

Andreas

-- 
You are a fluke of the universe; you have no right to be here.


More information about the CMake mailing list