[CMake] CMAKE vsprops or equivalent...

Mike Jackson mike.jackson at bluequartz.net
Wed Dec 9 12:23:41 EST 2009


On Wed, Dec 9, 2009 at 12:09 PM, Tim St. Clair <timothysc at gmail.com> wrote:
> when using vsprops on windows, you can set environment variables which
> will be exist for a given project when it compiles.
>
> The example given in the link below:
> set_tests_properties(SomeTest PROPERTIES ENVIRONMENT
> "PATH=c:\somedir;c:\otherdir")
>
> is close to what I'm looking for, but I would like it to be fore any
> TARGET.  I tried doing:
> set_properties(MyTarget PROPERTIES ENVIRONMENT "MYVAR=foo1;MYVAR2=foo2")
> with no success on visual studio 2008.  During compilation of MyTarget
> those vars *do not* appear to be set.
>
> The template .vcproj, is kinda ugly, but may be last hope unless there
> is a cleaner method for doing thing in VS.
>
> Cheers,
> Tim
>
>
> On Wed, Dec 9, 2009 at 10:54 AM, Tyler Roscoe <tyler at cryptio.net> wrote:
>> On Wed, Dec 09, 2009 at 07:49:12AM -0600, Tim St. Clair wrote:
>>> Is there support for visual studio property sheets in CMAKE, or the
>>> equivalent for *compile-time* env settings?
>>
>> I haven't played with this solution but maybe it will help:
>>
>> http://stackoverflow.com/questions/1005901/how-to-set-path-environment-variable-using-cmake-and-visual-studio-to-run-test
>>
>> I don't know what you mean by "compile-time env settings".
>>
>>> I have had little luck finding this information online, and there are
>>> no (+,-) refs in the manual.
>>
>> I don't know what you mean by "(+,-) refs in the manual".
>>
>> tyler
>>
>
>
>
> --
> Cheers,
> Timothy St. Clair


Little late to the thread, but are you trying to set a Compile
Definition on an actual environment variable because a script or
something else is running during the compilation and it needs to know
where/what something is?

_________________________________________________________
Mike Jackson                  mike.jackson at bluequartz.net
BlueQuartz Software                    www.bluequartz.net
Principal Software Engineer                  Dayton, Ohio


More information about the CMake mailing list