Files
RedBear-OS/recipes/wip/qt/qtquick3d/source/cmake/FindWrapQuick3DAssimp.cmake
T
vasilito ff4ff35918 feat: track all source trees in git — full fork offline-first model
Red Bear OS is a full fork. All sources must be available from git clone
with zero network access. Removed gitignore rules that excluded fetched
source trees under recipes/*/source/, local/recipes/kde/*/source/,
local/recipes/qt/*/source/, and vendor source trees.

Build artifacts (target/, build/, source.tar, *.o, *.so) remain excluded.

127291 files added — kernel, relibc, base, bootloader, pkgar, all KDE/Qt
frameworks, mesa, wayland, DRM drivers, and every other recipe source.
2026-05-14 10:55:53 +01:00

56 lines
2.4 KiB
CMake

# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: BSD-3-Clause
if(TARGET WrapQuick3DAssimp::WrapQuick3DAssimp)
set(WrapQuick3DAssimp_FOUND TRUE)
return()
endif()
set(WrapQuick3DAssimp_FOUND FALSE)
find_package(assimp ${WrapQuick3DAssimp_FIND_VERSION} CONFIG QUIET)
if (assimp_FOUND AND TARGET assimp::assimp)
add_library(WrapQuick3DAssimp::WrapQuick3DAssimp INTERFACE IMPORTED)
target_link_libraries(WrapQuick3DAssimp::WrapQuick3DAssimp INTERFACE assimp::assimp)
# The Assimp configuration file is broken, and sets only the Release location, without advertising
# that it's available via IMPORTED_CONFIGURATIONS. Thus when configuring with a different
# configuration, you get a assimp::assimp-NOTFOUND at build time.
# Make the release configuration be the default one.
get_target_property(_assimp_library_location assimp::assimp IMPORTED_LOCATION)
if(NOT _assimp_library_location)
get_target_property(_assimp_library_location_release assimp::assimp IMPORTED_LOCATION_RELEASE)
if(_assimp_library_location_release)
set_target_properties(assimp::assimp PROPERTIES
IMPORTED_LOCATION "${_assimp_library_location_release}")
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(WrapQuick3DAssimp_FOUND TRUE)
elseif(assimp_FOUND AND assimp_LIBRARIES AND assimp_INCLUDE_DIRS)
add_library(WrapQuick3DAssimp::WrapQuick3DAssimp INTERFACE IMPORTED)
target_link_libraries(WrapQuick3DAssimp::WrapQuick3DAssimp INTERFACE ${assimp_LIBRARIES})
target_include_directories(WrapQuick3DAssimp::WrapQuick3DAssimp INTERFACE ${assimp_INCLUDE_DIRS})
set(WrapQuick3DAssimp_FOUND TRUE)
endif()
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(WrapQuick3DAssimp DEFAULT_MSG WrapQuick3DAssimp_FOUND)