Re: [dev] Re: CMake

2010-06-15 Thread Björn Michaelsen
Am Mon, 14 Jun 2010 14:13:36 -0400
schrieb Bill Hoffman bill.hoff...@kitware.com:

 OK, so you depend on gmake features.
Indeed. Some of the recent gmake features are really nifty and make it
quite powerful.

 This might be an interesting thing to try with CMake some day. To
 generate a makefile that does not have recursion, but depends on
 gmake as the make processor.   I will put that on the todo list.
That sounds interesting indeed -- and from a bootstrapping point of
view with gmake being plain C and thus very portable, it should be
available on pretty much any platform (or at least on any CMake
platform as CMake has higher requirements being C++).

 Right now CMake supports generic make.  I would not be against a
 gmake only makefile generator being added to CMake.  It would be an
 interesting experiment to see how this type of makefile compares for
 large and small projects.
If you do, please have a look at the stuff we are currently doing with
GNU make -- you will see that it might be possible to keep a lot of the
abstractions made by CMake visible in the generated files, if one uses
a small generic runtime library in GNU make.

Best Regards,

Bjoern

-
To unsubscribe, e-mail: dev-unsubscr...@openoffice.org
For additional commands, e-mail: dev-h...@openoffice.org



Re: [dev] Re: CMake

2010-06-14 Thread Bill Hoffman
On 6/11/2010 1:14 PM, bjoern michaelsen - Sun Microsystems - Hamburg 
Germany wrote:



Hi all,
see
http://www.gnu.org/software/automake/manual/make/Remaking-Makefiles.html#Remaking-Makefiles
for details:
To this end, after reading in all makefiles, make will consider each as
a goal target and attempt to update it. If a makefile has a rule which
says how to update it (found either in that very makefile or in another
one) or if an implicit rule applies to it (see Using Implicit Rules),
it will be updated if necessary. After all makefiles have been checked,
if any have actually been changed, make starts with a clean slate and
reads all the makefiles over again. (It will also attempt to update
each of them over again, but normally this will not change them again,
since they are already up to date.)

So this is done by including an not yet existing file and providing a
rule for it -- GNU make will take care of the rest.



OK, so you depend on gmake features.   This might be an interesting 
thing to try with CMake some day.  To generate a makefile that does not 
have recursion, but depends on gmake as the make processor.   I will put 
that on the todo list.  Right now CMake supports generic make.  I would 
not be against a gmake only makefile generator being added to CMake.  It 
would be an interesting experiment to see how this type of makefile 
compares for large and small projects.



-Bill

-
To unsubscribe, e-mail: dev-unsubscr...@openoffice.org
For additional commands, e-mail: dev-h...@openoffice.org



[dev] Re: CMake

2010-06-11 Thread Michael Stahl
On 10/06/2010 20:19, Bill Hoffman wrote:
 On 6/1/2010 8:30 AM, Mathias Bauer wrote:
 Hi Bill,

 it took longer than expected, but here we are. I took the CMake build
 protoype again, that my colleague Martin Hollmichel provided, and gave
 it another whirl. The results didn't change much.

 It seems to have taken me just as long...  Where is the prototype CMake 
 build, perhaps I should take a look at it.  :)

i think it is in the cws mh6bc (yay for intuitive naming!), which is
available via hg here:
http://hg.services.openoffice.org/hg/cws/mh6bc/

[snip]
 Another aspect of CMake that you do not address in your evaluation is
 that fact that with CMake you will be outsourcing the maintenance of
 the build system to the CMake developers.
 Sure, that goes without a saying. But we also don't plan to take over
 the maintenance of GNU Make ;-).
 
 
 So, the thing that CMake brings to the table is the platform support. 
 CMake knows how to build .so, .dll, .exe on all sorts of platforms. See 
 the cmake dashboard for a list:
 
 http://www.cdash.org/CDash/index.php?project=CMake
 
 We spend lots of time making sure all of that works on many different 
 systems.

hmm, ok.
well, for the most part building libraries and executables is what is now
implemented in the gbuild system / gnumake2 cws.
but your point about the maintenance is taken.

[snip]
 To my knowledge based on lurking on the mailing list and reading the
 documentation on your web site I concluded that CMake can be used
 recursively only. I would be glad if you could prove me wrong and show
 us that we can use CMake in a non-recursive way too without losing
 something else and that we won't run into scalability problems with our
 huge project. An example for what that could be: we made some
 scalability tests for GNU Make before we started using it and discovered
 that it doesn't scale well with the number of rules above ~25000 rules
 or so, but that could be fixed easily by using pattern rules as much as
 possible.
 
 We did attempt to create non-recursive makefiles for CMake, and they are 
 less recursive than they once were.  However, we found it impossible 
 to handle implicit dependencies of generated source files without using 
 recursive calls to make.  If you have a solution for that, we would be 
 very receptive.

i believe the gbuild system is designed so that GNU make will restart
itself automatically in such circumstances.
but i don't know how that works, maybe Björn will explain it...

 Another topic that is mentioned is the fact that builds have to be run
 from the top. That is not entirely true. You can have subprojects that
 are built on their own. Each add_subdirectory can point to a complete
 project. If you cd into the sub directory in the build tree, you can
 just run make, and it will only build the targets associated with that
 sub-project. Also, you could run cmake on the sub-project by itself if
 it is written to work as an independent sub-project.
 I never wanted to say that with CMake you always have to run from the
 top. But it seemed to me that by organizing the build in a way to allow
 more flexibility I lose other things.

 Sure, we can create a CMake makefile for each module we want to be able
 to build invidually and make it an own CMake project. But of course we
 still want to have the full build over all modules, and we need its
 result in the same working directory as the build of the individual
 modules.

 The project structure we are aiming at would look this way:

 -ooo
 --mod1
 --mod2
 ...
 --modn

 -sun
 --sun-mod1
 --sun-mod2
 ...
 --sun-modn

 We have these two top level projects because we want to build OOo and
 our commercial variant from the same source tree, as they share most of
 the code.

 We want to go to any sub module and build it independently from the
 rest, if possible without any external dependencies to other modules. Of
 course this would require that all other modules below had been built
 before at some time. If you ask why building single modules inside the
 whole tree is so important: remember the long time it takes on Windows
 to traverse through modules where nothing has to be built.

 We want to go into any of the two top modules (here named ooo and sun)
 and do a complete build, with all dependencies evaluated correctly as we
 would get it for a normal project without sub projects.

 We want to share the working directory between the two top level
 projects as we don't want to build the common parts twice, but each of
 them must be buildable separately as outside of our Hamburg lab only one
 top level project exists.

 How do I have to setup a CMake build to support that build structure?

 
 I am not totally sure I understand what you are wanted here...
 
 One that that comes to mind is the concept of out of source source... 
 Basically give add_subdirectory a directory that is not in the same 
 source tree.
 
 Something like this:
 if(BUILD_WITH_SUN)

Re: [dev] Re: CMake

2010-06-11 Thread bjoern michaelsen - Sun Microsystems - Hamburg Germany
On Fri, 11 Jun 2010 18:55:59 +0200
Michael Stahl michael.st...@sun.com wrote:

  We did attempt to create non-recursive makefiles for CMake, and
  they are less recursive than they once were.  However, we found
  it impossible to handle implicit dependencies of generated source
  files without using recursive calls to make.  If you have a
  solution for that, we would be very receptive.
 
 i believe the gbuild system is designed so that GNU make will restart
 itself automatically in such circumstances.
 but i don't know how that works, maybe Björn will explain it...

Hi all,
see
http://www.gnu.org/software/automake/manual/make/Remaking-Makefiles.html#Remaking-Makefiles
for details:
To this end, after reading in all makefiles, make will consider each as
a goal target and attempt to update it. If a makefile has a rule which
says how to update it (found either in that very makefile or in another
one) or if an implicit rule applies to it (see Using Implicit Rules),
it will be updated if necessary. After all makefiles have been checked,
if any have actually been changed, make starts with a clean slate and
reads all the makefiles over again. (It will also attempt to update
each of them over again, but normally this will not change them again,
since they are already up to date.)

So this is done by including an not yet existing file and providing a
rule for it -- GNU make will take care of the rest.

Best Regards,

Bjoern


-
To unsubscribe, e-mail: dev-unsubscr...@openoffice.org
For additional commands, e-mail: dev-h...@openoffice.org