[CMake] Setting environment variable to execute_process

Bill Hoffman bill.hoffman at kitware.com
Mon Aug 1 12:16:49 EDT 2011


On 8/1/2011 12:08 PM, Łukasz Tasz wrote:
> Hi,
>
> I would like to execute process, during cmake phase, but I need to
> tune LD_LIBRARY_PATH a little,
>
> I would like to get something like:
>
> execute_proccess(COMMAND LD_LIBRARY_PATH=my_path my_proccess
> ERROR_VARIABLE _error)
>
> Unfornately command above is not working...
> I'm using cmake 2.6
>
> thanks for any clues,
> Lukasz
>
The way to do this is to use the set command.

set(ENV{LD_LIBRARY_PATH} my_path)
execute_process(COMMAND my_process)

-Bill


More information about the CMake mailing list