MantisBT - CMake
View Issue Details
0015530CMakeCMakepublic2015-04-23 18:052015-11-02 09:13
Bill Torpey 
 
normalfeaturealways
closedwon't fix 
x86_64LinuxRH6
CMake 2.8.12.2 
 
0015530: is it possible to run the build as a child process of cmake?
When setting environment variables in a cmake script these obviously don't survive the invocation of cmake itself, and are therefore not available to the subsequent build command (e.g., make).

It would be very helpful if cmake could invoke the build as a sub-process such that any environment variables set in the cmake script would still be available.

I realize that there are (many) other ways to accomplish a similar result. In our case, it would be nice to consolidate the build logic in one place (cmake), rather than to have it spread out in different scripts etc.

I initially thought the --build option to cmake might do this, but it doesn't appear to (or I'm doing something wrong).
No tags attached.
Issue History
2015-04-23 18:05Bill TorpeyNew Issue
2015-04-27 09:59Brad KingNote Added: 0038612
2015-04-27 09:59Brad KingStatusnew => resolved
2015-04-27 09:59Brad KingResolutionopen => won't fix
2015-11-02 09:13Robert MaynardNote Added: 0039789
2015-11-02 09:13Robert MaynardStatusresolved => closed

Notes
(0038612)
Brad King   
2015-04-27 09:59   
The lack of this capability is by design. CMake generates a build system for native tools. Those native tools actually do the build.

In the case of the VS IDE, its build system generally isolates the build from the calling environment anyway.

In the case of command-line builds (e.g. "make") the intention is that CMake is executed from an environment that already contains the settings needed by the toolchain. Building such an environment is outside the scope of CMake.
(0039789)
Robert Maynard   
2015-11-02 09:13   
Closing resolved issues that have not been updated in more than 4 months.