diff options
author | Joerg Bornemann <joerg.bornemann@qt.io> | 2021-11-25 14:28:37 +0100 |
---|---|---|
committer | Joerg Bornemann <joerg.bornemann@qt.io> | 2021-11-25 14:44:28 +0100 |
commit | 6c573dc4a5a08ab7b75ed1fbd93bd0f21c61a08a (patch) | |
tree | 87fe6c3b35822c6e82ece5e4d34339025641fc78 /cmake | |
parent | 91b6648ac89bb452219c5c89a3ffe79fa4d3de49 (diff) | |
download | qt3d-6c573dc4a5a08ab7b75ed1fbd93bd0f21c61a08a.tar.gz |
CMake: Fix configuration error if libassimp-dev is installed
On Debian-based Linux distributions, we got errors like
Imported target "WrapQt3DAssimp::WrapQt3DAssimp" includes
non-existent path
"/usr/lib/include"
if the libassimp-dev package was installed.
This is due to a packaging problem as described in
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=973361
Work around this issue by fixing the known wrong include path.
Pick-to: 6.2
Task-number: QTBUG-98420
Change-Id: If0052d012132ffddc056e20f1f65bf13723b0219
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Diffstat (limited to 'cmake')
-rw-r--r-- | cmake/FindWrapQt3DAssimp.cmake | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/cmake/FindWrapQt3DAssimp.cmake b/cmake/FindWrapQt3DAssimp.cmake index 40e6c686b..d6f3f7760 100644 --- a/cmake/FindWrapQt3DAssimp.cmake +++ b/cmake/FindWrapQt3DAssimp.cmake @@ -23,6 +23,24 @@ if (assimp_FOUND AND TARGET assimp::assimp) endif() endif() + # Work around Debian bug #973361 + set(_assimp_fixed_include_dirs) + get_target_property(_assimp_include_dirs assimp::assimp INTERFACE_INCLUDE_DIRECTORIES) + if(NOT _assimp_include_dirs MATCHES "-NOTFOUND$") + foreach(dir IN LISTS _assimp_include_dirs) + if(dir STREQUAL "/usr/lib/include" + AND NOT EXISTS "/usr/lib/include" + AND EXISTS "/usr/include") + set(dir "/usr/include") + endif() + list(APPEND _assimp_fixed_include_dirs "${dir}") + endforeach() + endif() + set_property(TARGET assimp::assimp + PROPERTY INTERFACE_INCLUDE_DIRECTORIES "${_assimp_fixed_include_dirs}") + unset(_assimp_fixed_include_dirs) + unset(_assimp_include_dirs) + set(WrapQt3DAssimp_FOUND TRUE) elseif(assimp_FOUND AND assimp_LIBRARIES AND assimp_INCLUDE_DIRS) add_library(WrapQt3DAssimp::WrapQt3DAssimp INTERFACE IMPORTED) |