Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[build] CMake support #176

Closed
Leinnan opened this issue Aug 9, 2016 · 17 comments
Closed

[build] CMake support #176

Leinnan opened this issue Aug 9, 2016 · 17 comments
Labels
enhancement This is an improvement of some feature help needed - please! I need help with this issue

Comments

@Leinnan
Copy link

Leinnan commented Aug 9, 2016

Any chance for cmake support? It would make developing on Linux much easier.

@raysan5
Copy link
Owner

raysan5 commented Aug 9, 2016

Hi @Leinnan, I'm not used to CMake... Someone created a CMakeList.txt, don't know if its ok...

@raysan5
Copy link
Owner

raysan5 commented Aug 9, 2016

Any help on this issue is highly appreciated!

@raysan5 raysan5 added enhancement This is an improvement of some feature help needed - please! I need help with this issue labels Aug 9, 2016
@raysan5 raysan5 assigned raysan5 and unassigned raysan5 Aug 9, 2016
@oskaritimperi
Copy link
Contributor

Hello! I've done some work with CMake and I've got an example of what I did with raylib here:

https://github.com/oswjk/raylib/tree/cmake
https://github.com/oswjk/rayskeleton

I took a liberty of not using the binaries bundled in the git repository (in my opinion, they do not belong there). So my approach was to download and build the dependencies with CMake.

I've tested this stuff on Xubuntu 16.04 (GCC) and Windows 10 (using MinGW) at the moment and all the dependency downloading and building seems to work fine. I need to create a little bit bigger skeleton to test all the audio stuff and other functionality so that they work also.

I'm not fully satisfied with my changes yet and there is probably some stuff missing also. If someone wants to adapt this, your welcome :-)

@Leinnan
Copy link
Author

Leinnan commented Sep 26, 2016

NICE! I will try check it out in two weeks because now I have to much work
with starting studying on university.

Can't wait to start working with Raylib :D

2016-09-26 20:46 GMT+02:00 Oskari Timperi [email protected]:

Hello! I've done some work with CMake and I've got an example of what I
did with raylib here:

https://github.com/oswjk/raylib/tree/cmake
https://github.com/oswjk/rayskeleton

I took a liberty of not using the binaries bundled in the git repository
(in my opinion, they do not belong there). So my approach was to download
and build the dependencies with CMake.

I've tested this stuff on Xubuntu 16.04 (GCC) and Windows 10 (using MinGW)
at the moment and all the dependency downloading and building seems to work
fine. I need to create a little bit bigger skeleton to test all the audio
stuff and other functionality so that they work also.

I'm not fully satisfied with my changes yet and there is probably some
stuff missing also. If someone wants to adapt this, your welcome :-)


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
#176 (comment), or mute
the thread
https://github.com/notifications/unsubscribe-auth/AMk8YwXDf3e7ZQaTqRUv6isMatUHU7Thks5quBL3gaJpZM4JghZi
.

@raysan5
Copy link
Owner

raysan5 commented Sep 26, 2016

Hi @oswjk! Thank you very much for this great addition!

Sorry, I'm not used to CMake build system... but I will try it, you can send me a pull-request if you want to integrate it into raylib develop branch.

In terms of build system, on raylib develop branch I just added support for shared library compilation (check Makefile) and VS2015 preconfigured projects. Adding support for CMake is great!

rayskeleton looks also very interesting! Don't know if I understand it correctly but it is a kind-of raylib-project CMake template ready to use, am I right?

@oskaritimperi
Copy link
Contributor

I'm not comfortable yet with integrating the CMake build system, as there are untested and missing things (RPi for example). I can test the RPi myself as I have one somewhere :-)

I'm also not yet fully satisfied with the bootstrapping part of my additions. I need to think about it a bit more, if I could make it better.

Rayskeleton is just that. A (hopefully) simple to use skeleton that you should be able to get up and running in no time. So basically you clone only the skeleton and the bootstrapping part takes care of downloading raylib and building it for you. The skeleton project uses my forked version of raylib, that contains the CMake build system.

@raysan5
Copy link
Owner

raysan5 commented Sep 28, 2016

Hey @oswjk, would it be possible to centralize all CMake compiling files into a cmake folder?

@oskaritimperi
Copy link
Contributor

It's certainly possible while not very idiomatic for CMake style. I'm refactoring the CMake support to be in one directory currently. We'll see where it goes. :-)

@pixelpicosean
Copy link

Do anyone know the Fips, a great CMake wrapper? CMake is IMHO too complex to use in such a situation(raylib designed for beginner and people who want to get start quickly), I'd highly recommend this awesome wrapper called Fips.

@raysan5
Copy link
Owner

raysan5 commented Oct 4, 2016

Hi @oswjk! Thank you very much for the effort! :)

Hey @pixelpicosean, I didn't know Fips... despite being simple to use, it implies adding a new (non-standard) tool and new dependencies (Python). As you stated, raylib is designed for complete beginners and people who want to get start quickly and not worry much about dependencies or code building. I also tried to simplify as much as possible the building system (plain Makefiles).

CMake is a good addition (despite not being that intuitive, at least for beginners) because is a standard code building tool (and very popular on Linux environments), I know lots of (average-advance) user will feel comfortable with it.

@raysan5
Copy link
Owner

raysan5 commented Nov 1, 2016

Hi @oswjk! What's the state of this feature? I'm planning to release a new raylib version in a couple of weeks and it would be great to include this addition (if possible). :)

@raysan5 raysan5 changed the title CMake support [build] CMake support Jan 18, 2017
@sanderboer
Copy link

fwiw, FIPS has some great features to aid in cross-platformness:
./fips setup android
./fips setup emscripten
take care of the hassle of setting up android and emscripten.

Fips is made by the same person that made Oryol.

@RDR8
Copy link
Contributor

RDR8 commented Apr 14, 2017

@jubalh
Copy link
Contributor

jubalh commented Jun 4, 2017

What do you guys think about using meson instead? It seems to be similar to write and maintain, also supports multiple platforms and seems to be pretty fast. Also it seems to be getting more and more popular.

Since writing Cmake is not always easy, and this issue is open for quite a time, maybe looking into meson would be an alternative. If you guys are okay with it I would try to look into it.

@jubalh
Copy link
Contributor

jubalh commented Jun 4, 2017

Actually meson is even nicer than I thought.
My work in progress is at:
https://github.com/jubalh/raylib/tree/meson

One can test with:

git clone https://github.com/jubalh/raylib/tree/meson
meson builddir
cd builddir
ninja
ninja install

So I only build Linux static/dynamic libs. If @raysan5 sais he is interested in switching to meson I would try to add the other systems so it has the same functionality like the current Makefile.

However I don't have any Windows machine so I hope someone can help testing there, once the meson file is finished.

One can already see that the meson file is much shorter, easier to read and extend. I strongly suggest switching.

Also implementing library versioning, for #293, would be much easier in meson that in a pure Makefile AFAIK.

@raysan5
Copy link
Owner

raysan5 commented Jun 4, 2017

Hey @jubalh! That's ok for me! Im not a big fan of CMake... in terms of building, just worked with Ant/NAnt in the past (for games building) and decided to stuck with plain Makefiles for raylib...

Lately I saw premake and it seemed interesting but I havent checked it yet. Don't know about meson with ninja, I've been investigating a bit and ninja looks great! :)

@raysan5
Copy link
Owner

raysan5 commented Jun 5, 2017

Just closing this issue, multi-platform building is being implemented in meson.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement This is an improvement of some feature help needed - please! I need help with this issue
Projects
None yet
Development

No branches or pull requests

7 participants