[CMake] Patch to apply! Changing the default name"CMakeLists.txt"!

Brandon Van Every bvanevery at gmail.com
Mon Jan 14 12:10:55 EST 2008


On Jan 14, 2008 11:44 AM, Pau Garcia i Quiles <pgquiles at elpauer.org> wrote:
>
> I don't specially like the idea of different names for CMakeLists.txt
> and I don't see the use case, either. It makes sense for 'make' to
> have a '-f' parameter because you have make, gmake, nmake, with
> slightly or totally incompatible syntaxes but there is only one and
> great CMake (and we can even ask for a minimum versior, of condition
> execution of some parts depending on CMake's version).

My perspective is that legacy Autoconf + GMake build systems do have
multiple Makefiles in the same directory for various reasons.  When
converting such systems, it is easier to preserve their case uses.
And politically, people coming from an Autoconf + GMake background
will like "cmake -f blah.txt".  It's familiar.  It's not asking them
to learn anything new.  I advocate -f half for technical reasons, half
for marketing reasons.

> Anyway I think it'd be easy to integrate this feature in the Windows
> GUI: instead of choosing a folder and automagically search for
> CMakeLists.txt in it, let's make the user choose a file
> (CMakeLists.txt or whatever the developer decided to call it).
> Assuming instead of CMakeLists.txt a developer decided to call it
> GreatCMakeLists.txt, cmake would then go and search for
> GreatCMakeLists.txt instead of CMakeLists.txt in every SUBDIRS'ed or
> ADD_DIRECTORY'ed directory.

The slick way to do it, would be to scan all files in the directory,
make an educated guess at which ones are CMake files, and offer a menu
of files to choose from.  If only CMakeLists.txt is available then no
menu is generated.  The guess would need some intelligence to discern
between a main buildfile and sundry support scripts.  Lack of a target
*and* lack of an include might indicate that it's a support script,
for instance.

It would be substantial work to implement such a slick feature, it
would require ongoing testing and maintenance, and it's overkill for
the problem at hand.  Adding -f to CMake, CCMake, and CMakeSetup is
sufficient.  It's simple to implement and requires almost no
maintenance.


Cheers,
Brandon Van Every


More information about the CMake mailing list