Re: [CMake] FindQt4.cmake to automatically include QT_USE_FILE?

2011-06-08 Thread Michael Hertling
On 06/07/2011 02:20 PM, Bjørn Forsman wrote: Hi all, As far as I can tell, all Qt programs built with CMake must include QT_USE_FILE after find_package(). So why doesn't FindQt4.cmake simply include QT_USE_FILE itself? Is there maybe a use case where QT_USE_FILE is *not* wanted? Yes, there

Re: [CMake] FindQt4.cmake to automatically include QT_USE_FILE?

2011-06-08 Thread Michael Hertling
On 06/07/2011 06:58 PM, Michael Wild wrote: On 06/07/2011 06:23 PM, Bjørn Forsman wrote: 2011/6/7 Michael Wild them...@gmail.com: On 06/07/2011 03:38 PM, Bjørn Forsman wrote: Why not put find_package(Qt4) in the sub directories where it is actually used? And if it is used in multiple

Re: [CMake] FindQt4.cmake to automatically include QT_USE_FILE?

2011-06-08 Thread Michael Hertling
On 06/07/2011 09:13 PM, Bjørn Forsman wrote: 2011/6/7 Michael Wild them...@gmail.com: If the FindXXX.cmake file called add_definitions(), include_directories() et al., that could be potentially harmful. Some sources might required that some define is not set, or a wrong header file might be

[CMake] FindQt4.cmake to automatically include QT_USE_FILE?

2011-06-07 Thread Bjørn Forsman
Hi all, As far as I can tell, all Qt programs built with CMake must include QT_USE_FILE after find_package(). So why doesn't FindQt4.cmake simply include QT_USE_FILE itself? Is there maybe a use case where QT_USE_FILE is *not* wanted? Best regards, Bjørn Forsman

Re: [CMake] FindQt4.cmake to automatically include QT_USE_FILE?

2011-06-07 Thread Michael Wild
On 06/07/2011 02:20 PM, Bjørn Forsman wrote: Hi all, As far as I can tell, all Qt programs built with CMake must include QT_USE_FILE after find_package(). So why doesn't FindQt4.cmake simply include QT_USE_FILE itself? Is there maybe a use case where QT_USE_FILE is *not* wanted? Best

Re: [CMake] FindQt4.cmake to automatically include QT_USE_FILE?

2011-06-07 Thread John Drescher
If you don't care for the macros and want to set up the include-directories and defines yourself, no. Also, it is common to find_package(Qt4) in the top-level CMakeLists.txt file, but then include QT_USE_FILE only in specific subdirectories, where Qt is actually used. I have started doing

Re: [CMake] FindQt4.cmake to automatically include QT_USE_FILE?

2011-06-07 Thread Bjørn Forsman
Thanks for a quick reply! On 7 June 2011 14:52, Michael Wild them...@gmail.com wrote: On 06/07/2011 02:20 PM, Bjørn Forsman wrote: As far as I can tell, all Qt programs built with CMake must include QT_USE_FILE after find_package(). So why doesn't FindQt4.cmake simply include QT_USE_FILE

Re: [CMake] FindQt4.cmake to automatically include QT_USE_FILE?

2011-06-07 Thread Michael Wild
On 06/07/2011 03:21 PM, John Drescher wrote: If you don't care for the macros and want to set up the include-directories and defines yourself, no. Also, it is common to find_package(Qt4) in the top-level CMakeLists.txt file, but then include QT_USE_FILE only in specific subdirectories, where

Re: [CMake] FindQt4.cmake to automatically include QT_USE_FILE?

2011-06-07 Thread Bjørn Forsman
On 7 June 2011 15:21, John Drescher dresche...@gmail.com wrote: If you don't care for the macros and want to set up the include-directories and defines yourself, no. Also, it is common to find_package(Qt4) in the top-level CMakeLists.txt file, but then include QT_USE_FILE only in specific

Re: [CMake] FindQt4.cmake to automatically include QT_USE_FILE?

2011-06-07 Thread Michael Wild
On 06/07/2011 03:38 PM, Bjørn Forsman wrote: Thanks for a quick reply! On 7 June 2011 14:52, Michael Wild them...@gmail.com wrote: On 06/07/2011 02:20 PM, Bjørn Forsman wrote: As far as I can tell, all Qt programs built with CMake must include QT_USE_FILE after find_package(). So why

Re: [CMake] FindQt4.cmake to automatically include QT_USE_FILE?

2011-06-07 Thread Marcus D. Hanwell
On Tue, Jun 7, 2011 at 9:46 AM, Michael Wild them...@gmail.com wrote: On 06/07/2011 03:21 PM, John Drescher wrote: If you don't care for the macros and want to set up the include-directories and defines yourself, no. Also, it is common to find_package(Qt4) in the top-level CMakeLists.txt file,

Re: [CMake] FindQt4.cmake to automatically include QT_USE_FILE?

2011-06-07 Thread Michael Wild
On 06/07/2011 04:11 PM, Marcus D. Hanwell wrote: On Tue, Jun 7, 2011 at 9:46 AM, Michael Wild them...@gmail.com wrote: On 06/07/2011 03:21 PM, John Drescher wrote: If you don't care for the macros and want to set up the include-directories and defines yourself, no. Also, it is common to

Re: [CMake] FindQt4.cmake to automatically include QT_USE_FILE?

2011-06-07 Thread Rolf Eike Beer
Hi all, As far as I can tell, all Qt programs built with CMake must include QT_USE_FILE after find_package(). So why doesn't FindQt4.cmake simply include QT_USE_FILE itself? Is there maybe a use case where QT_USE_FILE is *not* wanted? Besides the points already given here is another

Re: [CMake] FindQt4.cmake to automatically include QT_USE_FILE?

2011-06-07 Thread Bjørn Forsman
2011/6/7 Michael Wild them...@gmail.com: On 06/07/2011 03:38 PM, Bjørn Forsman wrote: Why not put find_package(Qt4) in the sub directories where it is actually used? And if it is used in multiple subdirectories? What's bad about that? (Sorry, I really don't know). FindXXX.cmake modules

Re: [CMake] FindQt4.cmake to automatically include QT_USE_FILE?

2011-06-07 Thread Bjørn Forsman
On 7 June 2011 16:32, Rolf Eike Beer e...@sf-mail.de wrote: Hi all, As far as I can tell, all Qt programs built with CMake must include QT_USE_FILE after find_package(). So why doesn't FindQt4.cmake simply include QT_USE_FILE itself? Is there maybe a use case where QT_USE_FILE is *not*

Re: [CMake] FindQt4.cmake to automatically include QT_USE_FILE?

2011-06-07 Thread Michael Wild
On 06/07/2011 06:23 PM, Bjørn Forsman wrote: 2011/6/7 Michael Wild them...@gmail.com: On 06/07/2011 03:38 PM, Bjørn Forsman wrote: Why not put find_package(Qt4) in the sub directories where it is actually used? And if it is used in multiple subdirectories? What's bad about that? (Sorry,

Re: [CMake] FindQt4.cmake to automatically include QT_USE_FILE?

2011-06-07 Thread Marcus D. Hanwell
2011/6/7 Michael Wild them...@gmail.com: On 06/07/2011 06:23 PM, Bjørn Forsman wrote: 2011/6/7 Michael Wild them...@gmail.com: On 06/07/2011 03:38 PM, Bjørn Forsman wrote: Why not put find_package(Qt4) in the sub directories where it is actually used? And if it is used in multiple

Re: [CMake] FindQt4.cmake to automatically include QT_USE_FILE?

2011-06-07 Thread Bjørn Forsman
2011/6/7 Michael Wild them...@gmail.com: If the FindXXX.cmake file called add_definitions(), include_directories() et al., that could be potentially harmful. Some sources might required that some define is not set, or a wrong header file might be #include'ed (thing of all the different X.h