File: FindWrapJasper.cmake

package info (click to toggle)
qt6-imageformats 6.8.2-4
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 11,548 kB
  • sloc: ansic: 95,999; cpp: 8,358; makefile: 18
file content (21 lines) | stat: -rw-r--r-- 776 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: BSD-3-Clause

# We can't create the same interface imported target multiple times, CMake will complain if we do
# that. This can happen if the find_package call is done in multiple different subdirectories.
if(TARGET WrapJasper::WrapJasper)
    set(WrapJasper_FOUND TRUE)
    return()
endif()

set(WrapJasper_FOUND OFF)
find_package(Jasper)

if(Jasper_FOUND)
    set(WrapJasper_FOUND ON)

    # Upstream package does not provide targets, only variables. So define a target.
    add_library(WrapJasper::WrapJasper INTERFACE IMPORTED)
    target_link_libraries(WrapJasper::WrapJasper INTERFACE ${JASPER_LIBRARIES})
    target_include_directories(WrapJasper::WrapJasper INTERFACE ${JASPER_INCLUDE_DIR})
endif()