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

Eero Tamminen eerot at users.berlios.de
Fri Mar 19 22:12:10 CET 2010


Hi,

On Friday 19 March 2010, npomarede at corp.free.fr wrote:
> > Btw. How do I enabled showing of compiler options & flags with CMake?
>
> I use : VERBOSE=1 make
> but there might be other ways

Ok, I get these defines with normal Makefiles:
-DCONFDIR=\"/usr/local/etc\" -D_GNU_SOURCE=1 -D_REENTRANT -DHAVE_LIBPNG=1\
-DHAVE_X11=1   -DENABLE_DSP_EMU=1

And these with CMake:
-DCONFDIR=\"/etc\" -DNDEBUG -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64

Notes & Questions:
- HAVE_* stuff is with CMake in config.h which is fine, but
- Why CONFDIR is /etc?
- CMake doesn't define "_LARGEFILE64_SOURCE", only "_LARGEFILE_SOURCE"
  -> which is the thing that bugs zlib.h


> >>> CMake defines SDL_LIBRARY
> >>> as: /usr/lib/libSDLmain.a;/usr/lib/libSDL.so;-lpt
> >>
> >> 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.
>
> From what I see, /usr/share/cmake/Modules/FindSDL.cmake is looking in a
> set of predefined dirs, but doesn't use sdl-config, so this may break on
> setup where sdl is not in one of this dir (you can set SDLDIR in that
> case, I had to do this for crosscompiling hatari under linux)

Hm.  If it finds sdl-config, IMHO it should use it.


> > $ cmake --version
> > cmake version 2.6-patch 0
>
> I'm using 2.8

As to using a CMake debug build to get asserts, that doesn't optimize
code and therefore doesn't get build time warnings so it's about useless.

Then there's RELWITHDEBINFO which uses -g && -O2, but that doesn't
enable asserts either.

GNU stuff uses -g -O2 which is a good default.  Stripping is done when
SW is installed/packaged, not when it's built.


	- Eero



More information about the hatari-devel mailing list