Page 1 of 1

CEGUI doesn't build

Posted: Thu May 05, 2016 22:09
by Gan
I followed the readme steps:
```bash
cd $cegui_folder
# you can call the folder differently but "build" is customary
mkdir build/
cd build/
# run the configure step
cmake-gui ../
# fix any issues pointed out by cmake
# not all dependencies are required so if some are not found, don't panic and carry on!
# alternative (if you are a command line pro)
# cmake ../
```

At this point, Makefiles, project files or something else will be generated. Next step depends on which that is.

For Makefiles, just run
```bash
cd $cegui_folder
cd build/
make
```


This is the command line output:
build Matt$ make
[ 79%] Built target CEGUIBase-0
[ 80%] Built target CEGUIExpatParser
[ 81%] Built target CEGUILibXMLParser
[ 82%] Building CXX object cegui/src/ImageCodecModules/SDL2/CMakeFiles/CEGUISDL2ImageCodec.dir/ImageCodec.cpp.o
/Users/Matt/Downloads/cegui-0.8.7/cegui/src/ImageCodecModules/SDL2/ImageCodec.cpp:40:10: fatal error:
'SDL2/SDL_image.h' file not found
#include <SDL2/SDL_image.h>
^
1 error generated.
make[2]: *** [cegui/src/ImageCodecModules/SDL2/CMakeFiles/CEGUISDL2ImageCodec.dir/ImageCodec.cpp.o] Error 1
make[1]: *** [cegui/src/ImageCodecModules/SDL2/CMakeFiles/CEGUISDL2ImageCodec.dir/all] Error 2
make: *** [all] Error 2


I installed SDL from the website. And I installed SDL_image. Still doesn't build.

Re: CEGUI doesn't build

Posted: Fri May 06, 2016 05:04
by YaronCT
Gan: This is a bug in cegui. I'll fix it soon.

Re: CEGUI doesn't build

Posted: Fri May 06, 2016 07:35
by YaronCT
Gan: I've pushed a fix. Plz update your cegui source from the cegui mercurial repository (branch v0-8).

Re: CEGUI doesn't build

Posted: Fri May 06, 2016 13:10
by lucebac
This is NOT a bug in CEGUI. You just have to install the SDL2 and SDL2_image package which can be found here:
https://www.libsdl.org/download-2.0.php
https://www.libsdl.org/projects/SDL_image/

If you already have, you might need to adjust the paths to the files in CMake if they are not in the standard paths (I don't know them for MacOSX, though, but there should definitely be some include directory on the disk somewhere)

Re: CEGUI doesn't build

Posted: Fri May 06, 2016 14:12
by YaronCT
lucebac: I'm afraid it was a bug in cegui (which is now fixed). From "FindSDL2.cmake":

# Note that the header path has changed from SDL2/SDL.h to just SDL.h
# This needed to change because "proper" SDL2 convention
# is #include "SDL.h", not <SDL2/SDL.h>. This is done for portability
# reasons because not all systems place things in SDL2/ (see FreeBSD).

Re: CEGUI doesn't build

Posted: Fri May 06, 2016 14:18
by lucebac
Then you need to change CMake to set appropriate defines whether SDL2 is in /SDL2/ or not. Ubuntu for example does put the files into a SDL2 subdirectory, so you broke the CEGUI build at least for ubuntu (ref: http://packages.ubuntu.com/yakkety/amd6 ... v/filelist). But I assume that only *BSD doesn't put SDL2 into a corresponding subdirectory.
Or add a fallback if /SDL2/ was not found. But the convention they proposed is pretty weird, since both SDL1 and SDL2 have the same paths to and names of their headers then but the API did completely change between those two versions. This makes things even worse.

Re: CEGUI doesn't build

Posted: Fri May 06, 2016 14:24
by YaronCT
lucebac: I didn't break systems like ubuntu that put the sdl headers in "/usr/include/SDL2" coz "FindSDL2.cmake" searches for SDL headers in various places, including "/usr/include/SDL2", and adds the found directory to the include path. Trust me, I'm on debian, and it works..

Re: CEGUI doesn't build

Posted: Fri May 06, 2016 14:28
by YaronCT
Now y SDL chose to make this mess is another question, but that's something u should ask them. I try to follow the official SDL instructions.