Re: [cmake-developers] [Development] Installing Qt5Config.cmake from the Qt repo?

2011-11-02 Thread Alexander Neundorf
On Tuesday 01 November 2011, craig.sc...@csiro.au wrote:
...
 If you do that, you create a circular dependency, since CMake requires Qt
 to build its GUI application. Yes, you could build CMake's command line
 tools only, then Qt, then build CMake's GUI app, or alternatively you
 could install some previously built CMake package before building Qt, but
 these are steps that should not be necessary. 

I don't think that's a problem.

CMake has the same issue itself, you need cmake to build cmake.
So, what you do is you can either bootstrap cmake (then first a stripped down 
version of cmake is built, which then builds the full cmake), or use an older 
version of cmake to build the new cmake.

The same could be done here.
Use cmake and cmake-gui built against Qt x.y to build Qt x.y+1.
If there is no Qt at all, cmake-gui will not be built, it is optional.

Alex
--

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://public.kitware.com/cgi-bin/mailman/listinfo/cmake-developers


Re: [cmake-developers] [Development] Installing Qt5Config.cmake from the Qt repo?

2011-11-01 Thread Stephen Kelly
On Friday, October 28, 2011 07:58:25 Clinton Stimpson wrote:
 On Friday, October 28, 2011 06:21:23 am Stephen Kelly wrote:
  On Friday, October 28, 2011 13:56:20 Thiago Macieira wrote:
   On Friday, 28 de October de 2011 13:13:20 Stephen Kelly wrote:
* If you want to be easily found for others to depend on, you
write a

PackageConfig.cmake file and install it to a location
CMake
will use

to   find things like that. I assume this is similar to how
pkgconfig
works, but I have never used pkgconfig.
   
   Just like pkgconfig, I'd recommend that we make it one file per
   library, not one global Qt5Config.cmake.
  
  What I want to investigate (I haven't yet, but I'm confident it will
  work) is if we can have both. We could have Qt5Core.cmake, Qt5Gui.cmake
  etc, and Qt5Config would be an aggregate which include()s the other
  configs based on the FIND_COMPONENTS.
  
  find_package(Qt5 COMPONENTS QtCore)
  or
  find_package(Qt5 COMPONENTS QtGui)
  
  for example.
  
   Alternatively, let's be very clear: it's Qt5EssentialsConfig.cmake
   and it includes NO other Qt addon. For those addons, they need to
   provide the Config files themselves.
  
  Can you remind me where to find out what Qt5Essentials is or where I can
  find out? Searching in http://wiki.qt-project.org/ isn't throwing up
  anything. Is it roughly the contents of qtbase.git? Or does it include
  qtdeclarative.git too?
  
  Details like what would be included in Qt5Config could be discussed once
  there's some prototyping happening. I don't really feel strongly about
  it
  as long as it's roughly equivalent to what was made available by
  FindQt4.cmake.
  
  I'll wait a bit for other objections before prototyping though anyway.
  Then we can start looking at the real details.
  
  Thanks,
 
 Absolutely no objections from me.  I'm glad to see this happening, and am
 glad to see the new open governance in Qt.
 
 Thank you.

Cool, you're welcome. I've pushed my work in progress now to gitorious and 
will send an email about it shortly. 

 
 Lately, there has been more work in FindQt4.cmake to make it more complete.
 For example, there has been recent support for building with static plugins
 and easy deployment with cpack.
 
 Have you thought about taking it that far?

Yes, that is in scope for the CMake files in Qt I think, but I haven't worked 
on it yet.

 
 If you'd like, I can offer some review or input based on my experience
 maintaining FindQt4.cmake.

Thanks, I'll certainly get in touch when it's getting closer to ready. In the 
mean-time you can look at what I've done so far in the link in my next email.

Thanks,

-- 
Stephen Kelly step...@kdab.com | Software Engineer
KDAB (Deutschland) GmbH  Co.KG, a KDAB Group Company
www.kdab.com || Germany +49-30-521325470 || Sweden (HQ) +46-563-540090
KDAB - Qt Experts - Platform-Independent Software Solutions

signature.asc
Description: This is a digitally signed message part.
--

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://public.kitware.com/cgi-bin/mailman/listinfo/cmake-developers

Re: [cmake-developers] [Development] Installing Qt5Config.cmake from the Qt repo?

2011-11-01 Thread Stephen Kelly
On Friday, October 28, 2011 13:13:20 Stephen Kelly wrote:
 == Summary ==
 
 I'm considering adding some cmake files to Qt, which would be installed by
 Qt,  and which would make it easier for CMake based projects to depend on
 Qt.
 
 I'm CC'ing the cmake developers too see what they think of the idea too.

From the feedback, it seems like this is a welcome idea. So I went ahead and 
implemented it. My work is in the KDAB Qt5 clone on gitorious[1].

[1]https://qt.gitorious.org/+kdab-developers/qt/kdab-developers-
qtbase/commit/e79663d1352e7322839dfdfa2fa36bb30aaf4aac

At the moment it's a bit hacky but it does work on linux and it can be cleaned 
up. At this point I'm looking for some initial feedback on the cmake 
dependency (see below).

I was able to build a library in kdelibs framework branch with code similar 
to:

find_package(Qt5 REQUIRED Core Gui Widgets)
include(${Qt5_USE_FILE})

add_library(itemmodels SHARED ${itemmodels_SRCS})
target_link_libraries(itemmodels
${Qt5Core_LIBRARY} 
${Qt5Gui_LIBRARY} 
${Qt5Widgets_LIBRARY}
)

So, as a proof of concept, I think I can call this a sucess.

 
 == Clarification ==
 
 To avoid misunderstanding:
 
 * This proposal is not about porting the Qt build system to CMake.
 * This would not make Qt depend on CMake at all
 * I am proposing to add some plain text files to the Qt repo for
 installation * Those plain text files would need to be generated while
 building Qt (using existing mechanisms, like perl).

In the branch, I do depend on cmake at configure-time to generate the Targets 
files. These are platform specific files that cmake uses to build against 
libraries in debug and release versions.

I would like to add this non-optional configure time dependency on cmake to Qt.

The alternative would be to maintain Targets files for multiple platforms by 
generating those files at maintenance time (ie, running the script to generate 
them, copy the result into place and check it in). 

This maintenance burden is not really justifiable. The CMake dependency is 
already available where Qt is available.

Depending on CMake would also mean that I could use configure_file() and 
file(WRITE ...), which would make the stuff work across platforms already 
(currently it depends on sed being available). So I would be able to clean up 
the branch considerably.

Additionally, it would be easier to create a similar Config.cmake file for Qt 
libraries outside of qtbase.git (such as QtWebKit) as I could simply install 
the Qt5BasicConfig.cmake from qtbase and use it from the other repos.

I would make this dependency on CMake non-optional because it is important to 
be able to use find_package(Qt5) without having to care about whether the 
person who built it had cmake installed at the time. find_package(Qt5)  needs 
to work for each Qt5 build, so the config files need to be all the time.

Let me know if this is acceptable for Qt.

Thanks,

-- 
Stephen Kelly step...@kdab.com | Software Engineer
KDAB (Deutschland) GmbH  Co.KG, a KDAB Group Company
www.kdab.com || Germany +49-30-521325470 || Sweden (HQ) +46-563-540090
KDAB - Qt Experts - Platform-Independent Software Solutions

signature.asc
Description: This is a digitally signed message part.
--

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://public.kitware.com/cgi-bin/mailman/listinfo/cmake-developers

Re: [cmake-developers] [Development] Installing Qt5Config.cmake from the Qt repo?

2011-10-28 Thread Stephen Kelly
On Friday, October 28, 2011 13:56:20 Thiago Macieira wrote:
 On Friday, 28 de October de 2011 13:13:20 Stephen Kelly wrote:
  * If you want to be easily found for others to depend on, you write a
  
  PackageConfig.cmake file and install it to a location CMake
  will use 
  to   find things like that. I assume this is similar to how pkgconfig
  works, but I have never used pkgconfig.
 
 Just like pkgconfig, I'd recommend that we make it one file per library, not
 one global Qt5Config.cmake.

What I want to investigate (I haven't yet, but I'm confident it will work) is 
if we can have both. We could have Qt5Core.cmake, Qt5Gui.cmake etc, and 
Qt5Config would be an aggregate which include()s the other configs based on the 
FIND_COMPONENTS. 

find_package(Qt5 COMPONENTS QtCore)
or 
find_package(Qt5 COMPONENTS QtGui)

for example.

 Alternatively, let's be very clear: it's Qt5EssentialsConfig.cmake and it
 includes NO other Qt addon. For those addons, they need to provide the
 Config files themselves.

Can you remind me where to find out what Qt5Essentials is or where I can find 
out? Searching in http://wiki.qt-project.org/ isn't throwing up anything. Is 
it roughly the contents of qtbase.git? Or does it include qtdeclarative.git 
too?

Details like what would be included in Qt5Config could be discussed once 
there's some prototyping happening. I don't really feel strongly about it as 
long as it's roughly equivalent to what was made available by FindQt4.cmake.

I'll wait a bit for other objections before prototyping though anyway. Then we 
can start looking at the real details.

Thanks,

-- 
Stephen Kelly step...@kdab.com | Software Engineer
KDAB (Deutschland) GmbH  Co.KG, a KDAB Group Company
www.kdab.com || Germany +49-30-521325470 || Sweden (HQ) +46-563-540090
KDAB - Qt Experts - Platform-Independent Software Solutions

signature.asc
Description: This is a digitally signed message part.
--

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://public.kitware.com/cgi-bin/mailman/listinfo/cmake-developers

Re: [cmake-developers] [Development] Installing Qt5Config.cmake from the Qt repo?

2011-10-28 Thread Stephen Kelly
On Friday, October 28, 2011 16:24:08 Matt Williams wrote:
 On 28 October 2011 14:44,  lars.kn...@nokia.com wrote:
 
  I think that's reasonable in general. It's similar to what we do to
  support pkgconfig. I agree with Thiago's comment that this should be
  split and we should have one file per shared library.
 
 I think Stephen's suggestion of having one CMake file for all Qt
 Essentials using find_package(Qt5 COMPONENTS QtGui etc...) makes the
 most sense, at least for specifying which QtEssential libraries to
 build against. It is the way most CMake files like this are done and
 is not dissimilar to how the existing FindQt4.cmake works. Whether we
 have a separate CMake file for Qt Addons (whether a separate one for
 each module of another combined one) becomes a separate issue.

Yes, that should certainly work. The idea of one config file per library should 
also work:

find_package(Qt5Core)
find_package(Qt5Gui)
find_package(Qt5Widgets)

then the contents of Qt5Config would look something like (CMake code):

foreach(_component Qt5_FIND_COMPONENTS)
  if (_component MATCHES QtCore)
find_package(Qt5Core NOMODULE)
  endif()
  # ... etc
endforeach()

Regarding what Qt5Config should be able to find, I would say that it should be 
able to find QtWidgets, which is not an essential module, but an addon in Qt 5.

I'll prototype it next week and see how it goes.

 
  How is this dependency wise? Would we need to install these files into a
  special location and how do we know where this location is? Does
  supporting the feature require cmake to be installed?
 
 From http://www.cmake.org/cmake/help/cmake2.6docs.html#command:find_package
 (page down a little) you have a number of options of where to install
 them. For example prefix/(share|lib)/name*/(cmake|CMake)/ where
 prefix could be /usr and name could be 'Qt5' so they could be
 installed in /usr/share/Qt5/cmake. There's similar special paths on
 Windows and Mac.
 
 For the purpose of building and installing Qt we have no dependence on
 CMake. As Stephen says the files could just be created from some
 templates using a bit of Perl (or whatever you want). For someone
 building a project which depends on Qt they would of course need CMake
 to find these files.

Yep, I have nothing more to add to this.

Thanks,

-- 
Stephen Kelly step...@kdab.com | Software Engineer
KDAB (Deutschland) GmbH  Co.KG, a KDAB Group Company
www.kdab.com || Germany +49-30-521325470 || Sweden (HQ) +46-563-540090
KDAB - Qt Experts - Platform-Independent Software Solutions

signature.asc
Description: This is a digitally signed message part.
--

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://public.kitware.com/cgi-bin/mailman/listinfo/cmake-developers