[CMake] Is there analog of source command from bash ?

Denis Kotov redradist at gmail.com
Sun May 28 09:58:27 EDT 2017


Hi everyone,

I have tried to find solution to the following problem:
There is the project with environment variable described in *setenv.sh* file
Old build process looks like:
source *setenv.sh*
make release

But I want to accomplish this by *CMake*. But I have realized that *CMake*
does not have analog of source command that's why the following command
does not work:
execute_process(COMMAND bash -c "source ../setenv")

Because *CMake* creates a child process.
How can I import variables that was set in some sh file ?

*Thanks,*

*Best RegardsDenis Kotov*
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/cmake/attachments/20170528/204aa162/attachment.html>


More information about the CMake mailing list