cmake module for FLTK broken

Bug #1519964 reported by Israel Dahl
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
fltk1.3 (Debian)
Fix Released
Unknown
fltk1.3 (Ubuntu)
Fix Released
Medium
Unassigned

Bug Description

Ubuntu Xenial (a.k.a. development release)
cmake 3.3.2is3.2.2-0ubuntu2
I expect the FLTK module in cmake to:
a) not require fluid when I specifically set(FLTK_SKIP_FLUID True)
This is not the case. I get an error saying cmake cannot find fluid. So I add it to the BuildDepends (control file).
It still cannot find it (why is it looking anyway??)
so I
IF(NOT EXISTS ${FLTK_FLUID_EXECUTABLE})
    # Try to detect full path anyway
    EXECUTE_PROCESS(COMMAND which fluid OUTPUT_VARIABLE FLTK_FLUID_EXECUTABLE OUTPUT_STRIP_TRAILING_WHITESPACE)
    IF(NOT EXISTS ${FLTK_FLUID_EXECUTABLE})
        MESSAGE(FATAL_ERROR "Please install the fluid binary which is part of FLTK.")
    ENDIF()
ENDIF()

Great... now it cannot find "${FLTK_INCLUDE_DIR}"
I hack that.
Now I get this:
Could NOT find FLTK (missing: FLTK_INCLUDE_DIR)
Call Stack (most recent call first):
  /usr/share/cmake-3.2/Modules/FindPackageHandleStandardArgs.cmake:374 (_FPHSA_FAILURE_MESSAGE)
  /usr/share/cmake-3.2/Modules/FindFLTK.cmake:318 (FIND_PACKAGE_HANDLE_STANDARD_ARGS)
  CMakeLists.txt:11 (FIND_PACKAGE)

Does this module work for anything at all?
This s rather frustrating :(

I have tried using
FIND_PACKAGE(FLTK REQUIRED)
and
FIND_PACKAGE(FLTK REQUIRED NO_MODULE) ## this worked in 12.04 and 14.04 just fine.. found everything with some hacking

Please fix this....

The issue seems to be that
/usr/lib/fltk/FLTKConfig.cmake
does not look like this
#
# FLTKConfig.cmake - FLTK CMake configuration file for external projects.
#
# This file is configured by FLTK and used by the UseFLTK.cmake module
# to load FLTK's settings for an external project.

set(FLTK_FOUND TRUE)
set(FLTK_VERSION 1.3.0)

set(FLTK_FLUID_EXECUTABLE "/usr/bin/fluid")

set(FLTK_USE_FILE "/usr/lib/fltk/UseFLTK.cmake")

set(FLTK_DIR "/usr/lib/fltk")

set(FLTK_BIN_DIR "/usr/bin")
set(FLTK_LIB_DIR "/usr/lib/x86_64-linux-gnu")
set(FLTK_INCLUDE_DIR "/usr/include")
set(FLTK_DATA_DIR "/usr/share/fltk")
set(FLTK_DOC_DIR "/usr/share/doc/fltk1.3-doc")

set(FLTK_SHARED_LIBS_FOUND ON)
set(FLTK_CAIRO_FOUND TRUE)
set(FLTK_GL_FOUND TRUE)
set(FLTK_THREADS_FOUND TRUE)
set(FLTK_PTHREADS_FOUND TRUE)
set(FLTK_BUILTIN_JPEG_FOUND FALSE)
set(FLTK_BUILTIN_ZLIB_FOUND FALSE)
set(FLTK_BUILTIN_PNG_FOUND FALSE)
set(FLTK_XINERAMA_FOUND TRUE)
set(FLTK_XFT_FOUND TRUE)
set(FLTK_XDBE_FOUND TRUE)

include("/usr/lib/fltk/FLTKLibraries.cmake")

Here is an example of the problems in other programs (and where I got the above file)
https://github.com/LMMS/lmms/issues/2260

ProblemType: Bug
DistroRelease: Ubuntu 16.04
Package: cmake 3.3.2is3.2.2-0ubuntu2
ProcVersionSignature: Ubuntu 4.2.0-19.23-lowlatency 4.2.6
Uname: Linux 4.2.0-19-lowlatency x86_64
NonfreeKernelModules: nvidia
ApportVersion: 2.19.2-0ubuntu6
Architecture: amd64
CurrentDesktop: ToriOS
Date: Wed Nov 25 14:50:57 2015
InstallationDate: Installed on 2014-11-07 (383 days ago)
InstallationMedia: Ubuntu 14.04.1 LTS "Trusty Tahr" - Release amd64+mac (20140722.2)
SourcePackage: cmake
UpgradeStatus: Upgraded to xenial on 2015-11-18 (7 days ago)

Revision history for this message
Israel Dahl (israeldahl) wrote :
Revision history for this message
Gianfranco Costamagna (costamagnagianfranco) wrote :

Hi, can you please check the shiny new 3.5.1 in xenial?
thanks

Changed in cmake (Ubuntu):
status: New → Incomplete
Revision history for this message
Launchpad Janitor (janitor) wrote :

[Expired for cmake (Ubuntu) because there has been no activity for 60 days.]

Changed in cmake (Ubuntu):
status: Incomplete → Expired
Revision history for this message
Martin (martinsimon88) wrote :

This is a problem still. When trying to install OpenVSP, fluid continues to give the same problem as described above.
Please fix this.
Thanks!

Changed in cmake (Ubuntu):
status: Expired → New
status: New → Confirmed
affects: cmake (Ubuntu) → fltk1.3 (Ubuntu)
Revision history for this message
Gianfranco Costamagna (costamagnagianfranco) wrote :

reproducible with this CMakeLists.txt
cmake_minimum_required(VERSION 3.5)
set(FLTK_SKIP_FLUID TRUE)
find_package(FLTK)

fix is adding some if statements to /usr/lib/fltk fixes the issue
diff --git a/FLTK-Targets-noconfig.cmake b/FLTK-Targets-noconfig.cmake
index da80013..76d4aca 100644
--- a/FLTK-Targets-noconfig.cmake
+++ b/FLTK-Targets-noconfig.cmake
@@ -38,6 +38,7 @@ set_target_properties(fltk_cairo PROPERTIES
 list(APPEND _IMPORT_CHECK_TARGETS fltk_cairo )
 list(APPEND _IMPORT_CHECK_FILES_FOR_fltk_cairo "${_IMPORT_PREFIX}/lib/x86_64-linux-gnu/libfltk_cairo.so" )

+if(NOT FLTK_SKIP_FLUID)
 # Import target "fluid" for configuration ""
 set_property(TARGET fluid APPEND PROPERTY IMPORTED_CONFIGURATIONS NOCONFIG)
 set_target_properties(fluid PROPERTIES
@@ -46,6 +47,7 @@ set_target_properties(fluid PROPERTIES

 list(APPEND _IMPORT_CHECK_TARGETS fluid )
 list(APPEND _IMPORT_CHECK_FILES_FOR_fluid "${_IMPORT_PREFIX}/bin/fluid" )
+endif()

 # Import target "fltk_STATIC" for configuration ""
 set_property(TARGET fltk_STATIC APPEND PROPERTY IMPORTED_CONFIGURATIONS NOCONFIG)
diff --git a/FLTK-Targets.cmake b/FLTK-Targets.cmake
index 95d6199..8d51f8d 100644
--- a/FLTK-Targets.cmake
+++ b/FLTK-Targets.cmake
@@ -58,8 +58,10 @@ add_library(fltk_cairo_STATIC STATIC IMPORTED)
 # Create imported target fltk_cairo_SHARED
 add_library(fltk_cairo_SHARED SHARED IMPORTED)

+if(NOT FLTK_SKIP_FLUID)
 # Create imported target fluid
 add_executable(fluid IMPORTED)
+endif()

 # Create imported target fltk
 add_library(fltk_STATIC STATIC IMPORTED)
--

Revision history for this message
Gianfranco Costamagna (costamagnagianfranco) wrote :

lets see if Debian fixes the issue

Changed in fltk1.3 (Ubuntu):
importance: Undecided → Medium
Revision history for this message
Gianfranco Costamagna (costamagnagianfranco) wrote :

fixed in upcoming 1.3.4-3 (zesty)

Changed in fltk1.3 (Ubuntu):
status: Confirmed → Fix Released
Changed in fltk1.3 (Debian):
status: Unknown → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.