davidrmiller / biosim4

Biological evolution simulator
Other
3.18k stars 453 forks source link

Added support for CMake and removed X11 dependency #34

Closed fvbakel closed 2 years ago

fvbakel commented 2 years ago

Added support for CMake and removed X11 dependency

Thank you for the nice program, I already had lots of fun with it. In this pull request I have added support for "CMake".

To simply the Cmake I also removed the dependency on X11 libs since there are not used anyway. I did this by:

#define cimg_display 
include "CImg.h"

Cmake allows you to maintain a single make and build mechanism and at the same time support all code IDE's. See for example : https://stackoverflow.com/questions/19686223/what-are-the-benefits-purposes-of-cmake

davidrmiller commented 2 years ago

How interesting to simplify the dependency. Thanks, I'll take a look.

davidrmiller commented 2 years ago

@fvbakel, Thanks for discovering that we don't need the X11 library dependency. I tested that locally by removing the X11 flag from the Makefile and applying your modification to src/imageWriter.cpp. It works great, and we'll definitely want to keep that improvement.

However, I have little experience with cmake. Would you be able to supply basic instructions for using it, perhaps in the form of modifications to the README.md file?

fvbakel commented 2 years ago

@davidrmiller Thanks for your reaction and removing the X11 dependency. I added some basic information for cmake in the README.md. I think that using CMake and further hands on are best learned by following the cmake helloworld and tutorial examples.

The main reason for adding CMake is that it allows for many different Integrated Development Environments (IDE's) by maintaining only one type of build file. You use for example Code blocks, I use Visual Code an other developer might use another IDE. The specific project files, like your .cbp file can be generated by Cmake or tools that support Cmake. I think it should be possible to add it to the Docker build too.