aboutsummaryrefslogtreecommitdiffstats
path: root/cmake/FindDesignerComponents.cmake
blob: 551edf102de7c844f84b0e52bf9cac8ace9f6beb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
#.rst:
# FindDesignerComponents
# ---------
#
# Try to locate the DesignerComponents library.
# If found, this will define the following variables:
#
# ``DesignerComponents_FOUND``
#     True if the DesignerComponents library is available
# ``DesignerComponents_INCLUDE_DIRS``
#     The DesignerComponents include directories
# ``DesignerComponents_LIBRARIES``
#     The DesignerComponentscore library for linking
# ``DesignerComponents_INSTALL_DIR``
#     Top level DesignerComponents installation directory
#
# If ``DesignerComponents_FOUND`` is TRUE, it will also define the following
# imported target:
#
# ``Qt5::DesignerComponents``
#     The DesignerComponents library

find_package(Qt5Designer QUIET)
if (NOT Qt5Designer_FOUND)
    set(DesignerComponents_FOUND OFF)
    return()
endif()


find_path(DesignerComponents_INCLUDE_DIRS NAMES qtdesignercomponentsversion.h PATH_SUFFIXES QtDesignerComponents HINTS ${Qt5Designer_INCLUDE_DIRS})

find_library(DesignerComponents_LIBRARIES NAMES Qt5DesignerComponents)

include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(DesignerComponents DEFAULT_MSG
  DesignerComponents_LIBRARIES DesignerComponents_INCLUDE_DIRS)

if(DesignerComponents_FOUND AND NOT TARGET DesignerComponents::DesignerComponents)
  add_library(Qt5::DesignerComponents UNKNOWN IMPORTED)
  set_target_properties(Qt5::DesignerComponents PROPERTIES
                        IMPORTED_LOCATION "${DesignerComponents_LIBRARIES}"
                        INTERFACE_INCLUDE_DIRECTORIES "${DesignerComponents_INCLUDE_DIRS}")
endif()

mark_as_advanced(DesignerComponents_INCLUDE_DIRS DesignerComponents_LIBRARIES)

include(FeatureSummary)
set_package_properties(DesignerComponents PROPERTIES
  URL "https://qt.io/"
  DESCRIPTION "Qt5 (Widget) DesignerComponents library")