Use the LXQtConfigVars module
authorLuís Pereira <luis.artur.pereira@gmail.com>
Tue, 18 Oct 2016 21:04:06 +0000 (22:04 +0100)
committerLuís Pereira <luis.artur.pereira@gmail.com>
Tue, 18 Oct 2016 21:04:06 +0000 (22:04 +0100)
Attention: All system wide build time configuration moved to the
lxqt-build-tools repo.
LXQT@LXQT_QT_VERSION@_FOUND and LXQT_USEQT@LXQT_QT_VERSION@ dropped. They
aren't used anymore.

CMakeLists.txt
cmake/FindInstallConfigPath.cmake [deleted file]
cmake/lxqt-config.cmake.in

index da661d0..87696c8 100644 (file)
@@ -2,10 +2,6 @@ cmake_minimum_required(VERSION 3.0.2 FATAL_ERROR)
 
 project(liblxqt)
 
-set(LXQT_MAJOR_VERSION 0)
-set(LXQT_MINOR_VERSION 11)
-set(LXQT_PATCH_VERSION 0)
-
 set(QT_MINIMUM_VERSION "5.4.2")
 set(QTXDG_MINIMUM_VERSION "2.0.0")
 set(LXQTBT_MINIMUM_VERSION "0.1.0")
@@ -14,17 +10,6 @@ include(CMakePackageConfigHelpers)
 include(GNUInstallDirs) # Standard directories for installation
 
 #-----------------------------------------------------------------------------
-# LXQT_DATA_DIR defaults to CMAKE_INSTALL_FULL_DATADIR. It's added to
-#   XDG_DATA_DIRS by the startlxqt script
-# Warning: Setting LXQT_DATA_DIR must be done after including GNUInstallDirs
-#-----------------------------------------------------------------------------
-if (NOT DEFINED LXQT_DATA_DIR)
-    set(LXQT_DATA_DIR "${CMAKE_INSTALL_FULL_DATADIR}" CACHE PATH
-        "LXQt base directory relative to which data files should be searched"
-    )
-endif()
-
-#-----------------------------------------------------------------------------
 # Release is the default build type
 #-----------------------------------------------------------------------------
 if (NOT CMAKE_BUILD_TYPE)
@@ -120,13 +105,7 @@ set(FORMS
     configdialog/lxqtconfigdialog.ui
 )
 
-# additional cmake files
-list(APPEND CMAKE_MODULE_PATH
-    "${CMAKE_CURRENT_SOURCE_DIR}/cmake"
-)
-
 option(UPDATE_TRANSLATIONS "Update source translation translations/*.ts files" OFF)
-option(WITH_XDG_DIRS_FALLBACK "Use our XDG_CONFIG_DIRS fallback" ON)
 
 set(CMAKE_INCLUDE_CURRENT_DIR ON)
 set(CMAKE_POSITION_INDEPENDENT_CODE ON)
@@ -151,7 +130,6 @@ QT5_ADD_DBUS_ADAPTOR(SRCS
     lxqtsingleapplication.h LXQt::SingleApplication
 )
 
-set(LXQT_QT_VERSION "5")
 
 # KF5WindowSystem is missing here. KF5WindowSystem doesn't provide an .pc file.
 set(LXQT_PKG_CONFIG_REQUIRES "Qt5Xdg >= ${QTXDG_MINIMUM_VERSION}, Qt5Widgets >= ${QT_MINIMUM_VERSION}, Qt5Xml >= ${QT_MINIMUM_VERSION}, Qt5DBus >= ${QT_MINIMUM_VERSION}, Qt5X11Extras >= ${QT_MINIMUM_VERSION}")
@@ -160,16 +138,8 @@ set(LXQT_PKG_CONFIG_REQUIRES "Qt5Xdg >= ${QTXDG_MINIMUM_VERSION}, Qt5Widgets >=
 # Standard directories for installation
 include(LXQtCompilerSettings NO_POLICY_SCOPE)
 include(LXQtCreatePkgConfigFile)
-include(cmake/FindInstallConfigPath.cmake) # sets LXQT_ETC_XDG_DIR, if unset
 include(LXQtCreatePortableHeaders)
-
-set(LXQT_VERSION ${LXQT_MAJOR_VERSION}.${LXQT_MINOR_VERSION}.${LXQT_PATCH_VERSION})
-set(LXQT_LIBRARY_NAME "lxqt" CACHE STRING "lxqt")
-set(LXQT_RELATIVE_SHARE_DIR "${LXQT_LIBRARY_NAME}")
-set(LXQT_SHARE_DIR "${CMAKE_INSTALL_FULL_DATAROOTDIR}/${LXQT_RELATIVE_SHARE_DIR}")
-set(LXQT_RELATIVE_TRANSLATIONS_DIR "${LXQT_LIBRARY_NAME}/translations")
-set(LXQT_TRANSLATIONS_DIR "${LXQT_SHARE_DIR}/translations")
-set(LXQT_GRAPHICS_DIR "${LXQT_SHARE_DIR}/graphics")
+include(LXQtConfigVars)
 
 set(LXQT_INTREE_INCLUDE_DIR "${CMAKE_CURRENT_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/include")
 set(LXQT_INTREE_TARGETS_FILE "${CMAKE_BINARY_DIR}/${LXQT_LIBRARY_NAME}-targets.cmake")
@@ -223,9 +193,6 @@ lxqt_create_portable_headers(INTREE_PORTABLE_HEADERS
 # Create in-tree build infrastructure
 #************************************************
 set(CFG_LXQT_TARGETS_FILE   "${LXQT_INTREE_TARGETS_FILE}")
-set(CFG_LXQT_CMAKE_MODULES_DIR "${PROJECT_SOURCE_DIR}/cmake/modules")
-set(CFG_LXQT_CMAKE_FIND_MODULES_DIR "${PROJECT_SOURCE_DIR}/cmake/find-modules")
-
 
 configure_package_config_file(
     "${CMAKE_CURRENT_SOURCE_DIR}/cmake/lxqt-config.cmake.in"
@@ -237,8 +204,6 @@ configure_package_config_file(
 # Create installable build infrastructure
 #************************************************
 set(CFG_LXQT_TARGETS_FILE "${LXQT_INSTALL_CMAKE_DIR}/${LXQT_LIBRARY_NAME}/${LXQT_LIBRARY_NAME}-targets.cmake")
-set(CFG_LXQT_CMAKE_MODULES_DIR "${LXQT_INSTALL_CMAKE_DIR}/${LXQT_LIBRARY_NAME}/modules")
-set(CFG_LXQT_CMAKE_FIND_MODULES_DIR "${LXQT_INSTALL_CMAKE_DIR}/${LXQT_LIBRARY_NAME}/find-modules")
 
 configure_package_config_file(
     "${CMAKE_CURRENT_SOURCE_DIR}/cmake/lxqt-config.cmake.in"
@@ -265,27 +230,6 @@ install(EXPORT
     COMPONENT Devel
 )
 
-file(GLOB toInstallFindModules
-    "${PROJECT_SOURCE_DIR}/cmake/find-modules/*.cmake"
-)
-
-install(
-    FILES ${toInstallFindModules}
-    DESTINATION "${LXQT_INSTALL_CMAKE_DIR}/${LXQT_LIBRARY_NAME}/find-modules"
-    COMPONENT Devel
-)
-
-file(GLOB toInstallModules
-    "${PROJECT_SOURCE_DIR}/cmake/modules/*.cmake"
-    "${PROJECT_SOURCE_DIR}/cmake/modules/*.in"
-)
-
-install(
-    FILES ${toInstallModules}
-    DESTINATION "${LXQT_INSTALL_CMAKE_DIR}/${LXQT_LIBRARY_NAME}/modules"
-    COMPONENT Devel
-)
-
 add_library(${LXQT_LIBRARY_NAME}
     SHARED ${PUB_HDRS}
            ${SRCS}
diff --git a/cmake/FindInstallConfigPath.cmake b/cmake/FindInstallConfigPath.cmake
deleted file mode 100644 (file)
index 446e223..0000000
+++ /dev/null
@@ -1,23 +0,0 @@
-# XDG standards expects system-wide configuration files in the /etc/xdg/lxqt location.
-# Unfortunately QSettings we are using internally can be overriden in the Qt compilation
-# time to use different path for system-wide configs. (for example configure ... -sysconfdir /etc/settings ...)
-# This path can be found calling Qt4's qmake:
-#   qmake -query QT_INSTALL_CONFIGURATION
-#
-if(NOT DEFINED LXQT_ETC_XDG_DIR)
-    get_target_property(QT_QMAKE_EXECUTABLE ${Qt5Core_QMAKE_EXECUTABLE} IMPORTED_LOCATION)
-    message(STATUS "${QT_QMAKE_EXECUTABLE}")
-
-    if(NOT QT_QMAKE_EXECUTABLE)
-        message(FATAL_ERROR "LXQT_ETC_XDG_DIR: qmake executable not found (included before qt was configured?)")
-    endif()
-
-    execute_process(COMMAND ${QT_QMAKE_EXECUTABLE} -query QT_INSTALL_CONFIGURATION
-                    OUTPUT_VARIABLE LXQT_ETC_XDG_DIR
-                    OUTPUT_STRIP_TRAILING_WHITESPACE)
-
-    message(STATUS "LXQT_ETC_XDG_DIR autodetected as '${LXQT_ETC_XDG_DIR}'")
-    message(STATUS "You can set it manually with -DLXQT_ETC_XDG_DIR=<value>")
-    message(STATUS "")
-endif ()
-
index 9c1a6e5..7e34a06 100644 (file)
@@ -1,56 +1,9 @@
 # - Finds the lxqt package
-#
-# The module defines the following variables
-#
-#  LXQT_FOUND         - Set to TRUE if all of the above has been found
-#
-#  LXQT_SHARE_DIR     - This allows to install and read the configs from non-standard locations
-#
-#  LXQT_TRANSLATIONS_DIR - The default translations directory
-#
-#  LXQT_ETC_XDG_DIR   - XDG standards expects system-wide configuration files in the
-#                        /etc/xdg/lxqt location. Unfortunately QSettings we are using internally
-#                        can be overriden in the Qt compilation time to use different path for
-#                        system-wide configs. (for example configure ... -sysconfdir /etc/settings ...)
-#                        This path can be found calling Qt's qmake:
-#                             qmake -query QT_INSTALL_CONFIGURATION
-#
-#  LXQT_DATA_DIR      - LXQt base directory relative to which data files should
-#                       be searched.Defaults to CMAKE_INSTALL_FULL_DATADIR. It's
-#                       added to XDG_DATA_DIRS by the startlxqt script.
-#
 
 @PACKAGE_INIT@
 
-set(LXQT_USEQT@LXQT_QT_VERSION@             ON)
-set(LXQT_QT_VERSION         "@LXQT_QT_VERSION@")
-set(LXQT_MAJOR_VERSION      "@LXQT_MAJOR_VERSION@")
-set(LXQT_MINOR_VERSION      "@LXQT_MINOR_VERSION@")
-set(LXQT_PATCH_VERSION      "@LXQT_PATCH_VERSION@")
-set(LXQT_VERSION            "@LXQT_VERSION@")
-
-set(LXQT_RELATIVE_SHARE_DIR "@LXQT_RELATIVE_SHARE_DIR@")
-set(LXQT_SHARE_DIR          "@LXQT_SHARE_DIR@")
-set(LXQT_RELATIVE_TRANSLATIONS_DIR "@LXQT_RELATIVE_TRANSLATIONS_DIR@")
-set(LXQT_TRANSLATIONS_DIR   "@LXQT_TRANSLATIONS_DIR@")
-set(LXQT_GRAPHICS_DIR       "@LXQT_GRAPHICS_DIR@")
-set(LXQT_ETC_XDG_DIR        "@LXQT_ETC_XDG_DIR@")
-set(LXQT_DATA_DIR           "@LXQT_DATA_DIR@")
-
-
-set(LXQT@LXQT_QT_VERSION@_FOUND             1)
-
 include(CMakeFindDependencyMacro)
 
-add_definitions("-DLXQT_RELATIVE_SHARE_DIR=\"${LXQT_RELATIVE_SHARE_DIR}\"")
-add_definitions("-DLXQT_SHARE_DIR=\"${LXQT_SHARE_DIR}\"")
-add_definitions("-DLXQT_RELATIVE_SHARE_TRANSLATIONS_DIR=\"${LXQT_RELATIVE_TRANSLATIONS_DIR}\"")
-add_definitions("-DLXQT_SHARE_TRANSLATIONS_DIR=\"${LXQT_TRANSLATIONS_DIR}\"")
-add_definitions("-DLXQT_GRAPHICS_DIR=\"${LXQT_GRAPHICS_DIR}\"")
-add_definitions("-DLXQT_ETC_XDG_DIR=\"${LXQT_ETC_XDG_DIR}\"")
-add_definitions("-DLXQT_DATA_DIR=\"${LXQT_DATA_DIR}\"")
-add_definitions("-DLXQT_VERSION=\"${LXQT_VERSION}\"")
-
 find_dependency(Qt5Widgets @QT_MINIMUM_VERSION@)
 find_dependency(Qt5DBus @QT_MINIMUM_VERSION@)
 find_dependency(Qt5X11Extras @QT_MINIMUM_VERSION@)
@@ -59,6 +12,8 @@ find_dependency(Qt5Xdg @QTXDG_MINIMUM_VERSION@)
 find_dependency(KF5WindowSystem)
 find_dependency(lxqt-build-tools @LXQTBT_MINIMUM_VERSION@)
 
+include(LXQtConfigVars)
+
 if (CMAKE_VERSION VERSION_GREATER 2.8.12)
     cmake_policy(SET CMP0024 OLD)
 endif()