[CMake] makefile to CMakeLists.txt, possible?

Eric Noulard eric.noulard at gmail.com
Thu Sep 2 02:21:20 EDT 2010


2010/9/2 Chiheng Xu <chiheng.xu at gmail.com>:
> On Fri, Aug 20, 2010 at 1:11 AM,  <"\"Roman Wüger\"
> <norulez at me.com>"@mac.com> wrote:
>> CMake is a Makefile-Generator an nothing else
>>
>> Why would you write the Makefiles by yourself?
>>
>
> Perhaps some people don't like the time consuming invocation of CMake.
>
> Maybe CMake can generate relocatable Makefiles only containing
> relative paths for several major platforms,  and developers "cache"
> the generated relocatable Makefiles in version control systems.  Then
> builders don't need to invoke CMake.

If you dig the ML you'll find several [very] good reasons why
it is not as easy as it seems for CMake to generate a set of
"relocatable" build files which does not need CMake anymore.
(currenlty generated Makefile (or other project files) may invoke CMake)

Trying to do that is not only difficult but will limit current CMake usability,
i.e. a lot of thing may happen "at cmake time" but you may want to
"invoke directly or indirectly cmake at build time too".

I'm not saying it wouldn't be theoretically possible nor practically useful
but that wasn't built in CMake design and now it seems difficult to do
with "not so much foreseen benefits".

As a side note, in the past, I did have to maintain a set of "portable
makefile" system
for 5 to 10 different platforms. After a while it was decided that we
should enforce
GNU make on all of them otherwise maintenance would be too time consuming.

After that I did use autotools for 3-4 years, then after 6+years of CMake usage
my point of view is that it's far easier to teach some of your
developper/builder how
to "basically" use CMake, than trying to maintain a portable build
system for all of them
using makefiles and/or autotools. Autotools may be OK if you do not
support windows platform.

I save a **lot of time** going from bare makefiles, to autotools and then CMake.

For those "bare [but respectable] builders" that do not want to touch CMakery
I usually try to craft some automated script like the one proposed here:
http://www.cmake.org/pipermail/cmake/2010-August/039270.html


-- 
Erk
Membre de l'April - « promouvoir et défendre le logiciel libre » -
http://www.april.org


More information about the CMake mailing list