[hatari-devel] Issues with CMake/CMakeLists.txt

Thomas Huth th.huth at googlemail.com
Mon Mar 22 23:52:46 CET 2010


On Fri, 19 Mar 2010 22:32:55 +0200
Eero Tamminen <eerot at users.berlios.de> wrote:

> Hi,
> 
> On Friday 19 March 2010, Thomas Huth wrote:
> > > I think just this should be enough:
> > > add_subdirectory(python-ui)
> >
> > Ok, that sounds reasonable.
> >
> > > And maybe something like this:
> > > include(FindPythonInterp)
> > > if(PYTHONINTERP_FOUND)
> > >         message(STATUS "WARNING: Python not present, hatariui
> > > cannot be run in the build environment!")
> > > endif(PYTHONINTERP_FOUND)
> >
> > Well, I think that could also be annoying for people who do not need
> > the the python-ui and don't have python installed (e.g. on Windows).
> > So let's keep it simple, without warning message.
> 
> Hm.  Maybe in that case it's better to leave it as it is.
> 
> All major Linux distros include Python in their base system
> (in Ubuntu it's even declared essential), so Linux packagers
> should always get python UI stuff.
> 
> 
> > This is certainly caused by the fact that the CMakeLists.txt in the
> > topmost directory turns on large filesystem support via "getconf
> > LFS_CFLAGS" - which is not done by the old Makefiles.
> > But you should not get warning messages because of this - unless
> > your zlib.h is broken. My zlib.h looks like this here:
> ...
> 
> Mine looks the same.

Ok, but then your "getconf LFS_CFLAGS" might be incomplete?
When I run it, I get "-D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64", i.e.
it defines _FILE_OFFSET_BITS=64 which should be sufficient to get the
prototypes and #defines from zlib.h, right?

> And:
> $ sdl-config --cflags
> -I/usr/include/SDL -D_GNU_SOURCE=1 -D_REENTRANT
> 
> 
> So sdl-config brings in _GNU_SOURCE which brings in LFS, C99 etc.

Ok, ... but this somehow does not feel right either. It should be up to
the program to select this define, and not up to the library!?!

> > This is done by the standard FindSDL.cmake package that is shipped
> > with CMake. I think they now what they're doing. If not, they would
> > probably get a lot of complaints on their mailing lists... ;-)
> 
> Well, it seems that CMake doesn't use sdl-config and therefore doesn't
> use _GNU_SOURCE, so it craps out my build.

Ok, agreed, it should better you sdl-config (or pkg-config) for
detecting the SDL...
Well, we still could add our own FindSDL.cmake file to our build system,
which then uses sdl-config/pkg-config for detecting the SDL if
possible, and falls back to the default behaviour if it's not
available. I can do that later, just not within the next few weeks
(I'll be on a business trip)... or maybe someone else might want to
have a try?

 Regards,
  Thomas



More information about the hatari-devel mailing list