source: fltk1.3
version: 1.3.4-2
tags: patch

Hello, as said on launchpad bug, there is an error when fluid is not installed

steps to reproduce:
$ cat CMakeLists.txt
cmake_minimum_required(VERSION 3.5)
set(FLTK_SKIP_FLUID TRUE)
find_package(FLTK)


remove fluid from the system (FLTK_SKIP_FLUID is mentioned in the 
FindFLTK.cmake module)

error

CMake Error at /usr/lib/fltk/FLTK-Targets.cmake:102 (message):
The imported target "fluid" references the file

"/usr/bin/fluid"

but this file does not exist.  Possible reasons include:

* The file was deleted, renamed, or moved to another location.

* An install or uninstall procedure did not complete successfully.

* The installation package was faulty and contained

"/usr/lib/fltk/FLTK-Targets.cmake"

but not all the files it references.

Call Stack (most recent call first):
/usr/lib/fltk/FLTKConfig.cmake:13 (include)
/usr/share/cmake-3.5/Modules/FindFLTK.cmake:146 (include)
CMakeLists.txt:3 (find_package)


the following patch on usr/lib/fltk works:
--- 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 044859d..278145b 100644
--- a/FLTK-Targets.cmake
+++ b/FLTK-Targets.cmake
@@ -55,8 +55,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)


should be easily applicable to the source code too

[1] https://bugs.launchpad.net/ubuntu/+source/fltk1.3/+bug/1519964

thanks for considering it,

Gianfranco

Reply via email to