-
-
Notifications
You must be signed in to change notification settings - Fork 46
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
Add CMake build #333
base: master
Are you sure you want to change the base?
Add CMake build #333
Conversation
Thanks!, it looks good overall. I'll take a closer look when I find some About FLTK 1.4, it is not working well just yet, so we will need to find a way Have you had a chance to test cross-compilation? Is one of the reasons I wanted |
Cross-compilation works, this jobs compiles from linxu x86-64 to aarch64: Regarding FLTK 1.3, I think I can add a cmake script which manually tries to find the libraries since the FindFLTK.cmake that's distributed with CMake seems broken on some systems. Making cross-compilation work with that might be more difficult. |
Thanks!, that's nice.
Here is the FindFLTK module: https://gitlab.kitware.com/cmake/cmake/-/raw/master/Modules/FindFLTK.cmake In my current system (Arch Linux with FLTK 1.3.9) using:
It is also failing if I set the
As it is trying to load the CMakeCache, but it is not distributed in the fltk Not setting
But there is no targets defined for FLTK 1.3 so using fltk::fltk fails. This Trying to locate the libraries by hand and making our own fltk::fltk target is |
I've replaced fltk::fltk with ${DILLO_FLTK_LIBS} and used that across the modules. The build is green currently on all platforms. It still remains quite fragile. FLTK itself directs devs to use The only job that uses FLTK 1.4 is the cross-compilation one. To use FLTK 1.4, devs would have to pass |
Thanks, I don't think we can rely on CONFIG as you comment. However, it would be nice to complain if FLTK is 1.4 (unless explicitly told so) as it will cause rendering issues even if it builds fine. As long as we have a way to pass the installation path (libs and headers) of FLTK (avoiding fltk-config) I think that would be enough for cross-compilation. Rebasing over a882875 will likely fix the CI. |
exclude config.h.in in gitignore try fltk 1.3 try again try again some cmake fixes for FLTK 1.3\ remove make test for the time being skip looking for fluid use fetch content fix build use find_package(PkgConfig REQUIRED) for webp fix build on macos remove windows for now fixes fixes fetch git for cygwin fix for cygwin define HAVE_TRUNC for cygwin try webp on cygwin use pkg-config for webp try finding webp on macos try /usr/local/opt/webp/lib on macos try crosscompilation download gl libs for crosscompiling check try with FLTK 1.3 for FLTK 1.3, use plain find_package try again for macos fixes support older cmake build for macos fix cmake.yml debug DILLO_FLTK_INCLUDE_DIRS debug FLTK_INCLUDE_DIRS on macos fix build on macos remove DNDEBUG flag when building for Release link windows libs for fltk 1.3 targeting msvc or mingw Update cmake.yml add warning when building against FLTK 1.4
I've added a warning in the CMake script when targeting FLTK 1.4 (targeting of which already requires a feature flag ENABLE_FLTK_1_4). I've also squashed and rebased. |
I still highly recommend meson as the alternative bulid system when compared to CMake for maintainability, readability, (etc). #263 is effectively complete, pending only a rebase. @rodarima will you consider that as an alternative? I'm also happy to maintain it side-by-side with CMake if that is desirable, but either is better than Autotools. |
As an aside, this CMake port seems to be done pretty well, my biggest gripe being that it's, well, CMake. My only feedback is that you need EOF newlines on most of the new files. |
I’m fine with either build generators. Both are cross-platform, can generate compile_commands.json (for extra tooling), and support cross-compilation. |
Hello @rodarima
This PR adds a CMake build to dillo.
It by default uses FLTK 1.4. I tried getting FLTK 1.3 to work with CMake but unfortunately the distro-packaged FindFLTK.cmake or FLTKConfig.cmake are broken in some form for 1.3 on several systems like alpine, cygwin, freebsd and macos!
The CMakeLists.txt tries
find_package(FLTK 1.4 CONFIG)
and if it can't, it fetches the sources and builds FLTK. The CI actions do that, however when FLTK 1.4 is already installed, it finds it without issues. The PR also contains a.github/workfows/cmake.yml
.Once FLTK 1.4 is packaged for debian/ubuntu, I plan to modify the script and remove the FetchContent part.
There are many small commits which attempt to fix the CI, these can be squashed if you choose to merge the PR.