MantisBT - CMake
View Issue Details
0007809CMakeModulespublic2008-10-13 20:062009-02-23 22:42
Rodolfo Schulz de Lima 
Philip Lowman 
normalminoralways
closedfixed 
CMake-2-6 
CMake-2-6 
0007809: [patch] FLTK isn't detected on Gentoo
Gentoo installs FLTK's header files in /usr/include/fltk-1.1 and its libraries in /usr/lib/fltk-1.1. The current FindFLTK fails to detected it.
I've modified FindFLTK.cmake to use fltk-config whenever the current algorithm fails to detect the required files. It works for me on Gentoo.
No tags attached.
diff fix_fltk_detection.diff (1,701) 2008-10-13 20:06
https://public.kitware.com/Bug/file/1768/fix_fltk_detection.diff
patch fix_fltk_trim_inc_dir.patch (296) 2009-01-22 20:15
https://public.kitware.com/Bug/file/2014/fix_fltk_trim_inc_dir.patch
Issue History
2008-10-13 20:06Rodolfo Schulz de LimaNew Issue
2008-10-13 20:06Rodolfo Schulz de LimaFile Added: fix_fltk_detection.diff
2008-11-19 15:03Rodolfo Schulz de LimaNote Added: 0014136
2009-01-20 23:44Philip LowmanStatusnew => assigned
2009-01-20 23:44Philip LowmanAssigned To => Philip Lowman
2009-01-21 23:55Philip LowmanNote Added: 0014658
2009-01-21 23:55Philip LowmanResolutionopen => fixed
2009-01-22 17:53Rodolfo Schulz de LimaNote Added: 0014669
2009-01-22 18:33Rodolfo Schulz de LimaNote Deleted: 0014669
2009-01-22 20:14Rodolfo Schulz de LimaNote Added: 0014672
2009-01-22 20:15Rodolfo Schulz de LimaFile Added: fix_fltk_trim_inc_dir.patch
2009-01-23 00:35Philip LowmanNote Added: 0014673
2009-01-27 01:06Philip LowmanStatusassigned => resolved
2009-02-23 22:42Philip LowmanNote Added: 0015305
2009-02-23 22:42Philip LowmanStatusresolved => closed
2009-02-23 22:42Philip LowmanFixed in Version => CMake-2-6

Notes
(0014136)
Rodolfo Schulz de Lima   
2008-11-19 15:03   
Any feedback on this?
(0014658)
Philip Lowman   
2009-01-21 23:55   
Thanks for the bug report and patch!

I committed your patch with a few minor tweaks.
* Made OpenGL optional
* The fltk-config detected stuff now gets added to the search paths instead of being assigned directly
* Stripped -D defines from fltk-config --cxxflags

Testing would be appreciated if you have the time.

lowman@locke:~/cvs/CMake_write/Modules$ cvs commit FindFLTK.cmake
Committer: Philip Lowman <philip@yhbt.com>
/cvsroot/CMake/CMake/Modules/FindFLTK.cmake,v <-- FindFLTK.cmake
new revision: 1.39; previous revision: 1.38

(0014672)
Rodolfo Schulz de Lima   
2009-01-22 20:14   
Doesn't work yet, the _FLTK_POSSIBLE_INCLUDE_DIRS variable should have its leading spaces removed (as it occurs on my system).

I've attached a little patch to correct this. With it applied, FindFLTK works fine.

While we're at it, wouldn't it be better to get the include paths from fltk-config output using:

STRING(REGEX MATCHALL "-I[^ ]*" _FLTK_POSSIBLE_INCLUDE_DIRS ${FLTK_CXXFLAGS})
STRING(REPLACE ";" " " _FLTK_POSSIBLE_INCLUDE_DIRS "${_FLTK_POSSIBLE_INCLUDE_DIRS}")
STRING(REPLACE "-I" "" _FLTK_POSSIBLE_INCLUDE_DIRS "${_FLTK_POSSIBLE_INCLUDE_DIRS}")

? IMHO it's more resilient to other switches that might be present in FLTK_CXXFLAGS (apart the -D ones you already took care of). The only issue with above solution is if there are spaces in the include path (windows?), but a better regexp could be used.
(0014673)
Philip Lowman   
2009-01-23 00:35   
lowman@locke:~/cvs/CMake_write/Modules$ cvs commit FindFLTK.cmake
Committer: Philip Lowman <philip@yhbt.com>
/cvsroot/CMake/CMake/Modules/FindFLTK.cmake,v <-- FindFLTK.cmake
new revision: 1.40; previous revision: 1.39

Thanks, that does work much better. I didn't like removing the ";" though because I wanted a list of possible includes not a string with spaces. I left the STRIP in there for good measure although I think it may be superfluous now.

I'm fine with the limitation of no spaces in filenames.

Also, I added some control variables to allow more control over FLTK_FOUND and FLTK_LIBRARIES.
(0015305)
Philip Lowman   
2009-02-23 22:42   
Thanks for the help with this, fix available in 2.6.3