From ce2705d71fd36dce0217ca2051b7e74ceb0251cd Mon Sep 17 00:00:00 2001 From: Luca Beltrame Date: Thu, 6 Sep 2018 09:34:26 +0200 Subject: [PATCH] Revert "Search in default path before calling pkg-config" Build system changes can be potentially breaking and so must be reviewed prior to commit. In addition, there is no explanation for this change. Simon, you might want to submit your patches to Phabricator for review prior to landing them. CCMAIL: sdepiets@gmail.com This reverts commit 4f4f3295f2a8a366c954025652785e8fda34df3e. --- .../FindQt5EventDispatcherSupport.cmake | 32 ++++++------------- .../modules/FindQt5FontDatabaseSupport.cmake | 32 ++++++------------- cmake/modules/FindQt5PlatformSupport.cmake | 32 ++++++------------- cmake/modules/FindQt5ThemeSupport.cmake | 32 ++++++------------- 4 files changed, 40 insertions(+), 88 deletions(-) diff --git a/cmake/modules/FindQt5EventDispatcherSupport.cmake b/cmake/modules/FindQt5EventDispatcherSupport.cmake index c9dd87b38..948efe0d3 100644 --- a/cmake/modules/FindQt5EventDispatcherSupport.cmake +++ b/cmake/modules/FindQt5EventDispatcherSupport.cmake @@ -65,32 +65,20 @@ if(CMAKE_MINIMUM_REQUIRED_VERSION VERSION_LESS 2.8.12) message(AUTHOR_WARNING "Your project should require at least CMake 2.8.12 to use FindQt5EventDispatcherSupport.cmake") endif() -#Trying to find in the default paths +# Use pkg-config to get the directories and then use these values +# in the FIND_PATH() and FIND_LIBRARY() calls +find_package(PkgConfig) +pkg_check_modules(PKG_Qt5EventDispatcherSupport QUIET Qt5Gui) + +set(Qt5EventDispatcherSupport_DEFINITIONS ${PKG_Qt5EventDispatcherSupport_CFLAGS_OTHER}) +set(Qt5EventDispatcherSupport_VERSION ${PKG_Qt5EventDispatcherSupport_VERSION}) + find_path(Qt5EventDispatcherSupport_INCLUDE_DIR NAMES QtEventDispatcherSupport/private/qunixeventdispatcher_qpa_p.h - PATH_SUFFIXES - QtEventDispatcherSupport/${Qt5Core_VERSION}/ + HINTS + ${PKG_Qt5EventDispatcherSupport_INCLUDEDIR}/QtEventDispatcherSupport/${PKG_Qt5EventDispatcherSupport_VERSION}/ ) - -if (Qt5EventDispatcherSupport_INCLUDE_DIR) - set(Qt5EventDispatcherSupport_VERSION ${Qt5Core_VERSION}) -else() - # Use pkg-config to get the directories and then use these values - # in the FIND_PATH() and FIND_LIBRARY() calls - find_package(PkgConfig) - pkg_check_modules(PKG_Qt5EventDispatcherSupport QUIET Qt5Gui) - - set(Qt5EventDispatcherSupport_DEFINITIONS ${PKG_Qt5EventDispatcherSupport_CFLAGS_OTHER}) - set(Qt5EventDispatcherSupport_VERSION ${PKG_Qt5EventDispatcherSupport_VERSION}) - find_path(Qt5EventDispatcherSupport_INCLUDE_DIR - NAMES - QtEventDispatcherSupport/private/qunixeventdispatcher_qpa_p.h - HINTS - ${PKG_Qt5EventDispatcherSupport_INCLUDEDIR}/QtEventDispatcherSupport/${PKG_Qt5EventDispatcherSupport_VERSION}/ - ) -endif() - find_library(Qt5EventDispatcherSupport_LIBRARY NAMES Qt5EventDispatcherSupport diff --git a/cmake/modules/FindQt5FontDatabaseSupport.cmake b/cmake/modules/FindQt5FontDatabaseSupport.cmake index f283df243..d3e66cd30 100644 --- a/cmake/modules/FindQt5FontDatabaseSupport.cmake +++ b/cmake/modules/FindQt5FontDatabaseSupport.cmake @@ -65,32 +65,20 @@ if(CMAKE_MINIMUM_REQUIRED_VERSION VERSION_LESS 2.8.12) message(AUTHOR_WARNING "Your project should require at least CMake 2.8.12 to use FindQt5FontDatabaseSupport.cmake") endif() -#Trying to find in the default paths +# Use pkg-config to get the directories and then use these values +# in the FIND_PATH() and FIND_LIBRARY() calls +find_package(PkgConfig) +pkg_check_modules(PKG_Qt5FontDatabaseSupport QUIET Qt5Gui) + +set(Qt5FontDatabaseSupport_DEFINITIONS ${PKG_Qt5FontDatabaseSupport_CFLAGS_OTHER}) +set(Qt5FontDatabaseSupport_VERSION ${PKG_Qt5FontDatabaseSupport_VERSION}) + find_path(Qt5FontDatabaseSupport_INCLUDE_DIR NAMES QtFontDatabaseSupport/private/qfontconfigdatabase_p.h - PATH_SUFFIXES - QtFontDatabaseSupport/${Qt5Core_VERSION}/ + HINTS + ${PKG_Qt5FontDatabaseSupport_INCLUDEDIR}/QtFontDatabaseSupport/${PKG_Qt5FontDatabaseSupport_VERSION}/ ) - -if (Qt5FontDatabaseSupport_INCLUDE_DIR) - set(Qt5FontDatabaseSupport_VERSION ${Qt5Core_VERSION}) -else() - # Use pkg-config to get the directories and then use these values - # in the FIND_PATH() and FIND_LIBRARY() calls - find_package(PkgConfig) - pkg_check_modules(PKG_Qt5FontDatabaseSupport QUIET Qt5Gui) - - set(Qt5FontDatabaseSupport_DEFINITIONS ${PKG_Qt5FontDatabaseSupport_CFLAGS_OTHER}) - set(Qt5FontDatabaseSupport_VERSION ${PKG_Qt5FontDatabaseSupport_VERSION}) - find_path(Qt5FontDatabaseSupport_INCLUDE_DIR - NAMES - QtFontDatabaseSupport/private/qfontconfigdatabase_p.h - HINTS - ${PKG_Qt5FontDatabaseSupport_INCLUDEDIR}/QtFontDatabaseSupport/${PKG_Qt5FontDatabaseSupport_VERSION}/ - ) -endif() - find_library(Qt5FontDatabaseSupport_LIBRARY NAMES Qt5FontDatabaseSupport diff --git a/cmake/modules/FindQt5PlatformSupport.cmake b/cmake/modules/FindQt5PlatformSupport.cmake index b89c3cdb7..da6a1c139 100644 --- a/cmake/modules/FindQt5PlatformSupport.cmake +++ b/cmake/modules/FindQt5PlatformSupport.cmake @@ -64,32 +64,20 @@ if(CMAKE_MINIMUM_REQUIRED_VERSION VERSION_LESS 2.8.12) message(AUTHOR_WARNING "Your project should require at least CMake 2.8.12 to use FindQt5PlatformSupport.cmake") endif() -#Trying to find in the default paths +# Use pkg-config to get the directories and then use these values +# in the FIND_PATH() and FIND_LIBRARY() calls +find_package(PkgConfig) +pkg_check_modules(PKG_Qt5PlatformSupport QUIET Qt5Gui) + +set(Qt5PlatformSupport_DEFINITIONS ${PKG_Qt5PlatformSupport_CFLAGS_OTHER}) +set(Qt5PlatformSupport_VERSION ${PKG_Qt5PlatformSupport_VERSION}) + find_path(Qt5PlatformSupport_INCLUDE_DIR NAMES QtPlatformSupport/private/qfontconfigdatabase_p.h - PATH_SUFFIXES - QtPlatformSupport/${Qt5Core_VERSION}/ + HINTS + ${PKG_Qt5PlatformSupport_INCLUDEDIR}/QtPlatformSupport/${PKG_Qt5PlatformSupport_VERSION}/ ) - -if (Qt5PlatformSupport_INCLUDE_DIR) - set(Qt5PlatformSupport_VERSION ${Qt5Core_VERSION}) -else() - # Use pkg-config to get the directories and then use these values - # in the FIND_PATH() and FIND_LIBRARY() calls - find_package(PkgConfig) - pkg_check_modules(PKG_Qt5PlatformSupport QUIET Qt5Gui) - - set(Qt5PlatformSupport_DEFINITIONS ${PKG_Qt5PlatformSupport_CFLAGS_OTHER}) - set(Qt5PlatformSupport_VERSION ${PKG_Qt5PlatformSupport_VERSION}) - find_path(Qt5PlatformSupport_INCLUDE_DIR - NAMES - QtPlatformSupport/private/qfontconfigdatabase_p.h - HINTS - ${PKG_Qt5PlatformSupport_INCLUDEDIR}/QtPlatformSupport/${PKG_Qt5PlatformSupport_VERSION}/ - ) -endif() - find_library(Qt5PlatformSupport_LIBRARY NAMES Qt5PlatformSupport diff --git a/cmake/modules/FindQt5ThemeSupport.cmake b/cmake/modules/FindQt5ThemeSupport.cmake index 97803866f..5588a7666 100644 --- a/cmake/modules/FindQt5ThemeSupport.cmake +++ b/cmake/modules/FindQt5ThemeSupport.cmake @@ -65,32 +65,20 @@ if(CMAKE_MINIMUM_REQUIRED_VERSION VERSION_LESS 2.8.12) message(AUTHOR_WARNING "Your project should require at least CMake 2.8.12 to use FindQt5ThemeSupport.cmake") endif() -#Trying to find in the default paths +# Use pkg-config to get the directories and then use these values +# in the FIND_PATH() and FIND_LIBRARY() calls +find_package(PkgConfig) +pkg_check_modules(PKG_Qt5ThemeSupport QUIET Qt5Gui) + +set(Qt5ThemeSupport_DEFINITIONS ${PKG_Qt5ThemeSupport_CFLAGS_OTHER}) +set(Qt5ThemeSupport_VERSION ${PKG_Qt5ThemeSupport_VERSION}) + find_path(Qt5ThemeSupport_INCLUDE_DIR NAMES QtThemeSupport/private/qgenericunixthemes_p.h - PATH_SUFFIXES - QtThemeSupport/${Qt5Core_VERSION}/ + HINTS + ${PKG_Qt5ThemeSupport_INCLUDEDIR}/QtThemeSupport/${PKG_Qt5ThemeSupport_VERSION}/ ) - -if (Qt5ThemeSupport_INCLUDE_DIR) - set(Qt5ThemeSupport_VERSION ${Qt5Core_VERSION}) -else() - # Use pkg-config to get the directories and then use these values - # in the FIND_PATH() and FIND_LIBRARY() calls - find_package(PkgConfig) - pkg_check_modules(PKG_Qt5ThemeSupport QUIET Qt5Gui) - - set(Qt5ThemeSupport_DEFINITIONS ${PKG_Qt5ThemeSupport_CFLAGS_OTHER}) - set(Qt5ThemeSupport_VERSION ${PKG_Qt5ThemeSupport_VERSION}) - find_path(Qt5ThemeSupport_INCLUDE_DIR - NAMES - QtThemeSupport/private/qgenericunixthemes_p.h - HINTS - ${PKG_Qt5ThemeSupport_INCLUDEDIR}/QtThemeSupport/${PKG_Qt5ThemeSupport_VERSION}/ - ) -endif() - find_library(Qt5ThemeSupport_LIBRARY NAMES Qt5ThemeSupport