| [ Return to Bugs & Features | Post Text | Post File | SVN ⇄ GIT | Prev | Next ]
STR #3415
Application: | FLTK Library |
Status: | 3 - Active |
Priority: | 3 - Moderate, e.g. unable to compile the software |
Scope: | 2 - Specific to an operating system |
Subsystem: | Build Files |
Summary: | CMake: Programs may need some definitions from FLTK to work correctly |
Version: | 1.4.0 |
Created By: | taeril |
Assigned To: | AlbrechtS |
Fix Version: | Unassigned |
Update Notification: | |
Trouble Report Files:
[ Post File ]
Trouble Report Comments:
[ Post Text ]
|
#1 | taeril 07:02 Oct 08, 2017 |
| I was playing with fl_filename_isdir to see how it work and my code was based on usage inside FLTK. Just list files and print names, but while I got correct number of entries there was no names! It was cmake build for Linux. More curious same code crosscompiled for windows run OK printing names as expected. Even more interesting slimed down code to report one file compiled by fltk-config worked OK.
As it turns out I need one of: -D_THREAD_SAFE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE to make it work.
I don't see how I can get those in cmake build so with small change:
diff --git a/CMake/FLTKConfig.cmake.in b/CMake/FLTKConfig.cmake.in index baa25a6..62c8af5 100644 --- a/CMake/FLTKConfig.cmake.in +++ b/CMake/FLTKConfig.cmake.in @@ -13,4 +13,5 @@ set(FLTK_VERSION @FLTK_VERSION_FULL@) include(${CMAKE_CURRENT_LIST_DIR}/FLTK-Targets.cmake)
set(FLTK_INCLUDE_DIRS "@INCLUDE_DIRS@") +set(FLTK_DEFINITIONS "@FLTK_CFLAGS@") set(FLTK_USE_FILE ${CMAKE_CURRENT_LIST_DIR}/UseFLTK.cmake)
I can in my CMakeLists.txt use add_definitions(${FLTK_DEFINITIONS}) and have program working correctly.
Above is what I sent to mailing list some time ago. Attached patch highlights additionally two places documenting that added line, but maybe there is more to say about it?
Tested on Linux with current svn version r12482 | |
|
#2 | taeril 07:12 Oct 08, 2017 |
| I've added simple program showing error. Compiling with cmake shows only numbers - no filenames. Using fltk-config - all is OK. CMakeLists.txt have add_definitions utilizing changes from my patch.
Additionally target_includes_and_definitions.diff make cmake automatically add definitions and include directories making calls to include_directories and add_definitions unnecessary.
https://cmake.org/cmake/help/v2.8.11/cmake.html#section_Commands Based on online documentation 2.8.11 is first version with needed functionality, but I tested it only with cmake 3.9.1 | |
|
#3 | AlbrechtS 08:25 Oct 13, 2017 |
| Thanks for the report and the patches. Our CMake support files are not yet complete, so this will be one step forward.
The patches look good at a first glance. I'll take a closer look later when time permits.
Note: changed subject (aka "Summary") to mark the STR with CMake. | |
[ Return to Bugs & Features | Post Text | Post File ]
|
| |