CMAKE vsprops or equivalent...

classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|

CMAKE vsprops or equivalent...

Tim St. Clair
Is there support for visual studio property sheets in CMAKE, or the
equivalent for *compile-time* env settings?

I need this for projects which call out to legacy scripts which
require those vars during compilation.

I have had little luck finding this information online, and there are
no (+,-) refs in the manual.

Also, if this support does not exist yet is there a plan to add it?

--
Cheers,
Timothy St. Clair
_______________________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake
Reply | Threaded
Open this post in threaded view
|

Re: CMAKE vsprops or equivalent...

Tyler Roscoe
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
_______________________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake
Reply | Threaded
Open this post in threaded view
|

Re: CMAKE vsprops or equivalent...

Tim St. Clair
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 <[hidden email]> 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
_______________________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake
Reply | Threaded
Open this post in threaded view
|

Re: CMAKE vsprops or equivalent...

Michael Jackson
On Wed, Dec 9, 2009 at 12:09 PM, Tim St. Clair <[hidden email]> 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 <[hidden email]> 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                  [hidden email]
BlueQuartz Software                    www.bluequartz.net
Principal Software Engineer                  Dayton, Ohio
_______________________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake
Reply | Threaded
Open this post in threaded view
|

Re: CMAKE vsprops or equivalent...

Tim St. Clair
Environment variable, for the exact reason you mentioned.

On Wed, Dec 9, 2009 at 11:23 AM, Mike Jackson
<[hidden email]> wrote:

> On Wed, Dec 9, 2009 at 12:09 PM, Tim St. Clair <[hidden email]> 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 <[hidden email]> 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                  [hidden email]
> BlueQuartz Software                    www.bluequartz.net
> Principal Software Engineer                  Dayton, Ohio
>



--
Cheers,
Timothy St. Clair
_______________________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake
Reply | Threaded
Open this post in threaded view
|

Re: CMAKE vsprops or equivalent...

Tim St. Clair
I figured I would tickle this again, b/c it seemed like you knew a solution...

Cheers,
Tim

On Wed, Dec 9, 2009 at 12:01 PM, Tim St. Clair <[hidden email]> wrote:

> Environment variable, for the exact reason you mentioned.
>
> On Wed, Dec 9, 2009 at 11:23 AM, Mike Jackson
> <[hidden email]> wrote:
>> On Wed, Dec 9, 2009 at 12:09 PM, Tim St. Clair <[hidden email]> 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 <[hidden email]> 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                  [hidden email]
>> BlueQuartz Software                    www.bluequartz.net
>> Principal Software Engineer                  Dayton, Ohio
>>
>
>
>
> --
> Cheers,
> Timothy St. Clair
>



--
Cheers,
Timothy St. Clair
_______________________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake
Reply | Threaded
Open this post in threaded view
|

Re: CMAKE vsprops or equivalent...

David Cole
Compile time env settings may most easily be achieved (and in a cross-platform manner) by writing cmake scripts (called with cmake -P on the command line) and then using them as custom build steps via add_custom_command and add_custom_target calls. The scripts run in Visual Studio's environment, but can then set other environment variables as needed before performing their real work.

We do not have any support for the VS-specific property sheets that you mention. It might be a worthwhile feature request: you could ask for it in the bug tracker: http://www.cmake.org/Bug. It sounds like it could be a useful thing.


HTH,
David


On Thu, Dec 10, 2009 at 1:27 PM, Tim St. Clair <[hidden email]> wrote:
I figured I would tickle this again, b/c it seemed like you knew a solution...

Cheers,
Tim

On Wed, Dec 9, 2009 at 12:01 PM, Tim St. Clair <[hidden email]> wrote:
> Environment variable, for the exact reason you mentioned.
>
> On Wed, Dec 9, 2009 at 11:23 AM, Mike Jackson
> <[hidden email]> wrote:
>> On Wed, Dec 9, 2009 at 12:09 PM, Tim St. Clair <[hidden email]> 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 <[hidden email]> 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                  [hidden email]
>> BlueQuartz Software                    www.bluequartz.net
>> Principal Software Engineer                  Dayton, Ohio
>>
>
>
>
> --
> Cheers,
> Timothy St. Clair
>



--
Cheers,
Timothy St. Clair
_______________________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake


_______________________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake