FLTK logo

STR #3471

FLTK matrix user chat room
(using Element browser app)   FLTK gitter user chat room   GitHub FLTK Project   FLTK News RSS Feed  
  FLTK Apps      FLTK Library      Forums      Links     Login 
 Home  |  Articles & FAQs  |  Bugs & Features  |  Documentation  |  Download  |  Screenshots  ]
 

Return to Bugs & Features | SVN ⇄ GIT ]

STR #3471

Application:FLTK Library
Status:1 - Closed w/Resolution
Priority:2 - Low, e.g. a documentation error or undocumented side-effect
Scope:3 - Applies to all machines and operating systems
Subsystem:Build Files
Summary:CMake improvements
Version:1.4-current
Created By:AlbrechtS
Assigned To:AlbrechtS
Fix Version:1.4.0
Fix Commit:63c54fe7c8eda4652ef81ab9a759e181ac48c5ee
Update Notification:

Receive EMails Don't Receive EMails

Trouble Report Files:

No files


Trouble Report Comments:


Name/Time/Date Text  
 
#1 AlbrechtS
02:19 May 09, 2018
This STR is meant as a reminder for myself. We need to improve CMake support. If anybody else wants to add to this to-do list, please feel free to do, but add one item per post (reply) so we can easily reference reply numbers.  
 
#2 AlbrechtS
02:28 May 09, 2018
# FLTKConfig.cmake - FLTK CMake configuration file for external projects.
#
# This file is generated by CMake and used to load FLTK's settings for an external project.
# It defines the following variables
#  FLTK_INCLUDE_DIRS - FLTK include directories
#  FLTK_LIBRARIES    - list of FLTK libraries built
#  FLTK_FLUID_EXECUTABLE needed by fltk_wrap_ui()
#  FLTK_USE_FILE - sets things up to use FLTK

set(FLTK_VERSION 1.4.0)

(a) Comment doesn't mention FLTK_VERSION (it should)
(b) Not all mentioned variables are set
(c) FLTK_USE_FILE is obsolete (deprecated) and should be removed

Current status (Linux):

FLTK_FLUID_EXECUTABLE    = ''
FLTK_INCLUDE_DIRS        = '/path/to/include/dirs' [OK]
FLTK_LIBRARIES           = ''
FLTK_USE_FILE            = [set, but deprecated]
FLTK_VERSION             = '1.4.0' [OK]
 
 
#3 AlbrechtS
02:47 May 09, 2018
We should consider to move FLTK's CMake support to "Modern CMake".

Modern CMake uses CMake "targets" and "properties" instead of CMake variables like FLTK_LIBRARIES (see #2).

Advantages (among others):

- much simpler user CMake code, i.e. for projects *using* FLTK
- user CMake code can be more "cross platform"
- this is considered current CMake standard

Drawback:

- requires higher minimum CMake version (3.x instead of 2.6.3)

Reasoning:

We have "cmake_minimum_required(VERSION 2.6.3)" for our main project and "cmake_minimum_required(VERSION 3.4.1)" for the Android port (work in progress). Although this is generally not a problem it would be good to have the same requirement for everything.

CMake folks discourage using such old versions as we (allow to) use (2.6.3). Although there are "CMake Policies" this is considered error prone. They recommend to update CMake files to at least 3.x, the higher the better.

CMake is generally easy to build (w/o any external requirements), Windows users can download latest binaries, and Visual Studio 2017 comes with built-in CMake support.

Note: CMake 3.5.0 was released in March 2016 (more than two years ago), current version is 3.11.1 (released Apr 04, 2018).
 
 
#4 AlbrechtS
21:49 Aug 06, 2018
"Modern" CMake implies that PUBLIC "linkage requirements" will be propagated from FLTK targets (the FLTK libraries) to user projects.

Constructs like those mentioned in STR #3469 should no longer be necessary in user projects built with CMake (i.e. projects _using_ the FLTK libraries):

#IF (WIN32)
  set (LIBS ${LIBS} comctl32.lib)
#ENDIF (WIN32)
 
 
#5 AlbrechtS
14:10 Jan 16, 2023
This STR will be handled in GitHub Issue #655: "CMake fixes".
https://github.com/fltk/fltk/issues/655
 
 
#6 AlbrechtS
08:41 Dec 03, 2023
Fixed in Git repository.

FTR: Most of this STR (things mentioned in comments above, particularly concerning FLTKConfig.cmake.in) has been resolved in commit 63c54fe7c8eda4652ef81ab9a759e181ac48c5ee.

Some other changes are still pending (solved in my local repo) but will be resolved by further moving to "modern CMake", see GitHub Issue #655 (link above).
 
     

Return to Bugs & Features ]

 
 

Comments are owned by the poster. All other content is copyright 1998-2024 by Bill Spitzak and others. This project is hosted by The FLTK Team. Please report site problems to 'erco@seriss.com'.