Hello again:
This is an example of cmake test file that might help in the future detecting
such issues:
(stolen and adapted from mrpt)
cat ../CMakeLists.txt
cmake_minimum_required(VERSION 3.16)
project(test)
find_package(LibFTDI1)
message("Include directories: " ${LIBFTDI_INCLUDE_DIRS})
message("Link directories: " ${LIBFTDI_LIBRARY_DIRS})
message("Libraries: " ${LIBFTDI_LIBRARIES})
add_library(imp_ftdi INTERFACE IMPORTED)
set_target_properties(imp_ftdi
PROPERTIES
INTERFACE_INCLUDE_DIRECTORIES "${LIBFTDI_INCLUDE_DIRS}"
INTERFACE_LINK_DIRECTORIES "${LIBFTDI_LIBRARY_DIRS}"
INTERFACE_LINK_LIBRARIES "${LIBFTDI_LIBRARIES}"
)
add_executable(main main.c)
target_link_libraries(main PRIVATE imp_ftdi)
$ cmake ..
Include directories: /usr/include/libftdi1
Link directories: lib/x86_64-linux-gnu
Libraries: ftdi1/usr/lib/x86_64-linux-gnu/libusb-1.0.so
-- Configuring done
CMake Error in CMakeLists.txt:
Target "imp_ftdi" contains relative path in its INTERFACE_LINK_DIRECTORIES:
"lib/x86_64-linux-gnu"
CMake Error in CMakeLists.txt:
Target "imp_ftdi" contains relative path in its INTERFACE_LINK_DIRECTORIES:
"lib/x86_64-linux-gnu"
-- Generating done
CMake Generate step failed. Build files cannot be regenerated correctly.
and this is the patch that fixes the issue:
diff -Nru libftdi1-1.5/debian/changelog libftdi1-1.5/debian/changelog
--- libftdi1-1.5/debian/changelog 2020-07-17 08:57:55.000000000 +0200
+++ libftdi1-1.5/debian/changelog 2020-07-17 09:19:25.000000000 +0200
@@ -1,3 +1,9 @@
+libftdi1 (1.5-3.1) unstable; urgency=medium
+
+ * Add again the LIBDIR in rules file to make the cmake script happy (Closes:
#-1)
+
+ -- Gianfranco Costamagna <[email protected]> Fri, 17 Jul 2020
09:19:25 +0200
+
libftdi1 (1.5-3ubuntu1) groovy; urgency=medium
* Mark one symbol as optional, disappearing on ppc64el with -O3
diff -Nru libftdi1-1.5/debian/rules libftdi1-1.5/debian/rules
--- libftdi1-1.5/debian/rules 2020-07-13 11:23:42.000000000 +0200
+++ libftdi1-1.5/debian/rules 2020-07-17 09:19:25.000000000 +0200
@@ -11,6 +11,7 @@
override_dh_auto_configure:
dh_auto_configure --builddirectory=build-main -- \
-DBUILD_TESTS=ON \
+ -DCMAKE_INSTALL_LIBDIR="/usr/lib/$(DEB_HOST_MULTIARCH)" \
-DDOCUMENTATION:BOOL=ON \
-DEXAMPLES:BOOL=ON \
-DFTDIPP:BOOL=ON \
@@ -19,6 +20,7 @@
for v in $(PY3VERS) ; do \
dh_auto_configure --builddirectory=build-python$$v -- \
-DBUILD_TESTS=OFF \
+ -DCMAKE_INSTALL_LIBDIR="/usr/lib/$(DEB_HOST_MULTIARCH)"
\
-DDOCUMENTATION:BOOL=OFF \
-DEXAMPLES:BOOL=OFF \
-DFTDIPP:BOOL=ON \