|[hatari-devel] CMake features|
[ Thread Index |
| More lists.tuxfamily.org/hatari-devel Archives
this is no bug report or something, just a generic discussion.
For quite some time Hatari features CMake as its build system. For as
long I was a bit unhappy with it and didn't see any benefit.
BUT: a few days ago CMake again came to attention at my office as we
discovered it cannot only generate Makefiles out of the CMakeLists.txt
but also IDE configurations and projects right away.
I personally always was disappointed that it was a bit problematic to
click together an IDE project witzh all Hatari sources in.
CMake now solves this problem nicely. For me it can generate at least an
environment for the Code::Blocks IDE but it can also do for Eclipse CDT
(untried by me yet) and ofcourse for non-Unix targets aswell.
For Windows, it is possible to generate a complete solution and project
collection for Visual Studio. I didn't try this with Hatari yet but at
the office for some work stuffs, it did.
For Mac OS, CMake can generate XCode projects. i remember there were
problems in the past that the supplied project was out-of-date. Maybe
(if it hasn't been done already), CMake can be used to generate a fresh
Xcode project or even provide only a clickablcallable piece of script so
Mac developers can easily generate one?
Reading the CMake manual helps alot, the trick is to select a different
"generator" with the -G option (or the CMake GUI under WIndows). Unter
Unix, this is normally Makefile. I used the following today:
$ cmake -G "CodeBlocks - Unix Makefiles" ../
-- The C compiler identification is GNU
[CMake output omitted]
-- Configuring done
-- Generating done
-- Build files have been written
and I could build and run Hatari from within Code::Blocks with no
hazzle. I simply
opened /home/marndt/src/hatari/build_codeblocks/hatari.cbp with
It should work the same with Visual Studio solutions, or other IDE
For Visual Studio there is one point (independant of Hatari)
If Visual Studio Express (2010) is used and you have a parallel
installation of the Visual Studio ISOLATED Environment of the same
version, you well get a problem by CMake. The isolated version is the
full IDE but brings no compiler. Express is a crippled IDE but brings
CMake will by default select the ISOLATED Environment GUI and then
subsequently fail because (ofcourse) it finds no compilers with this
one. In that case we found out at the office that it is necessary to set
CMAKE_MAKE_PROGRAM to MSBuild (found somewhere in the .NET installation)
and not to the default "devenv" as a -D option to CMake.
The error shouldn't matter if a full Visual Studio Professional edition
is in use.
I hope this was not unnecessary information posted here but I hope it
will help someone trying to do something to Hatari's code ;)
As a final word: Thanks for picking CMake for Hatari! This is a
marvellous tool! :o)
Matthias Arndt <marndt@xxxxxxxxxxxxxx>