[hatari-devel] Issues with CMake/CMakeLists.txt
Eero Tamminen
eerot at users.berlios.de
Tue Mar 16 22:08:42 CET 2010
Hi,
I finally tested CMake.
I removed check for glob() as it's not used anymore.
This checks seems also redundant as Python isn't needed for building:
----------
include(FindPythonInterp)
if(PYTHONINTERP_FOUND)
add_subdirectory(python-ui)
endif(PYTHONINTERP_FOUND)
-----------
Python is needed only when running the python scripts. When creating Hatari
packages, requiring Python to get e.g. hatariui installed is IMHO even wrong
thing to do (packages may be built on different machine than where they're
installed).
I think just this should be enough:
add_subdirectory(python-ui)
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)
With CMake I got these warnings:
/hatari/src/debug/breakcond.c:1083: warning: implicit declaration of
function ‘isblank’
/hatari/src/file.c: In function ‘File_Read’:
/hatari/src/file.c:193: warning: implicit declaration of function ‘gzopen64’
/hatari/src/file.c:193: warning: assignment makes pointer from integer
without a cast
/hatari/src/file.c:200: warning: implicit declaration of function ‘gzseek64’
/hatari/src/file.c:203: warning: implicit declaration of function ‘gztell64’
/hatari/src/file.c: In function ‘File_Save’:
/hatari/src/file.c:268: warning: assignment makes pointer from integer
without a cast
/hatari/src/memorySnapShot.c: In function ‘MemorySnapShot_fopen’:
/hatari/src/memorySnapShot.c:79: warning: implicit declaration of
function ‘gzopen64’
/hatari/src/memorySnapShot.c:79: warning: return makes pointer from integer
without a cast
As I don't get these with plain GNU make, either CMake (is including or
declaring different things than what gcc does by default.
For example isblank() manual page says:
Feature Test Macro Requirements for glibc (see feature_test_macros(7)):
isascii(): _BSD_SOURCE || _SVID_SOURCE || _XOPEN_SOURCE
isblank(): _XOPEN_SOURCE >= 600 || _ISOC99_SOURCE; or cc -std=c99
When I ran ccmake (cmake ncurses UI) and switched it to advanced mode,
I noticed that it at least turns assert()s off by default.
CMake defines SDL_LIBRARY as: /usr/lib/libSDLmain.a;/usr/lib/libSDL.so;-lpt
Whereas sdl-config produces:
$ sdl-config --libs
-L/usr/lib -lSDL
$ sdl-config --static-libs
-L/usr/lib -lSDL -lpthread
eero at AthlonXP:~/down/st/AHCC/packages.new$ sdl-config --cflags
-I/usr/include/SDL -D_GNU_SOURCE=1 -D_REENTRANT
Eventually build with CMake fails with:
make[2]: *** No rule to make target `../doc/hatari.1.gz', needed by
`doc/CMakeFiles/manpages'. Stop.
make[1]: *** [doc/CMakeFiles/manpages.dir/all] Error 2
make: *** [all] Error 2
- Eero
PS. In general CMake seems nice and it seems to have pretty extensive
documentation in its the Debian package.
More information about the hatari-devel
mailing list