aboutsummaryrefslogtreecommitdiffstats
path: root/cmake
diff options
context:
space:
mode:
authorEike Ziller <eike.ziller@qt.io>2019-05-20 10:19:02 +0200
committerEike Ziller <eike.ziller@qt.io>2019-05-20 11:30:52 +0000
commitf498f577e6db29a79462f320b0178f28629d3c35 (patch)
tree56c2cc120ef5bda3bdcabe8e223bbcfe106b21a1 /cmake
parent36daca80f30aea5b3e335cbbce4c2dbe7c615247 (diff)
CMake build / macOS: Find QtDesignerComponents framework
Enables building of Widget Designer integration on macOS Change-Id: I84a2ee78ccf99941a0be517e089ece810154699d Reviewed-by: Cristian Adam <cristian.adam@qt.io> Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
Diffstat (limited to 'cmake')
-rw-r--r--cmake/FindDesignerComponents.cmake30
1 files changed, 24 insertions, 6 deletions
diff --git a/cmake/FindDesignerComponents.cmake b/cmake/FindDesignerComponents.cmake
index 551edf102d..58f957b468 100644
--- a/cmake/FindDesignerComponents.cmake
+++ b/cmake/FindDesignerComponents.cmake
@@ -26,20 +26,38 @@ if (NOT Qt5Designer_FOUND)
return()
endif()
+get_target_property(_designer_location Qt5::Designer IMPORTED_LOCATION_DEBUG)
+if (NOT _designer_location)
+ get_target_property(_designer_location Qt5::Designer IMPORTED_LOCATION_RELEASE)
+endif()
+if (NOT _designer_location)
+ get_target_property(_designer_location Qt5::Designer IMPORTED_LOCATION)
+endif()
+get_target_property(_designer_is_framework Qt5::Designer FRAMEWORK)
+find_library(DesignerComponents_LIBRARIES NAMES Qt5DesignerComponents QtDesignerComponents
+ NO_DEFAULT_PATH PATHS "${_designer_location}/.." "${_designer_location}/../..")
-find_path(DesignerComponents_INCLUDE_DIRS NAMES qtdesignercomponentsversion.h PATH_SUFFIXES QtDesignerComponents HINTS ${Qt5Designer_INCLUDE_DIRS})
-
-find_library(DesignerComponents_LIBRARIES NAMES Qt5DesignerComponents)
+if (_designer_is_framework)
+ if (DesignerComponents_LIBRARIES)
+ set(DesignerComponents_LIBRARIES "${DesignerComponents_LIBRARIES}/QtDesignerComponents")
+ endif()
+else()
+ find_path(DesignerComponents_INCLUDE_DIRS NAMES qtdesignercomponentsversion.h PATH_SUFFIXES QtDesignerComponents HINTS ${Qt5Designer_INCLUDE_DIRS})
+ set(_required_vars Qt5Designer_INCLUDE_DIRS)
+endif()
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(DesignerComponents DEFAULT_MSG
- DesignerComponents_LIBRARIES DesignerComponents_INCLUDE_DIRS)
+ DesignerComponents_LIBRARIES ${_required_vars})
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}")
+ IMPORTED_LOCATION "${DesignerComponents_LIBRARIES}")
+ if (NOT _designer_is_framework)
+ set_target_properties(Qt5::DesignerComponents PROPERTIES
+ INTERFACE_INCLUDE_DIRECTORIES "${DesignerComponents_INCLUDE_DIRS}")
+ endif()
endif()
mark_as_advanced(DesignerComponents_INCLUDE_DIRS DesignerComponents_LIBRARIES)