CMake replacing Autotools?

Robin Westberg robin.westberg at oracle.com
Tue Apr 6 13:20:28 UTC 2021


Hi Christoph,

> On 19 Mar 2021, at 00:00, Christoph Grüninger <foss at grueninger.de> wrote:
> 
> ...
> 
> 2. More choices to actually build the project: Use integrated build
> tools of IDEs (Visual Studio, Xcode) or use Ninja, which is faster than
> gmake
> 
> ...
> 
> 4. CMake is better supported by IDEs like Visual Studio, Qt Creator,
> KDevelop.


Regarding the IDE support points, it’s possible to generate a CMakeLists.txt from the compile_commands.json file created when building using the current make system. You could then use CMake to generate a native project file for your IDE of choice, and use that for compiling and debugging HotSpot (final linking etc would still be done by make). I have a prototype for this that worked reasonably well with at least Xcode, CLion and Visual Studio as I remember it. If this sounds interesting to anyone I could perhaps try to make it available somewhere.. :)

Best regards,
Robin

> 
> 5. A lot of code bases were ported to CMake like KDE, Qt, or LLVM. Their
> arguments apply here, too. Also their trade-offs between investment and
> benefit.
> 
>> At various times, I have dreamed of replacing the configure script with
>> something that is more modern and easy to maintain than this bash/m4
>> mix. We have a very well-defined API for the configure script: the user
>> calls "bash configure" in the root directory of the project, with a set
>> of --options, and as a result we create a spec.gmk file that defines the
>> configuration. This could easily be replicated in another system. But if
>> I were to rewrite this from scratch, I'd rather write the whole
>> configure logic in Java (apart from some thin shell script logic needed
>> to find the boot jdk), rather than trying to shoehorn in our build model
>> in CMake.
> 
> I understand your temptation, but writing and maintaining all the
> configure/find logic and quirks will be a burden. I'd try to reduce the
> build system code to a minimum and rely on a third-party solution to do
> as much as possible for me.
> 
> Bye
> Christoph
> 
> -- 
> Als wär es nix, leb' ich von [IT] und mach' nur, was ich lieb'
> Lebe wie im Paradies, womit hab' ich das verdient?
> Die Wahrheit ist: Hab' ich nicht, ich bin nur reicher beschenkt
> Als jemand in einem armen Land mit dem gleichen Talent
> [frei nach Tua von Die Orsons - Oioioiropa]



More information about the build-dev mailing list