Re: [CMake] Restrictions on where a binary can be put?

2011-01-09 Thread Andreas Pakulat
On 09.01.11 22:48:34, Nizar Khalifa Sallem wrote:
> > > I don't really understand why you want to get the LOCATION from your
> > > target, anyway, the get_target_property works fine if you use
> > > set_target_properties before it. [...]
> > 
> > ...but SET_TARGET_PROPERTIES() doesn't work fine if it's used after
> > GET_TARGET_PROPERTY(), even if both operate on different properties.
> That point I can definitely exclude since I am using
> set_target_properties on RUNTIME_OUTPUT_DIRECTORY along with
> get_target_property on the file name havily in my
> projects and it works fine even today. I am using cmake v2.8.3 (built)
> on a ubuntu 10.10 and it did work fine with cmake v2.6.4.

Did you build my example? If so, where was the foo binary put? The
example code has no other purpose than showing that changing the output
directory for the executable doesn't have any effect if done after
fetching a property from that target (the LOCATION).

It doesn't matter what my intent is in doing this to prove that this is
unexpected and strange behaviour. That means there's an error, that is
either cmake behaves incorrectly in not updating the output directory
once you've queried the LOCATION of a target. Or its intented behaviour
and the error is in not warning that the call has no effect and not
documenting this surprising behaviour.

Andreas

-- 
You will pioneer the first Martian colony.
___
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


Re: [CMake] Restrictions on where a binary can be put?

2011-01-09 Thread Nizar Khalifa Sallem
At Sun, 9 Jan 2011 16:50:35 -0500,
Martin O'Brien wrote:
> 
> Sorry, Nizar - I unintentionally hijacked the thread.  I wasn't commenting
> on your problem.
> 
> My bad,
> 
> mm
> 
> -Original Message-
> From: Nizar Khalifa Sallem [mailto:nksal...@laas.fr] 
> Sent: Sunday, January 09, 2011 4:49 PM
> To: Martin O'Brien
> Cc: cmake@cmake.org
> Subject: Re: [CMake] Restrictions on where a binary can be put?
> 
> At Sun, 9 Jan 2011 16:27:05 -0500,
> Martin O'Brien wrote:
> > 
> > Thanks, Michael.
> > 
> > 
> > Hmm.  I wonder what it is then, and why just today?
> > 
> > 
> > mm
> > 
> > 
> > 
> > -Original Message-
> > From: cmake-boun...@cmake.org [mailto:cmake-boun...@cmake.org] On Behalf
> Of
> > Michael Hertling
> > Sent: Sunday, January 09, 2011 4:27 PM
> > To: cmake@cmake.org
> > Subject: Re: [CMake] Restrictions on where a binary can be put?
> > 
> > On 01/09/2011 09:47 PM, Nizar Khalifa Sallem wrote:
> > > At Sun, 09 Jan 2011 21:42:49 +0100,
> > > Michael Hertling wrote:
> > >>
> > >> On 01/09/2011 09:09 PM, Andreas Pakulat wrote:
> > >>> On 09.01.11 21:05:21, Andreas Pakulat wrote:
> >  On 09.01.11 14:24:16, Michael Hertling wrote:
> > > On 01/09/2011 12:58 PM, Andreas Pakulat wrote:
> > >> Hi,
> > >>
> > >> I'm having a bit of a problem here changing the runtime output
> > directory
> > >> for a binary. Its an executable target named 'setup' and I'd like
> to
> > put it
> > >> into the top-level directory. Unfortunately it always ends up in
> the
> > bin/
> > >> directory, which is what CMAKE_RUNTIME_OUTPUT_DIRECTORY is being
> set
> > to.
> > >>
> > >> I'm using
> > >> set_target_properties( setup PROPERTIES
> RUNTIME_OUTPUT_DIRECTORY
> > ${CMAKE_BINARY_DIR} )
> > >> after creating the target currently, which should work as far as I
> > can see
> > >> from the documentation. Are there maybe any restrictions on what
> the
> > >> directory may be or what targets can be put there?
> > >>
> > >> If not, any suggestions how to debug this? I can see that the
> > build.make
> > >> does already have the rule setup for putting the binary into bin/,
> so
> > it
> > >> must be going wrong somewhere in the generation stage, but a simple
> > cmake
> > >> --trace doesn't show up anything suspicious. Is there a switch to
> > follow
> > >> the steps that cmake does during makefile-generation?
> > >
> > > Could you provide a minimal but complete example?
> > 
> >  Ok, attached case produces the error. Apparently the problem is
> > fetching
> >  the LOCATION property from the target and setting the
> >  RUNTIME_OUTPUT_DIRECTORY afterwards. Looks like a cmake bug to me, so
> >  I'll file a report.
> > >>>
> > >>> Ooops, forgot the attachment :)
> > >>
> > >> Now, I can confirm the issue; indeed, the GET_TARGET_PROPERTY() on the
> > >> LOCATION apparently renders the following SET_TARGET_PROPERTY() on the
> > >> RUNTIME_OUTPUT_DIRECTORY ineffective. As I cannot see any reason for
> > >> this, I'd agree that it should be considered as a bug. Besides, my
> > >> example was pointless: A simple clash of an executable "main" with
> > >> a subdirectory of the same name in CMAKE_BINARY_DIR, sorry. :/
> > >>
> > >> Regards,
> > >>
> > >> Michael
> > 
> > > I don't really understand why you want to get the LOCATION from your
> > > target, anyway, the get_target_property works fine if you use
> > > set_target_properties before it. [...]
> > 
> > ...but SET_TARGET_PROPERTIES() doesn't work fine if it's used after
> > GET_TARGET_PROPERTY(), even if both operate on different properties.
> That point I can definitely exclude since I am using
> set_target_properties on RUNTIME_OUTPUT_DIRECTORY along with
> get_target_property on the file name havily in my
> projects and it works fine even today. I am using cmake v2.8.3 (built)
> on a ubuntu 10.10 and it did work fine with cmake v2.6.4.
> 
> > 
> > > [...] I am not sure that the
> > > CMAKE_RUNTIME_OUTPUT_DIRECTORY makes a property which is
> > > "gettable". [...]
> > 
> > Why should any property be not gettable? Some are not settable, like
> > the LOCATION, but that's not the point. The point is that getting a
> > property, i.e. a read operation, should not have an impact on any
> > subsequent command which does not use the former's results.
> > 
> > > [...] If you can better explain what do you want to do with the
> > > LOCATION of your target may be someone can help.
> > 
> > Regards,
> > 
> > Michael
> > 
> > @ Martin O'Brien: On my side, everything works as usual.
> > ___
> > 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
>

Re: [CMake] Restrictions on where a binary can be put?

2011-01-09 Thread Martin O'Brien
Sorry, Nizar - I unintentionally hijacked the thread.  I wasn't commenting
on your problem.

My bad,

mm

-Original Message-
From: Nizar Khalifa Sallem [mailto:nksal...@laas.fr] 
Sent: Sunday, January 09, 2011 4:49 PM
To: Martin O'Brien
Cc: cmake@cmake.org
Subject: Re: [CMake] Restrictions on where a binary can be put?

At Sun, 9 Jan 2011 16:27:05 -0500,
Martin O'Brien wrote:
> 
> Thanks, Michael.
> 
> 
> Hmm.  I wonder what it is then, and why just today?
> 
> 
> mm
> 
> 
> 
> -Original Message-
> From: cmake-boun...@cmake.org [mailto:cmake-boun...@cmake.org] On Behalf
Of
> Michael Hertling
> Sent: Sunday, January 09, 2011 4:27 PM
> To: cmake@cmake.org
> Subject: Re: [CMake] Restrictions on where a binary can be put?
> 
> On 01/09/2011 09:47 PM, Nizar Khalifa Sallem wrote:
> > At Sun, 09 Jan 2011 21:42:49 +0100,
> > Michael Hertling wrote:
> >>
> >> On 01/09/2011 09:09 PM, Andreas Pakulat wrote:
> >>> On 09.01.11 21:05:21, Andreas Pakulat wrote:
>  On 09.01.11 14:24:16, Michael Hertling wrote:
> > On 01/09/2011 12:58 PM, Andreas Pakulat wrote:
> >> Hi,
> >>
> >> I'm having a bit of a problem here changing the runtime output
> directory
> >> for a binary. Its an executable target named 'setup' and I'd like
to
> put it
> >> into the top-level directory. Unfortunately it always ends up in
the
> bin/
> >> directory, which is what CMAKE_RUNTIME_OUTPUT_DIRECTORY is being
set
> to.
> >>
> >> I'm using
> >> set_target_properties( setup PROPERTIES
RUNTIME_OUTPUT_DIRECTORY
> ${CMAKE_BINARY_DIR} )
> >> after creating the target currently, which should work as far as I
> can see
> >> from the documentation. Are there maybe any restrictions on what
the
> >> directory may be or what targets can be put there?
> >>
> >> If not, any suggestions how to debug this? I can see that the
> build.make
> >> does already have the rule setup for putting the binary into bin/,
so
> it
> >> must be going wrong somewhere in the generation stage, but a simple
> cmake
> >> --trace doesn't show up anything suspicious. Is there a switch to
> follow
> >> the steps that cmake does during makefile-generation?
> >
> > Could you provide a minimal but complete example?
> 
>  Ok, attached case produces the error. Apparently the problem is
> fetching
>  the LOCATION property from the target and setting the
>  RUNTIME_OUTPUT_DIRECTORY afterwards. Looks like a cmake bug to me, so
>  I'll file a report.
> >>>
> >>> Ooops, forgot the attachment :)
> >>
> >> Now, I can confirm the issue; indeed, the GET_TARGET_PROPERTY() on the
> >> LOCATION apparently renders the following SET_TARGET_PROPERTY() on the
> >> RUNTIME_OUTPUT_DIRECTORY ineffective. As I cannot see any reason for
> >> this, I'd agree that it should be considered as a bug. Besides, my
> >> example was pointless: A simple clash of an executable "main" with
> >> a subdirectory of the same name in CMAKE_BINARY_DIR, sorry. :/
> >>
> >> Regards,
> >>
> >> Michael
> 
> > I don't really understand why you want to get the LOCATION from your
> > target, anyway, the get_target_property works fine if you use
> > set_target_properties before it. [...]
> 
> ...but SET_TARGET_PROPERTIES() doesn't work fine if it's used after
> GET_TARGET_PROPERTY(), even if both operate on different properties.
That point I can definitely exclude since I am using
set_target_properties on RUNTIME_OUTPUT_DIRECTORY along with
get_target_property on the file name havily in my
projects and it works fine even today. I am using cmake v2.8.3 (built)
on a ubuntu 10.10 and it did work fine with cmake v2.6.4.

> 
> > [...] I am not sure that the
> > CMAKE_RUNTIME_OUTPUT_DIRECTORY makes a property which is
> > "gettable". [...]
> 
> Why should any property be not gettable? Some are not settable, like
> the LOCATION, but that's not the point. The point is that getting a
> property, i.e. a read operation, should not have an impact on any
> subsequent command which does not use the former's results.
> 
> > [...] If you can better explain what do you want to do with the
> > LOCATION of your target may be someone can help.
> 
> Regards,
> 
> Michael
> 
> @ Martin O'Brien: On my side, everything works as usual.
> ___
> 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.

Re: [CMake] Restrictions on where a binary can be put?

2011-01-09 Thread Nizar Khalifa Sallem
At Sun, 9 Jan 2011 16:27:05 -0500,
Martin O'Brien wrote:
> 
> Thanks, Michael.
> 
> 
> Hmm.  I wonder what it is then, and why just today?
> 
> 
> mm
> 
> 
> 
> -Original Message-
> From: cmake-boun...@cmake.org [mailto:cmake-boun...@cmake.org] On Behalf Of
> Michael Hertling
> Sent: Sunday, January 09, 2011 4:27 PM
> To: cmake@cmake.org
> Subject: Re: [CMake] Restrictions on where a binary can be put?
> 
> On 01/09/2011 09:47 PM, Nizar Khalifa Sallem wrote:
> > At Sun, 09 Jan 2011 21:42:49 +0100,
> > Michael Hertling wrote:
> >>
> >> On 01/09/2011 09:09 PM, Andreas Pakulat wrote:
> >>> On 09.01.11 21:05:21, Andreas Pakulat wrote:
>  On 09.01.11 14:24:16, Michael Hertling wrote:
> > On 01/09/2011 12:58 PM, Andreas Pakulat wrote:
> >> Hi,
> >>
> >> I'm having a bit of a problem here changing the runtime output
> directory
> >> for a binary. Its an executable target named 'setup' and I'd like to
> put it
> >> into the top-level directory. Unfortunately it always ends up in the
> bin/
> >> directory, which is what CMAKE_RUNTIME_OUTPUT_DIRECTORY is being set
> to.
> >>
> >> I'm using
> >> set_target_properties( setup PROPERTIES RUNTIME_OUTPUT_DIRECTORY
> ${CMAKE_BINARY_DIR} )
> >> after creating the target currently, which should work as far as I
> can see
> >> from the documentation. Are there maybe any restrictions on what the
> >> directory may be or what targets can be put there?
> >>
> >> If not, any suggestions how to debug this? I can see that the
> build.make
> >> does already have the rule setup for putting the binary into bin/, so
> it
> >> must be going wrong somewhere in the generation stage, but a simple
> cmake
> >> --trace doesn't show up anything suspicious. Is there a switch to
> follow
> >> the steps that cmake does during makefile-generation?
> >
> > Could you provide a minimal but complete example?
> 
>  Ok, attached case produces the error. Apparently the problem is
> fetching
>  the LOCATION property from the target and setting the
>  RUNTIME_OUTPUT_DIRECTORY afterwards. Looks like a cmake bug to me, so
>  I'll file a report.
> >>>
> >>> Ooops, forgot the attachment :)
> >>
> >> Now, I can confirm the issue; indeed, the GET_TARGET_PROPERTY() on the
> >> LOCATION apparently renders the following SET_TARGET_PROPERTY() on the
> >> RUNTIME_OUTPUT_DIRECTORY ineffective. As I cannot see any reason for
> >> this, I'd agree that it should be considered as a bug. Besides, my
> >> example was pointless: A simple clash of an executable "main" with
> >> a subdirectory of the same name in CMAKE_BINARY_DIR, sorry. :/
> >>
> >> Regards,
> >>
> >> Michael
> 
> > I don't really understand why you want to get the LOCATION from your
> > target, anyway, the get_target_property works fine if you use
> > set_target_properties before it. [...]
> 
> ...but SET_TARGET_PROPERTIES() doesn't work fine if it's used after
> GET_TARGET_PROPERTY(), even if both operate on different properties.
That point I can definitely exclude since I am using
set_target_properties on RUNTIME_OUTPUT_DIRECTORY along with
get_target_property on the file name havily in my
projects and it works fine even today. I am using cmake v2.8.3 (built)
on a ubuntu 10.10 and it did work fine with cmake v2.6.4.

> 
> > [...] I am not sure that the
> > CMAKE_RUNTIME_OUTPUT_DIRECTORY makes a property which is
> > "gettable". [...]
> 
> Why should any property be not gettable? Some are not settable, like
> the LOCATION, but that's not the point. The point is that getting a
> property, i.e. a read operation, should not have an impact on any
> subsequent command which does not use the former's results.
> 
> > [...] If you can better explain what do you want to do with the
> > LOCATION of your target may be someone can help.
> 
> Regards,
> 
> Michael
> 
> @ Martin O'Brien: On my side, everything works as usual.
> ___
> 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

Best,
--
Nizar
___
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 

Re: [CMake] Restrictions on where a binary can be put?

2011-01-09 Thread Martin O'Brien
Thanks, Michael.


Hmm.  I wonder what it is then, and why just today?


mm



-Original Message-
From: cmake-boun...@cmake.org [mailto:cmake-boun...@cmake.org] On Behalf Of
Michael Hertling
Sent: Sunday, January 09, 2011 4:27 PM
To: cmake@cmake.org
Subject: Re: [CMake] Restrictions on where a binary can be put?

On 01/09/2011 09:47 PM, Nizar Khalifa Sallem wrote:
> At Sun, 09 Jan 2011 21:42:49 +0100,
> Michael Hertling wrote:
>>
>> On 01/09/2011 09:09 PM, Andreas Pakulat wrote:
>>> On 09.01.11 21:05:21, Andreas Pakulat wrote:
 On 09.01.11 14:24:16, Michael Hertling wrote:
> On 01/09/2011 12:58 PM, Andreas Pakulat wrote:
>> Hi,
>>
>> I'm having a bit of a problem here changing the runtime output
directory
>> for a binary. Its an executable target named 'setup' and I'd like to
put it
>> into the top-level directory. Unfortunately it always ends up in the
bin/
>> directory, which is what CMAKE_RUNTIME_OUTPUT_DIRECTORY is being set
to.
>>
>> I'm using
>> set_target_properties( setup PROPERTIES RUNTIME_OUTPUT_DIRECTORY
${CMAKE_BINARY_DIR} )
>> after creating the target currently, which should work as far as I
can see
>> from the documentation. Are there maybe any restrictions on what the
>> directory may be or what targets can be put there?
>>
>> If not, any suggestions how to debug this? I can see that the
build.make
>> does already have the rule setup for putting the binary into bin/, so
it
>> must be going wrong somewhere in the generation stage, but a simple
cmake
>> --trace doesn't show up anything suspicious. Is there a switch to
follow
>> the steps that cmake does during makefile-generation?
>
> Could you provide a minimal but complete example?

 Ok, attached case produces the error. Apparently the problem is
fetching
 the LOCATION property from the target and setting the
 RUNTIME_OUTPUT_DIRECTORY afterwards. Looks like a cmake bug to me, so
 I'll file a report.
>>>
>>> Ooops, forgot the attachment :)
>>
>> Now, I can confirm the issue; indeed, the GET_TARGET_PROPERTY() on the
>> LOCATION apparently renders the following SET_TARGET_PROPERTY() on the
>> RUNTIME_OUTPUT_DIRECTORY ineffective. As I cannot see any reason for
>> this, I'd agree that it should be considered as a bug. Besides, my
>> example was pointless: A simple clash of an executable "main" with
>> a subdirectory of the same name in CMAKE_BINARY_DIR, sorry. :/
>>
>> Regards,
>>
>> Michael

> I don't really understand why you want to get the LOCATION from your
> target, anyway, the get_target_property works fine if you use
> set_target_properties before it. [...]

...but SET_TARGET_PROPERTIES() doesn't work fine if it's used after
GET_TARGET_PROPERTY(), even if both operate on different properties.

> [...] I am not sure that the
> CMAKE_RUNTIME_OUTPUT_DIRECTORY makes a property which is
> "gettable". [...]

Why should any property be not gettable? Some are not settable, like
the LOCATION, but that's not the point. The point is that getting a
property, i.e. a read operation, should not have an impact on any
subsequent command which does not use the former's results.

> [...] If you can better explain what do you want to do with the
> LOCATION of your target may be someone can help.

Regards,

Michael

@ Martin O'Brien: On my side, everything works as usual.
___
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


Re: [CMake] Restrictions on where a binary can be put?

2011-01-09 Thread Michael Hertling
On 01/09/2011 09:47 PM, Nizar Khalifa Sallem wrote:
> At Sun, 09 Jan 2011 21:42:49 +0100,
> Michael Hertling wrote:
>>
>> On 01/09/2011 09:09 PM, Andreas Pakulat wrote:
>>> On 09.01.11 21:05:21, Andreas Pakulat wrote:
 On 09.01.11 14:24:16, Michael Hertling wrote:
> On 01/09/2011 12:58 PM, Andreas Pakulat wrote:
>> Hi,
>>
>> I'm having a bit of a problem here changing the runtime output directory
>> for a binary. Its an executable target named 'setup' and I'd like to put 
>> it
>> into the top-level directory. Unfortunately it always ends up in the bin/
>> directory, which is what CMAKE_RUNTIME_OUTPUT_DIRECTORY is being set to.
>>
>> I'm using
>> set_target_properties( setup PROPERTIES RUNTIME_OUTPUT_DIRECTORY 
>> ${CMAKE_BINARY_DIR} )
>> after creating the target currently, which should work as far as I can 
>> see
>> from the documentation. Are there maybe any restrictions on what the
>> directory may be or what targets can be put there?
>>
>> If not, any suggestions how to debug this? I can see that the build.make
>> does already have the rule setup for putting the binary into bin/, so it
>> must be going wrong somewhere in the generation stage, but a simple cmake
>> --trace doesn't show up anything suspicious. Is there a switch to follow
>> the steps that cmake does during makefile-generation?
>
> Could you provide a minimal but complete example?

 Ok, attached case produces the error. Apparently the problem is fetching
 the LOCATION property from the target and setting the
 RUNTIME_OUTPUT_DIRECTORY afterwards. Looks like a cmake bug to me, so
 I'll file a report.
>>>
>>> Ooops, forgot the attachment :)
>>
>> Now, I can confirm the issue; indeed, the GET_TARGET_PROPERTY() on the
>> LOCATION apparently renders the following SET_TARGET_PROPERTY() on the
>> RUNTIME_OUTPUT_DIRECTORY ineffective. As I cannot see any reason for
>> this, I'd agree that it should be considered as a bug. Besides, my
>> example was pointless: A simple clash of an executable "main" with
>> a subdirectory of the same name in CMAKE_BINARY_DIR, sorry. :/
>>
>> Regards,
>>
>> Michael

> I don't really understand why you want to get the LOCATION from your
> target, anyway, the get_target_property works fine if you use
> set_target_properties before it. [...]

...but SET_TARGET_PROPERTIES() doesn't work fine if it's used after
GET_TARGET_PROPERTY(), even if both operate on different properties.

> [...] I am not sure that the
> CMAKE_RUNTIME_OUTPUT_DIRECTORY makes a property which is
> "gettable". [...]

Why should any property be not gettable? Some are not settable, like
the LOCATION, but that's not the point. The point is that getting a
property, i.e. a read operation, should not have an impact on any
subsequent command which does not use the former's results.

> [...] If you can better explain what do you want to do with the
> LOCATION of your target may be someone can help.

Regards,

Michael

@ Martin O'Brien: On my side, everything works as usual.
___
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


Re: [CMake] Restrictions on where a binary can be put?

2011-01-09 Thread Michael Hertling
On 01/09/2011 09:32 PM, Nizar Khalifa Sallem wrote:
> At Sun, 9 Jan 2011 21:09:37 +0100,
> Andreas Pakulat wrote:
>>
>> [1  ]
>> On 09.01.11 21:05:21, Andreas Pakulat wrote:
>>> On 09.01.11 14:24:16, Michael Hertling wrote:
 On 01/09/2011 12:58 PM, Andreas Pakulat wrote:
> Hi,
>
> I'm having a bit of a problem here changing the runtime output directory
> for a binary. Its an executable target named 'setup' and I'd like to put 
> it
> into the top-level directory. Unfortunately it always ends up in the bin/
> directory, which is what CMAKE_RUNTIME_OUTPUT_DIRECTORY is being set to.
>
> I'm using
> set_target_properties( setup PROPERTIES RUNTIME_OUTPUT_DIRECTORY 
> ${CMAKE_BINARY_DIR} )
> after creating the target currently, which should work as far as I can see
> from the documentation. Are there maybe any restrictions on what the
> directory may be or what targets can be put there?
>
> If not, any suggestions how to debug this? I can see that the build.make
> does already have the rule setup for putting the binary into bin/, so it
> must be going wrong somewhere in the generation stage, but a simple cmake
> --trace doesn't show up anything suspicious. Is there a switch to follow
> the steps that cmake does during makefile-generation?

 Could you provide a minimal but complete example?
>>>
>>> Ok, attached case produces the error. Apparently the problem is fetching
>>> the LOCATION property from the target and setting the
>>> RUNTIME_OUTPUT_DIRECTORY afterwards. Looks like a cmake bug to me, so
>>> I'll file a report.
>>
>> Ooops, forgot the attachment :)
>>
>> Andreas
>>
>> -- 
>> You should emulate your heros, but don't carry it too far.  Especially
>> if they are dead.
>> [2 test_output_dir.tar.gz ]
>>
>> [3  ]
>> ___
>> 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
> Hi,
> 
> You I tested your CMakeLists.txt and this is no way a cmake bug but if
> you sent  a wrong CMakeLists.txt file.
> just remove this line get_target_property( _var foo LOCATION ) since
> your target name is also "foo".
> Tested without it and it works like a charm:

What's wrong with Andreas' CMakeLists.txt? He uses GET_TARGET_PROPERTY()
correctly - of course, on a target "foo". The point is why *reading* a
target property has an influence on subsequently *setting* a different
target property.

Regards,

Michael
___
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


Re: [CMake] Restrictions on where a binary can be put?

2011-01-09 Thread Nizar Khalifa Sallem
At Sun, 09 Jan 2011 21:42:49 +0100,
Michael Hertling wrote:
> 
> On 01/09/2011 09:09 PM, Andreas Pakulat wrote:
> > On 09.01.11 21:05:21, Andreas Pakulat wrote:
> >> On 09.01.11 14:24:16, Michael Hertling wrote:
> >>> On 01/09/2011 12:58 PM, Andreas Pakulat wrote:
>  Hi,
> 
>  I'm having a bit of a problem here changing the runtime output directory
>  for a binary. Its an executable target named 'setup' and I'd like to put 
>  it
>  into the top-level directory. Unfortunately it always ends up in the bin/
>  directory, which is what CMAKE_RUNTIME_OUTPUT_DIRECTORY is being set to.
> 
>  I'm using
>  set_target_properties( setup PROPERTIES RUNTIME_OUTPUT_DIRECTORY 
>  ${CMAKE_BINARY_DIR} )
>  after creating the target currently, which should work as far as I can 
>  see
>  from the documentation. Are there maybe any restrictions on what the
>  directory may be or what targets can be put there?
> 
>  If not, any suggestions how to debug this? I can see that the build.make
>  does already have the rule setup for putting the binary into bin/, so it
>  must be going wrong somewhere in the generation stage, but a simple cmake
>  --trace doesn't show up anything suspicious. Is there a switch to follow
>  the steps that cmake does during makefile-generation?
> >>>
> >>> Could you provide a minimal but complete example?
> >>
> >> Ok, attached case produces the error. Apparently the problem is fetching
> >> the LOCATION property from the target and setting the
> >> RUNTIME_OUTPUT_DIRECTORY afterwards. Looks like a cmake bug to me, so
> >> I'll file a report.
> > 
> > Ooops, forgot the attachment :)
> 
> Now, I can confirm the issue; indeed, the GET_TARGET_PROPERTY() on the
> LOCATION apparently renders the following SET_TARGET_PROPERTY() on the
> RUNTIME_OUTPUT_DIRECTORY ineffective. As I cannot see any reason for
> this, I'd agree that it should be considered as a bug. Besides, my
> example was pointless: A simple clash of an executable "main" with
> a subdirectory of the same name in CMAKE_BINARY_DIR, sorry. :/
> 
> Regards,
> 
> Michael
> ___
> 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
I don't really understand why you want to get the LOCATION from your
target, anyway, the get_target_property works fine if you use
set_target_properties before it. I am not sure that the
CMAKE_RUNTIME_OUTPUT_DIRECTORY makes a property which is
"gettable". If you can better explain what do you want to do with the
LOCATION of your target may be someone can help.

Best,
Nizar
___
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


Re: [CMake] Restrictions on where a binary can be put?

2011-01-09 Thread Martin O'Brien
Is anyone else besides me getting TWO e-mails with every post today (perhaps
just on this thread).

 

The first one looks like this - ~ 1KB and empty.

The second one looks like a regular post.

 

 

Thanks,

 

mm

 

From: cmake-boun...@cmake.org [mailto:cmake-boun...@cmake.org] On Behalf Of
Michael Hertling
Sent: Sunday, January 09, 2011 3:43 PM
To: cmake@cmake.org
Subject: Re: [CMake] Restrictions on where a binary can be put?

 

 

___
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

Re: [CMake] Restrictions on where a binary can be put?

2011-01-09 Thread Michael Hertling
On 01/09/2011 09:09 PM, Andreas Pakulat wrote:
> On 09.01.11 21:05:21, Andreas Pakulat wrote:
>> On 09.01.11 14:24:16, Michael Hertling wrote:
>>> On 01/09/2011 12:58 PM, Andreas Pakulat wrote:
 Hi,

 I'm having a bit of a problem here changing the runtime output directory
 for a binary. Its an executable target named 'setup' and I'd like to put it
 into the top-level directory. Unfortunately it always ends up in the bin/
 directory, which is what CMAKE_RUNTIME_OUTPUT_DIRECTORY is being set to.

 I'm using
 set_target_properties( setup PROPERTIES RUNTIME_OUTPUT_DIRECTORY 
 ${CMAKE_BINARY_DIR} )
 after creating the target currently, which should work as far as I can see
 from the documentation. Are there maybe any restrictions on what the
 directory may be or what targets can be put there?

 If not, any suggestions how to debug this? I can see that the build.make
 does already have the rule setup for putting the binary into bin/, so it
 must be going wrong somewhere in the generation stage, but a simple cmake
 --trace doesn't show up anything suspicious. Is there a switch to follow
 the steps that cmake does during makefile-generation?
>>>
>>> Could you provide a minimal but complete example?
>>
>> Ok, attached case produces the error. Apparently the problem is fetching
>> the LOCATION property from the target and setting the
>> RUNTIME_OUTPUT_DIRECTORY afterwards. Looks like a cmake bug to me, so
>> I'll file a report.
> 
> Ooops, forgot the attachment :)

Now, I can confirm the issue; indeed, the GET_TARGET_PROPERTY() on the
LOCATION apparently renders the following SET_TARGET_PROPERTY() on the
RUNTIME_OUTPUT_DIRECTORY ineffective. As I cannot see any reason for
this, I'd agree that it should be considered as a bug. Besides, my
example was pointless: A simple clash of an executable "main" with
a subdirectory of the same name in CMAKE_BINARY_DIR, sorry. :/

Regards,

Michael
___
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


Re: [CMake] Restrictions on where a binary can be put?

2011-01-09 Thread Nizar Khalifa Sallem
At Sun, 9 Jan 2011 21:09:37 +0100,
Andreas Pakulat wrote:
> 
> [1  ]
> On 09.01.11 21:05:21, Andreas Pakulat wrote:
> > On 09.01.11 14:24:16, Michael Hertling wrote:
> > > On 01/09/2011 12:58 PM, Andreas Pakulat wrote:
> > > > Hi,
> > > > 
> > > > I'm having a bit of a problem here changing the runtime output directory
> > > > for a binary. Its an executable target named 'setup' and I'd like to 
> > > > put it
> > > > into the top-level directory. Unfortunately it always ends up in the 
> > > > bin/
> > > > directory, which is what CMAKE_RUNTIME_OUTPUT_DIRECTORY is being set to.
> > > > 
> > > > I'm using
> > > > set_target_properties( setup PROPERTIES RUNTIME_OUTPUT_DIRECTORY 
> > > > ${CMAKE_BINARY_DIR} )
> > > > after creating the target currently, which should work as far as I can 
> > > > see
> > > > from the documentation. Are there maybe any restrictions on what the
> > > > directory may be or what targets can be put there?
> > > > 
> > > > If not, any suggestions how to debug this? I can see that the build.make
> > > > does already have the rule setup for putting the binary into bin/, so it
> > > > must be going wrong somewhere in the generation stage, but a simple 
> > > > cmake
> > > > --trace doesn't show up anything suspicious. Is there a switch to follow
> > > > the steps that cmake does during makefile-generation?
> > > 
> > > Could you provide a minimal but complete example?
> > 
> > Ok, attached case produces the error. Apparently the problem is fetching
> > the LOCATION property from the target and setting the
> > RUNTIME_OUTPUT_DIRECTORY afterwards. Looks like a cmake bug to me, so
> > I'll file a report.
> 
> Ooops, forgot the attachment :)
> 
> Andreas
> 
> -- 
> You should emulate your heros, but don't carry it too far.  Especially
> if they are dead.
> [2 test_output_dir.tar.gz ]
> 
> [3  ]
> ___
> 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
Hi,

You I tested your CMakeLists.txt and this is no way a cmake bug but if
you sent  a wrong CMakeLists.txt file.
just remove this line get_target_property( _var foo LOCATION ) since
your target name is also "foo".
Tested without it and it works like a charm:
u...@machine:~/tmp/test_output_dir/build$ rm -rf *
u...@machine:~/tmp/test_output_dir/build$ cmake ..
-- The C compiler identification is GNU
-- The CXX compiler identification is GNU
-- Check for working C compiler: /usr/bin/gcc
-- Check for working C compiler: /usr/bin/gcc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Configuring done
-- Generating done
-- Build files have been written to:
/home/user/tmp/test_output_dir/build
u...@machine:~/tmp/test_output_dir/build$ make
Scanning dependencies of target foo
[100%] Building CXX object CMakeFiles/foo.dir/main.cpp.o
Linking CXX executable foo
[100%] Built target foo
u...@machine:~/tmp/test_output_dir/build$ ls
CMakeCache.txt  CMakeFiles  cmake_install.cmake  foo  Makefile

Best,
--
Nizar
___
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


Re: [CMake] Restrictions on where a binary can be put?

2011-01-09 Thread Andreas Pakulat
On 09.01.11 21:09:37, Andreas Pakulat wrote:
> On 09.01.11 21:05:21, Andreas Pakulat wrote:
> > On 09.01.11 14:24:16, Michael Hertling wrote:
> > > On 01/09/2011 12:58 PM, Andreas Pakulat wrote:
> > > > Hi,
> > > > 
> > > > I'm having a bit of a problem here changing the runtime output directory
> > > > for a binary. Its an executable target named 'setup' and I'd like to 
> > > > put it
> > > > into the top-level directory. Unfortunately it always ends up in the 
> > > > bin/
> > > > directory, which is what CMAKE_RUNTIME_OUTPUT_DIRECTORY is being set to.
> > > > 
> > > > I'm using
> > > > set_target_properties( setup PROPERTIES RUNTIME_OUTPUT_DIRECTORY 
> > > > ${CMAKE_BINARY_DIR} )
> > > > after creating the target currently, which should work as far as I can 
> > > > see
> > > > from the documentation. Are there maybe any restrictions on what the
> > > > directory may be or what targets can be put there?
> > > > 
> > > > If not, any suggestions how to debug this? I can see that the build.make
> > > > does already have the rule setup for putting the binary into bin/, so it
> > > > must be going wrong somewhere in the generation stage, but a simple 
> > > > cmake
> > > > --trace doesn't show up anything suspicious. Is there a switch to follow
> > > > the steps that cmake does during makefile-generation?
> > > 
> > > Could you provide a minimal but complete example?
> > 
> > Ok, attached case produces the error. Apparently the problem is fetching
> > the LOCATION property from the target and setting the
> > RUNTIME_OUTPUT_DIRECTORY afterwards. Looks like a cmake bug to me, so
> > I'll file a report.
> 
> Ooops, forgot the attachment :)

Filed a ticket now:
http://public.kitware.com/Bug/view.php?id=11671

Andreas

-- 
You love your home and want it to be beautiful.
___
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


Re: [CMake] Restrictions on where a binary can be put?

2011-01-09 Thread Andreas Pakulat
On 09.01.11 21:05:21, Andreas Pakulat wrote:
> On 09.01.11 14:24:16, Michael Hertling wrote:
> > On 01/09/2011 12:58 PM, Andreas Pakulat wrote:
> > > Hi,
> > > 
> > > I'm having a bit of a problem here changing the runtime output directory
> > > for a binary. Its an executable target named 'setup' and I'd like to put 
> > > it
> > > into the top-level directory. Unfortunately it always ends up in the bin/
> > > directory, which is what CMAKE_RUNTIME_OUTPUT_DIRECTORY is being set to.
> > > 
> > > I'm using
> > > set_target_properties( setup PROPERTIES RUNTIME_OUTPUT_DIRECTORY 
> > > ${CMAKE_BINARY_DIR} )
> > > after creating the target currently, which should work as far as I can see
> > > from the documentation. Are there maybe any restrictions on what the
> > > directory may be or what targets can be put there?
> > > 
> > > If not, any suggestions how to debug this? I can see that the build.make
> > > does already have the rule setup for putting the binary into bin/, so it
> > > must be going wrong somewhere in the generation stage, but a simple cmake
> > > --trace doesn't show up anything suspicious. Is there a switch to follow
> > > the steps that cmake does during makefile-generation?
> > 
> > Could you provide a minimal but complete example?
> 
> Ok, attached case produces the error. Apparently the problem is fetching
> the LOCATION property from the target and setting the
> RUNTIME_OUTPUT_DIRECTORY afterwards. Looks like a cmake bug to me, so
> I'll file a report.

Ooops, forgot the attachment :)

Andreas

-- 
You should emulate your heros, but don't carry it too far.  Especially
if they are dead.


test_output_dir.tar.gz
Description: Binary data
___
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

Re: [CMake] Restrictions on where a binary can be put?

2011-01-09 Thread Andreas Pakulat
On 09.01.11 14:24:16, Michael Hertling wrote:
> On 01/09/2011 12:58 PM, Andreas Pakulat wrote:
> > Hi,
> > 
> > I'm having a bit of a problem here changing the runtime output directory
> > for a binary. Its an executable target named 'setup' and I'd like to put it
> > into the top-level directory. Unfortunately it always ends up in the bin/
> > directory, which is what CMAKE_RUNTIME_OUTPUT_DIRECTORY is being set to.
> > 
> > I'm using
> > set_target_properties( setup PROPERTIES RUNTIME_OUTPUT_DIRECTORY 
> > ${CMAKE_BINARY_DIR} )
> > after creating the target currently, which should work as far as I can see
> > from the documentation. Are there maybe any restrictions on what the
> > directory may be or what targets can be put there?
> > 
> > If not, any suggestions how to debug this? I can see that the build.make
> > does already have the rule setup for putting the binary into bin/, so it
> > must be going wrong somewhere in the generation stage, but a simple cmake
> > --trace doesn't show up anything suspicious. Is there a switch to follow
> > the steps that cmake does during makefile-generation?
> 
> Could you provide a minimal but complete example?

Ok, attached case produces the error. Apparently the problem is fetching
the LOCATION property from the target and setting the
RUNTIME_OUTPUT_DIRECTORY afterwards. Looks like a cmake bug to me, so
I'll file a report.

Andreas

-- 
Your reasoning is excellent -- it's only your basic assumptions that are wrong.
___
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


Re: [CMake] Restrictions on where a binary can be put?

2011-01-09 Thread Andreas Pakulat
On 09.01.11 14:24:16, Michael Hertling wrote:
> On 01/09/2011 12:58 PM, Andreas Pakulat wrote:
> > Hi,
> > 
> > I'm having a bit of a problem here changing the runtime output directory
> > for a binary. Its an executable target named 'setup' and I'd like to put it
> > into the top-level directory. Unfortunately it always ends up in the bin/
> > directory, which is what CMAKE_RUNTIME_OUTPUT_DIRECTORY is being set to.
> > 
> > I'm using
> > set_target_properties( setup PROPERTIES RUNTIME_OUTPUT_DIRECTORY 
> > ${CMAKE_BINARY_DIR} )
> > after creating the target currently, which should work as far as I can see
> > from the documentation. Are there maybe any restrictions on what the
> > directory may be or what targets can be put there?
> > 
> > If not, any suggestions how to debug this? I can see that the build.make
> > does already have the rule setup for putting the binary into bin/, so it
> > must be going wrong somewhere in the generation stage, but a simple cmake
> > --trace doesn't show up anything suspicious. Is there a switch to follow
> > the steps that cmake does during makefile-generation?
> 
> Could you provide a minimal but complete example?

Might take a bit, my first try actually works as expected, so I'll need
to take the real code and reduce it.

> Currently, I can't
> confirm this issue, i.e. the RUNTIME_OUTPUT_DIRECTORY property seems
> to take precedence over the CMAKE_RUNTIME_OUTPUT_DIRECTORY variable.
> Nevertheless, if RUNTIME_OUTPUT_DIRECTORY is set to CMAKE_BINARY_DIR
> from within a subdirectory, i.e. CMAKE_CURRENT_BINARY_DIR isn't equal
> to CMAKE_BINARY_DIR, I can see quite strange things happening:
> 
> # CMakeLists.txt:
> CMAKE_MINIMUM_REQUIRED(VERSION 2.8 FATAL_ERROR)
> PROJECT(ROD C)
> ADD_SUBDIRECTORY(main)
> 
> # main/CMakeLists.txt:
> FILE(WRITE ${CMAKE_CURRENT_BINARY_DIR}/main.c
> "int main(void){return 0;}\n"
> )
> ADD_EXECUTABLE(main ${CMAKE_CURRENT_BINARY_DIR}/main.c)
> SET_TARGET_PROPERTIES(main PROPERTIES
> RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}
> )
> 
> After CMaking from within an empty directory, building fails with:
> 
> .../gcc CMakeFiles/main.dir/main.c.o -o . -rdynamic
> .../ld: cannot open output file .: Is a directory
> 
> If the RUNTIME_OUTPUT_DIRECTORY property is set to CMAKE_BINARY_DIR/bin,
> e.g., everything works as expected, i.e. the executable gets written to
> CMAKE_BINARY_DIR/bin. Also, no such problem occurs from within the top-
> level directory, i.e. CMAKE_CURRENT_BINARY_DIR == CMAKE_BINARY_DIR.
> Perhaps, these two phenomena are related?

Hmm, for me everything works fine (see attached project) here when
setting the output-dir to cmake-binary-dir.

Andreas

-- 
Green light in A.M. for new projects.  Red light in P.M. for traffic tickets.


cmake_tst1.tar.gz
Description: Binary data
___
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

Re: [CMake] module contribution?

2011-01-09 Thread John Drescher
On Sat, Jan 8, 2011 at 7:55 PM, Nico Schlömer  wrote:
> Quick question here:
>
> I have a couple of libraries here which all need NetCDF, so I was
> thinking the cleanest solution would be to write one FindNetCDF.cmake
> and use it everywhere. What's the policy of including modules into the
> official CMake branch?
>

BTW, I am not sure if you know but you can append your own module path
to the CMAKE one so that you can add modules per project without
copying files to the CMake installation folders.

Here is what I do in my projects.
# The following line will add additional finders to CMake without the
need to be placed in the CMake install path
LIST(APPEND CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/CMake/Modules)

John

John
___
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


Re: [CMake] Restrictions on where a binary can be put?

2011-01-09 Thread Michael Hertling
On 01/09/2011 12:58 PM, Andreas Pakulat wrote:
> Hi,
> 
> I'm having a bit of a problem here changing the runtime output directory
> for a binary. Its an executable target named 'setup' and I'd like to put it
> into the top-level directory. Unfortunately it always ends up in the bin/
> directory, which is what CMAKE_RUNTIME_OUTPUT_DIRECTORY is being set to.
> 
> I'm using
> set_target_properties( setup PROPERTIES RUNTIME_OUTPUT_DIRECTORY 
> ${CMAKE_BINARY_DIR} )
> after creating the target currently, which should work as far as I can see
> from the documentation. Are there maybe any restrictions on what the
> directory may be or what targets can be put there?
> 
> If not, any suggestions how to debug this? I can see that the build.make
> does already have the rule setup for putting the binary into bin/, so it
> must be going wrong somewhere in the generation stage, but a simple cmake
> --trace doesn't show up anything suspicious. Is there a switch to follow
> the steps that cmake does during makefile-generation?

Could you provide a minimal but complete example? Currently, I can't
confirm this issue, i.e. the RUNTIME_OUTPUT_DIRECTORY property seems
to take precedence over the CMAKE_RUNTIME_OUTPUT_DIRECTORY variable.
Nevertheless, if RUNTIME_OUTPUT_DIRECTORY is set to CMAKE_BINARY_DIR
from within a subdirectory, i.e. CMAKE_CURRENT_BINARY_DIR isn't equal
to CMAKE_BINARY_DIR, I can see quite strange things happening:

# CMakeLists.txt:
CMAKE_MINIMUM_REQUIRED(VERSION 2.8 FATAL_ERROR)
PROJECT(ROD C)
ADD_SUBDIRECTORY(main)

# main/CMakeLists.txt:
FILE(WRITE ${CMAKE_CURRENT_BINARY_DIR}/main.c
"int main(void){return 0;}\n"
)
ADD_EXECUTABLE(main ${CMAKE_CURRENT_BINARY_DIR}/main.c)
SET_TARGET_PROPERTIES(main PROPERTIES
RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}
)

After CMaking from within an empty directory, building fails with:

.../gcc CMakeFiles/main.dir/main.c.o -o . -rdynamic
.../ld: cannot open output file .: Is a directory

If the RUNTIME_OUTPUT_DIRECTORY property is set to CMAKE_BINARY_DIR/bin,
e.g., everything works as expected, i.e. the executable gets written to
CMAKE_BINARY_DIR/bin. Also, no such problem occurs from within the top-
level directory, i.e. CMAKE_CURRENT_BINARY_DIR == CMAKE_BINARY_DIR.
Perhaps, these two phenomena are related?

Regards,

Michael
___
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


[CMake] Restrictions on where a binary can be put?

2011-01-09 Thread Andreas Pakulat
Hi,

I'm having a bit of a problem here changing the runtime output directory
for a binary. Its an executable target named 'setup' and I'd like to put it
into the top-level directory. Unfortunately it always ends up in the bin/
directory, which is what CMAKE_RUNTIME_OUTPUT_DIRECTORY is being set to.

I'm using
set_target_properties( setup PROPERTIES RUNTIME_OUTPUT_DIRECTORY 
${CMAKE_BINARY_DIR} )
after creating the target currently, which should work as far as I can see
from the documentation. Are there maybe any restrictions on what the
directory may be or what targets can be put there?

If not, any suggestions how to debug this? I can see that the build.make
does already have the rule setup for putting the binary into bin/, so it
must be going wrong somewhere in the generation stage, but a simple cmake
--trace doesn't show up anything suspicious. Is there a switch to follow
the steps that cmake does during makefile-generation?

Andreas

-- 
Avoid reality at all costs.
___
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


Re: [CMake] module contribution?

2011-01-09 Thread Eric Noulard
2011/1/9 Nico Schlömer :
> Quick question here:
>
> I have a couple of libraries here which all need NetCDF, so I was
> thinking the cleanest solution would be to write one FindNetCDF.cmake
> and use it everywhere. What's the policy of including modules into the
> official CMake branch?

http://www.cmake.org/Wiki/CMake:Module_Maintainers




-- 
Erk
Membre de l'April - « promouvoir et défendre le logiciel libre » -
http://www.april.org
___
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