Discussion:
[CMake] Understanding SET- and GET_TARGET_PROPERTY
wedekind
2006-06-13 11:33:06 UTC
Permalink
Hello all,

I am using CMake 2.2.3 and have a question about SET_TARGET_PROPERTIES and
GET_TARGET_PROPERTY.

If I am setting a target-specific property like this

SET_TARGET_PROPERTIES(myproject1 PROPERTIES myprop1 myvalue1)

I would like to read this property from another target myproject2 like this

GET_TARGET_PROPERTY(PROPVAR1 myproject1 myprop1)

Unfortunately this does not work like I have expected it. Can setting and
getting target properties be used this way? Can I expect to have a target
property be set for a target myproject1 if I want to read it during
processing of an arbitrary target myproject2?

Thanks and best regards

Marco
Brad King
2006-06-13 11:55:16 UTC
Permalink
Post by wedekind
Hello all,
I am using CMake 2.2.3 and have a question about SET_TARGET_PROPERTIES and
GET_TARGET_PROPERTY.
If I am setting a target-specific property like this
SET_TARGET_PROPERTIES(myproject1 PROPERTIES myprop1 myvalue1)
I would like to read this property from another target myproject2 like this
GET_TARGET_PROPERTY(PROPVAR1 myproject1 myprop1)
Unfortunately this does not work like I have expected it. Can setting and
getting target properties be used this way? Can I expect to have a target
property be set for a target myproject1 if I want to read it during
processing of an arbitrary target myproject2?
This should work in CMake 2.4 as long as both projects are under the
same top-level source directory and that the property is set before it
is read.

-Brad
Jan Woetzel
2006-06-13 12:01:03 UTC
Permalink
Post by Brad King
Post by wedekind
GET_TARGET_PROPERTY.
This should work in CMake 2.4 as long as both projects are under the
same top-level source directory and that the property is set before it
is read.
I had similar problems,
see bug report 3353.

Jan.
--
Dipl.-Ing. Jan Woetzel
--------------------------------------------------
University of Kiel
Institute of Computer Science and Applied Mathematics
Hermann-Rodewald-Str. 3 [room 310]
24098 Kiel/Germany
--------------------------------------------------
Phone +49-431-880-4477
Fax +49-431-880-4054
Mob. +49-179-2937346
--------------------------------------------------
Url www.mip.informatik.uni-kiel.de/~jw
Email ***@mip.informatik.uni-kiel.de
wedekind
2006-06-13 12:02:36 UTC
Permalink
Hi Brad,

thanks for your reply :)

Both projects are under the same top-level source directory. My problem now
is to find out when a property is set. I guess that the order in which the
projects are read determines when a project's properties are set?

If so, what determines the order in which projects are processed? Is it only
the SUBDIR command or is the order influenced by other commands
(dependencies?) as well?

Thanks

Marco

P.S.: Do you know whether getting and setting of properties works with CMake
2.2.3 too? Do you recommend to upgrade to CMake 2.4 anyway?

-----Ursprüngliche Nachricht-----
Von: Brad King [mailto:***@kitware.com]
Gesendet: Dienstag, 13. Juni 2006 13:55
An: wedekind
Cc: ***@cmake.org
Betreff: Re: [CMake] Understanding SET- and GET_TARGET_PROPERTY
Post by wedekind
Hello all,
I am using CMake 2.2.3 and have a question about SET_TARGET_PROPERTIES and
GET_TARGET_PROPERTY.
If I am setting a target-specific property like this
SET_TARGET_PROPERTIES(myproject1 PROPERTIES myprop1 myvalue1)
I would like to read this property from another target myproject2 like
this
Post by wedekind
GET_TARGET_PROPERTY(PROPVAR1 myproject1 myprop1)
Unfortunately this does not work like I have expected it. Can setting and
getting target properties be used this way? Can I expect to have a target
property be set for a target myproject1 if I want to read it during
processing of an arbitrary target myproject2?
This should work in CMake 2.4 as long as both projects are under the
same top-level source directory and that the property is set before it
is read.

-Brad
Alexander Neundorf
2006-06-13 12:17:59 UTC
Permalink
Hi,
Post by wedekind
Hi Brad,
thanks for your reply :)
Both projects are under the same top-level source directory. My problem now
is to find out when a property is set. I guess that the order in which the
projects are read determines when a project's properties are set?
If so, what determines the order in which projects are processed? Is it only
the SUBDIR command
Yes.
Post by wedekind
or is the order influenced by other commands (dependencies?) as well?
I don't think so.
Post by wedekind
P.S.: Do you know whether getting and setting of properties works with
CMake 2.2.3 too? Do you recommend to upgrade to CMake 2.4 anyway?
Upgrading to 2.4.2 is recommended, it features really a lot of improvements and fixes over 2.2.x

Bye
Alex
--
Der GMX SmartSurfer hilft bis zu 70% Ihrer Onlinekosten zu sparen!
Ideal für Modem und ISDN: http://www.gmx.net/de/go/smartsurfer
wedekind
2006-06-14 07:10:57 UTC
Permalink
Hi Alex,

thanks for your reply. I will upgrade to CMake 2.4.2 as soon as possible.

Best regards

Marco

-----Ursprüngliche Nachricht-----
Von: Alexander Neundorf [mailto:a.neundorf-***@gmx.net]
Gesendet: Dienstag, 13. Juni 2006 14:18
An: wedekind; ***@cmake.org
Betreff: Re: AW: [CMake] Understanding SET- and GET_TARGET_PROPERTY

Hi,
Post by wedekind
Hi Brad,
thanks for your reply :)
Both projects are under the same top-level source directory. My problem
now
is to find out when a property is set. I guess that the order in which the
projects are read determines when a project's properties are set?
If so, what determines the order in which projects are processed? Is it
only
the SUBDIR command
Yes.
Post by wedekind
or is the order influenced by other commands (dependencies?) as well?
I don't think so.
Post by wedekind
P.S.: Do you know whether getting and setting of properties works with
CMake 2.2.3 too? Do you recommend to upgrade to CMake 2.4 anyway?
Upgrading to 2.4.2 is recommended, it features really a lot of improvements
and fixes over 2.2.x

Bye
Alex
--
Der GMX SmartSurfer hilft bis zu 70% Ihrer Onlinekosten zu sparen!
Ideal für Modem und ISDN: http://www.gmx.net/de/go/smartsurfer
Continue reading on narkive:
Loading...