|
|
On 4/27/21 6:07 PM Rob McDonald wrote:
On Monday, April 26, 2021 at 3:46:19 PM UTC-7 Albrecht Schlosser wrote:
The only relevant changes you should expect compared to 1.3.5 are the
renamed macOS framework and the new "backwards compatible" setting of
FLTK_INCLUDE_DIR in *CONFIG* mode as you expect in your app (at least
that's what I remember).
...
Thanks for the clarification.
Running FindPackage(FLTK CONFIG) and then printing out the expected
variables, I get...
-- FLTK_FOUND 1
-- FLTK_INCLUDE_DIR /Users/.../FLTK-prefix/include
-- FLTK_INCLUDE_DIRS /Users/.../FLTK-prefix/include
-- FLTK_LIBRARIES
-- FLTK_FLUID_EXECUTABLE fluid
-- FLTK_WRAP_UI
So, it appears that FLTK_LIBRARIES is not being set.
Yes, that's obviously the case, but that's one of the points I could not
address now (see also my note above: "The only relevant changes you
should expect..."). The reason is that this would have needed more
changes than I could do in this release. It may look simple to set these
variables, but please trust me, it's not if you want to do it right.
Also, I have great skepticism about FLTK_FLUID_EXECUTABLE here.
I would expect it to provide a fully qualified path to fluid
rather than just the executable name.
It's neither a full path nor "just the executable name", it's a CMake
"target" (or at least it should be).
if(TARGET fluid)
message(STATUS "fluid is a target")
endif()
should show you that.
What's the difference? Let me say, it's the difference between "old" and
"modern" CMake. Historically you would name libraries and executables
and, if in question, provide full paths in CMake variables. In "modern"
CMake you use CMake targets in your app build rather than library names.
CMake targets can have lots of attributes, for instance the "location"
but also "usage requirements".
The existing FLTKConfig.cmake is in parts "modern CMake" because it
returns CMake targets. The old FindFLTK.cmake returns "variables" instead.
I know this may not be very helpful, but if you look at our
README.CMake.txt with that in mind you may notice the difference.
"The CMake Export/Import facility can be thought of as an automated
fltk-config. For example, if you link your program to the FLTK library,
it will automatically link in all of its dependencies. ..."
What this means is: IF you are using the NO_MODULE (or CONFIG) approach,
THEN you don't need to take care of all "FLTK_LIBRARIES" because they
will be included by the named target, which are (unfortunately) named
only in a sentence at the end of the instructions. These targets are:
fltk, fltk_gl, fltk_images, fltk_forms, and fluid
I know your situation where you /need/ to use the "old" FindFLTK.cmake
in some cases (particularly if the installed FLTK libs were not built
with CMake) and you /may/ use the "new" CONFIG mode if the FLTK libs
were built with CMake. Unfortunately I don't have a solution for this
dilemma yet, but I hope that a future FindFLTK.cmake can resolve this issue.
(As written before, you may want to use CONFIG mode first to see if you
can find FLTK and MODULE mode if not, but that has other drawbacks.)
Also, note no success message 'Found FLTK:' is printed.
I don't know where this message comes from (find_package() or
FindFLTK.cmake?) but I'll check that for my future development.
When I run without CONFIG set, I get.....
-- Found FLTK:
/Users/.../FLTK-prefix/lib/libfltk_images.a;/Users/.../FLTK-prefix/lib/libfltk_forms.a;/Users/.../FLTK-prefix/lib/libfltk_gl.a;/Library/Developer/CommandLineTools/SDKs/MacOSX11.1.sdk/System/Library/Frameworks/OpenGL.framework;/Users/.../FLTK-prefix/fltk.framework
-- FLTK_FOUND TRUE
-- FLTK_INCLUDE_DIR
/Users/.../FLTK-prefix/include/Library/Developer/CommandLineTools/SDKs/MacOSX11.1.sdk/System/Library/Frameworks/OpenGL.framework
-- FLTK_INCLUDE_DIRS
-- FLTK_LIBRARIES -framework Carbon -framework Cocoa -framework
ApplicationServices
BTW: I think from the line above you only really need "-framework Cocoa".
-lz/Users/.../FLTK-prefix/lib/libfltk_images.a/Users/.../FLTK-prefix/lib/libfltk_forms.a/Users/.../FLTK-prefix/lib/libfltk_gl.a/Library/Developer/CommandLineTools/SDKs/MacOSX11.1.sdk/System/Library/Frameworks/OpenGL.framework/Users/.../FLTK-prefix/fltk.framework
-- FLTK_FLUID_EXECUTABLE
/Users/.../FLTK-prefix/bin/fluid.app/Contents/MacOS/fluid
-- FLTK_WRAP_UI 1
It more or less behaves as expected. Except as discussed before the
issue I don't understand about the fltk.framework path that doesn't work
properly.
I have no direct recommendation for you here. Maybe stick to the old
find_package() with your build system. I don't know what to do with the
macOS framework issue.
--
You received this message because you are subscribed to the Google Groups "fltk.coredev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to fltkcoredev+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/fltkcoredev/20b55c52-c629-7990-a764-d9527fbc6147%40online.de.
[ Direct Link to Message ] | |
|
| |