File: KDEExperimentalPurposeConfig.cmake

package info (click to toggle)
purpose 5.54.0-1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, buster, sid
  • size: 2,816 kB
  • sloc: cpp: 4,261; sh: 58; makefile: 15
file content (24 lines) | stat: -rw-r--r-- 870 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
find_package(KF5Purpose REQUIRED)
message(WARNING "Look up the Purpose framework using KF5Purpose")

function(_copyTarget A B)
    add_library(${B} SHARED IMPORTED)

    set(props INTERFACE_INCLUDE_DIRECTORIES INTERFACE_LINK_LIBRARIES IMPORTED_CONFIGURATIONS)

    get_target_property(value ${A} IMPORTED_CONFIGURATIONS)
    foreach(cfg ${value})
        list(APPEND props IMPORTED_LINK_DEPENDENT_LIBRARIES_${cfg} IMPORTED_LOCATION_${cfg} IMPORTED_SONAME_${cfg})
    endforeach()

    foreach(prop ${props})
        get_target_property(value ${A} ${prop})
        if (NOT value)
            message(WARNING "missing property ${A} ${prop}")
        endif()
        set_target_properties(${B} PROPERTIES ${prop} "${value}")
    endforeach()
endfunction()

_copyTarget(KF5::Purpose KDEExperimental::Purpose)
_copyTarget(KF5::PurposeWidgets KDEExperimental::PurposeWidgets)