[CMake] Re: premake build system

Alexander Neundorf a.neundorf-work at gmx.net
Mon Dec 17 14:08:20 EST 2007


On Monday 17 December 2007, Rodolfo Schulz de Lima wrote:
> Bill Hoffman escreveu:
> > Command line options have been a feature request for some time.  If
> > someone comes up with a good way to do them, I have no problem putting
> > them in CMake.  I guess the problem has always been the iterative nature
> > of the CMakeCache.txt file.   --help has to basically run the entire
> > build script to find all the arguments.  So, no need to fork on this.
>
> Maybe not that much... I think it'll suffice to traverse the build tree
> analyzing the CMakeLists.txt, looking for argument definitions. That's
> pretty quick in C++.

I don't think so.
"analyzing the CMakeLists.txt" means executing them basically completely.
See the following pseudocode:

if(WIN32)
  define some args
else
  define some other args
endif

execute_process(foo result)
if(result)
  define more args
endif

find_package(Bar)
if (BAR_FOUND)
  add_subdirectory(subdir)   ----> more args defined in subdir
endif

> > If there is something you can not do with the current cmake language
> > that could be done in lua (other than aesthetics), let us know, and
> > provide a patch, or even a report, and most likely we will put it in
> > CMake.  So, no need to fork here...
>
> As I've said somewhere, I'm working on a macro to support precompiled
> headers. To do it properly, cmake should be a little more than a build

Oh, I think some cmake devs are on that too but there were some problems or it 
didn't gain a lot... not sure.

> I right now need some kind of mapping data structure, like C++'s
> std::map, to record whether I've already created a pch file with certain
> flags, and what is its output name. I could do it easily with Lua
> because it supports common programming structures (a map, which it
> supports natively). But I'm stuck with cmake and must do ugly,
> non-optimal (speed-wise) things to simulate this behavior.

Yes, you can get map-like behaviour by using just variables:
SET(MY_MAP_${KEY} myValue)

Bye
Alex


More information about the CMake mailing list