[CMake] execute_process, set a path

Bill Hoffman bill.hoffman at kitware.com
Thu Dec 11 13:51:08 EST 2008


Edward Flanigan wrote:
> How do I set LD_LIBRARY_PATH so I can call execute_process( ) using that 
> library path.
> 
> 
> Example:
> 
> execute_process(COMMAND echo \$PATH  COMMAND LD_LIBRARY_PATH=/home/my 
> COMMAND myExe )
> 
> The 1st command should print the $PATH
> the 2nd should set LD_LIBARY_PATH
> the 3rd should execute myExe (with LD_LIBRARY_PATH being the correct on 
> specified in COMMAND 2)
> 

set(ENV{LD_LIBRARY_PATH} /home/my)
execute_process( COMMAND myExe )

-Bill


More information about the CMake mailing list