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
fltk-config needs improvements when created by CMake #129
Comments
@imaclmaca wrote in #115 (comment):
I believe it's both:
Note however that CMake uses some default debug and optimization switches to actually build Multi config builds (VS, Xcode) have another "special problem": since there are multiple configurations, |
About the situation on the macOS platform: The script BUILD/fltk-config created by cmake fails in my hands for 2 reasons :
My belief is that these 2 lines of BUILD/fltk-config should be rewritten as follows (and for my setup): That is, the two compiler paths should be extended with " -isysroot ${CMAKE_OSX_SYSROOT}" The same 2 errors apply to the other fltk-config script CMake generates, BUILD/bin/fltk-config |
@ManoloFLTK Thanks for your report. I'll take a look into the "-lfontconfig" issue. If it's not present in the build process (is it?) then it shouldn't be in fltk-config. Regarding
I believe that additional flags like |
@ManoloFLTK Can you edit your |
Regarding
Thanks, and I apologize if these questions sound unnecessary. I'm trying to understand the issue. |
I attach a patch that fixes both problems, at least in my hands : -lfontconfig must be removed because it means absolutey nothing under macOS. |
More details about fontconfig under macOS: I believe the solution is to run |
I'm not really happy with this solution (as shown in your patch) but I agree that we can live with it, at least for now, until we find a better solution. Please feel free to commit the fontconfig part of your patch, or let me know that I shall do it. I can do it later tonight or tomorrow. |
I'm not yet convinced that the
Both pages state that the behavior depends on environment variables, hence my next question: Are the mentioned environment variables The first page says:
If this is true (and it's very likely), then the build should work w/o adding the Both pages state:
IMHO the last sentence is questionable. Did you know that you should set any of these variables? Would other users know this? If they don't know, how can we do this in the FLTK CMake files? I don't know yet, this is something we need to find out. |
Note: although your patch works for you we need to separate two things:
We should not mix both, i.e. we should not modify CMake variables that influence the build to make changes in the generation of |
OK. I have committed the fontconfig part of my patch (at d944965). More details about the -isysroot option: A C/C++ compiler is installed on macOS (ignoring more exotic ways) in 2 ways, which can also co-exist:
With 1) compilers are called by a long path going inside the Xcode app, e.g.: With 2) the compiler is called with unix-like syntax: g++, or c++ With 2) the -isysroot option is not required. In my understanding, that's because 2) targets only one With 1) the -isysroot option is required because within a given Xcode can sit several distinct SDK versions, cmakes computes a default value of CMAKE_OSX_SYSROOT which is exactly what is needed for Environment variables SDKROOT and MACOSX_DEPLOYMENT_TARGET are not defined in my build environment. I will try to put myself in a 2) configuration and seek what cmake does in terms of -isysroot option. |
In situation 2) above, that is, using "Command Line Tools", the problems in fltk-config are the same. Cmake sets this as compiler paths in BUILD/fltk-config : cmake-gui shows the computed value of CMAKE_OSX_SYSROOT : but that value is not used in a -isysroot option within BUILD/fltk-config, In contrast, the configure-based building process sets this in file makeinclude: No -isysroot option is used either, but when the compiler is called that way, it does not require In summary, my understanding at that point is
|
Hi Manolo, thanks for your continuing tests and feedback. The information you provided is very helpful. AFAICT CMake always stores the compiler names as full paths to make sure they don't change in different build executions if users change their
If these commands don't reveal useful results, can you provide additional info? TIA |
% echo $PATH % which g++ % type g++ % file /usr/bin/g++ Other information: My understanding is that the 2 behaviours don't differ because of the compiler version but because % /usr/bin/g++ --version % /Library/Developer/CommandLineTools/usr/bin/c++ --version and as proven by these 3 compilation + link attempts: Attempt 1 produces no error: Attempt 2 fails : Attempt 3 runs OK These attempts differ by how the compiler is named and all lack the -isysroot XXX option. |
Here is a new proposal to have Cmake build fltk-config under macOS |
Thanks, patch looks basically good. Some comments and questions:
I don't understand version "16.9.0".
BTW: indenting is not correct and space after
Again, is this really always under condition Other than that the handling of |
Yes it does. I'm not sure if OPTION_APPLE_SDL is still alive. That's Mathias stuff related to the pico driver.
OK
Another numbering system is also present under macOS which is used in its Unix layer.
At least, it can be so in some cases, because it is in my case.
OK. I'll change that.
OK.
This if (APPLE) is itself in if (X11_Xft_FOUND AND OPTION_USE_PANGO) |
That new patch incorporates all changes mentionned above: |
That is unrelated to fltk-config, but to cmake under macOS: When OPTION_APPLE_X11 is ON , BUILD/config.h contains The cause is that statement at line #196 of CMake/options.cmake Any hint why that is so? |
@ManoloFLTK Patch Regarding
This is questionable and should probably be fixed. I suggest to add a debug statement after both of these statements like: I'd prefer I don't know why we have these two searches in different files, but some parts of this code are old and need refactoring anyway. HTH and good luck! |
PS: only an educated guess, but hopefully helpful: ISTR that you can't use the same CMake variable twice in searches because CMake caches the result and does not execute the second search if the variable is already cached. Note that Can you comment out the search in |
cmake-patch3.txt is now committed (1ace96e). |
Beautiful: that was it! |
The fix for cmake to find GLU when present under macOS + OPTION_APPLE_X11 is committed. |
We've seen that HAVE_GL_GLU_H is processed 1st in resources.cmake and 2nd in options.cmake What about doing it only once in options.cmake, as in this small patch ? |
Regarding (3): where is That said, does your patch work on macOS with |
For macOS + OPTION_APPLE_X11: For plain macOS, file glu.h is located in another, macOS-style, place that macro FindOpenGL discovers The patch works both with and without OPTION_APPLE_X11. |
Ooh, that's something I didn't know. Thanks for this info.
Then I'd say, go for it. |
The issue with GLU apps under macOS + OPTION_APPLE_X11 should be fixed with commit |
Hmm, just for curiosity and because I'd like to understand: can you explain why you chose another solution than in |
Because I tried again cmake-glu-patch.txt before committing it, and found it didn't work. The new commit uses unset(HAVE_GL_GLU_H CACHE) to forget that HAVE_GL_GLU_H had |
OK, thanks. Understood. Note to myself: we need an additional PATHS attribute/argument in |
Another note regarding fltk-config deficiencies: currently (c74a482) fltk-config doesn't seem to honor building the bundled image libs and produces wrong See this comment: #425 (comment). |
Reminder to myself: see also issue #639. |
Please add all your observations regarding
fltk-config
(created byCMake
) to this issue so we have a record andfltk-config
can be fixed.The text was updated successfully, but these errors were encountered: