[CMake] Fwd: setting environment variable through cmake

ankit jain ankitguddu at gmail.com
Fri Mar 6 08:35:06 EST 2009


2009/2/17 Philip Lowman <philip at yhbt.com>

>   On Mon, Feb 16, 2009 at 11:03 PM, ankit jain <ankitguddu at gmail.com>wrote:
>
>>
>>
>> ---------- Forwarded message ----------
>> From: ankit jain <ankitguddu at gmail.com>
>> Date: 2009/2/17
>> Subject: Re: [CMake] setting environment variable through cmake
>> To: Philip Lowman <philip at yhbt.com>
>>
>>
>> 2009/2/17 Philip Lowman <philip at yhbt.com>
>>
>>  On Mon, Feb 16, 2009 at 7:46 AM, ankit jain <ankitguddu at gmail.com>wrote:
>>>
>>>> Hi all,
>>>>
>>>> I want to set an enviromnet varibale but not able to do it.
>>>> Currently iam using the command:
>>>> SET( ENV{varname} value )
>>>>
>>>> But it is not working.
>>>> Can anybody guide me how to do it by giving an example.
>>>>
>>>
>>> Are you trying to set an environment variable that can be used during
>>> build time?  This isn't possible.
>>>
>>> http://www.cmake.org/Wiki/CMake_FAQ#How_can_I_get_or_set_environment_variables.3F
>>>
>>> Could you elaborate on when you need the environment variable?
>>>
>>
>>
>>> I need to set the environment variable at the time of testing since my
>>> test needs two environment variable that need to be set fro running the
>>> tests.
>>>
>> Iam using cmake 2.6
>>
>
> This should work on the latest CMake 2.6.3 RC, provided you use "make
> test".
>
> set_tests_properties(foo PROPERTIES ENVIRONMENT foo=bar)
>
>       I have run this but not able to set the environment variable.

         I am using cmake-2.6.3-RC-14-Linux-i386.
     Actually i have a test t1. i want to set and unset LD_LIBRARY_PATH acc.
while adding  test t1 so that on running ctest it will use that value of
LD_LIBRARY_PATH rather than using the older set value.

This iam not able to achieve that.

Guide where iam wrong and what need to be done.


Ankit
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.cmake.org/pipermail/cmake/attachments/20090306/7f0d1eae/attachment.htm>


More information about the CMake mailing list