automake
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Autotools and CMake


From: Warren Young
Subject: Re: Autotools and CMake
Date: Fri, 26 Dec 2014 18:46:01 -0700

On Dec 26, 2014, at 7:56 AM, Kip Warner <address@hidden> wrote:

> On Wed, 2014-12-24 at 15:49 -0700, Warren Young wrote:
> 
>> I’d put the “mkdir build ; cd build ; cmake ..” type of stuff in your 
>> bootstrap script:
> 
> I think the logical place to "configure"
> another subproject is within the superproject's configure script.

Yes, that’s better, for a reason that is not obvious, at least to me.

The bootstrap script is only supposed to be used by those building from the 
project’s VCS repository, while those building from distribution tarballs will 
just use whatever Makefiles are provided.

The thing about CMake is that its generated Makefiles contain cmake calls, so 
they’re not independent of CMake, as Automake-generated Makefiles are 
independent of Automake.  Therefore, if you ship CMake-generated Makefiles with 
your distribution tarballs, you create two problems:

1. Those building from the distribution tarball still need cmake.

2. If the timestamps don’t force a re-generation of the Makefiles, they will 
only work on systems that are substantially similar to the one the distribution 
tarball was created on.

Better, in the end, to simply make cmake a build prereq for all users.

Therefore, I’d add a check for the existence of CMake on the build system to 
configure.ac, followed immediately by something like 

    mkdir -p build ; cd build ; cmake ..

Then in the top-level Makefile.am, in the all-local target, I’d add

    cd build ; make

I believe there are other ways to do the latter.  SUBDIR_MUMBLE…?

> Would
> you recommend AC_CONFIG_COMMANDS_PRE to run the subproject's cmake, or
> some other method?

I don’t see why the cmake command needs to be baked into config.status.  I’d 
just put the commands somewhere in the configure.ac file, probably immediately 
after the check for the existence of CMake on the build system.  

Anything found in that file that is not an Autoconf macro gets copied directly 
into the output configure script, which is a normal Bourne shell script.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]