Closed yurivict closed 11 months ago
Happy new year @yurivict ! :tada:
We are still stuck with FLTK 1.3.4 in our build workflow: that could be the reason why we don't get such error. I'll update FLTK to the latest version for Giada v.0.20 and report back.
This is pretty easy to fix, just follow the documented procedure. The following simple patch allows the program to find and correctly link FLTK (supposedly any version).
@@ -307,9 +307,8 @@ endif()
set(FLTK_SKIP_FLUID TRUE) # Don't search for FLTK's fluid
set(FLTK_SKIP_OPENGL TRUE) # Don't search for FLTK's OpenGL
-find_package(FLTK CONFIG REQUIRED)
-list(APPEND LIBRARIES fltk fltk_gl fltk_forms fltk_images)
-message("FLTK library found in " ${FLTK_DIR})
+find_package(FLTK REQUIRED)
+list(APPEND LIBRARIES ${FLTK_LIBRARIES})
@danfe your patch works, but the official FLTK documentation from version 1.3.8 suggests the following:
find_package(FLTK REQUIRED NO_MODULE)
list(APPEND LIBRARIES fltk)
list(APPEND INCLUDE_DIRS ${FLTK_INCLUDE_DIRS})
but the official FLTK documentation from version 1.3.8 suggests the following
Any (working) approach is okay so long as it does not use FLTKConfig.cmake
and friends, but just the CMake glue.
Fixed in 67bab1865cc340f5df556016542e05b821677915. @yurivict does it work for you?
0.20.0 still has this problem.
@yurivict in 0.20.0
we follow the official instructions coming from the FLTK documentation. Maybe there's something wrong with their CMake script?
@yurivict any feedback on this?
I think it would be best if giada would be able to find FLTK even if FLTK wouldn't have cmake files installed. cmake officially supplies FLTK-discovering macros:
$ pkg info -l cmake | grep -i fltk | grep "\.cmake"
/usr/local/share/cmake/Modules/FLTKCompatibility.cmake
/usr/local/share/cmake/Modules/FindFLTK.cmake
/usr/local/share/cmake/Modules/FindFLTK2.cmake
@yurivict but as far as I understand that's exactly the deprecated approach @danfe warned against?
No, @danfe for some reason doesn't want to add cmake files to FLTK package ans asks to support both ways to detect FLTK.
OK so I'm officially lost at this point. @yurivict please feel free to submit a patch/PR that fixes the problem you are describing. I'm moving this issue to 1.0 milestone.
I understand that's exactly the deprecated approach @danfe warned against?
There's nothing deprecated about using CMake native scripts, where did I warn against it?
No, @danfe for some reason doesn't want to add cmake files to FLTK package ans asks to support both ways to detect FLTK.
Well, the reasons are rather sound to me: it would break certain things and that would require additional fixing, including generated CMake files themselves (e.g. $WRKSRC
gets embedded in them), for no real benefits. CMake provides full support for locating FLTK bits by itself.
OK so I'm officially lost at this point.
I've provided working variant in the earlier comment. I might pull the current code and adjust my patch, but there really should not be anything hard about it.
I might pull the current code and adjust my patch [...]
A PR would be very welcome.
Follow-up: currently we are fetching FLTK via CMake's fetch content, so this issue should not be relevant anymore - at least until we switch back to the original method, when FLTK 1.4 will be out. Closing for now.
Environment
Describe the bug
cmake-3.22.1 has files to find FLTK:
but giada still fails to find it.
fltk-1.3.8