Cmake find_package files
authorAlexander Sokolov <sokoloff.a@gmail.com>
Tue, 6 Aug 2013 18:01:14 +0000 (22:01 +0400)
committerAlexander Sokolov <sokoloff.a@gmail.com>
Tue, 6 Aug 2013 18:01:14 +0000 (22:01 +0400)
18 files changed:
.gitignore [new file with mode: 0644]
CMakeLists.txt
aboutdialog/RazorAboutDialog [new file with mode: 0644]
aboutdialog/razoraboutdlg.cpp
aboutdialog/technicalinfo.cpp
cmake/FindICU.cmake [deleted file]
cmake/FindInstallConfigPath.cmake [new file with mode: 0644]
cmake/FindPulseAudio.cmake [deleted file]
cmake/FindUDev.cmake [deleted file]
cmake/RazorInstallConfigPath.cmake [deleted file]
cmake/RazorLibSuffix.cmake [deleted file]
cmake/RazorTranslate.cmake [deleted file]
cmake/cmake_uninstall.cmake.in [deleted file]
cmake/create_pkgconfig_file.cmake
cmake/lxqt-config.cmake.in [new file with mode: 0644]
cmake/lxqt_use.cmake [new file with mode: 0644]
cmake/razortranslate.h.in [deleted file]
razorapplication.cpp

diff --git a/.gitignore b/.gitignore
new file mode 100644 (file)
index 0000000..ba442ec
--- /dev/null
@@ -0,0 +1,22 @@
+moc_*.cxx
+qrc_*.cxx
+cmake_install.cmake
+cmake_uninstall.cmake
+Makefile
+CMakeFiles
+CMakeCache.txt
+CPackConfig.cmake
+CPackSourceConfig.cmake
+lib*.so
+lib*.so.*
+ui_*.h
+*.qm
+razorqt-appswitcher/razor-appswitcher
+razorqt-desktop/razor-desktop
+razorqt-panel/panel/razor-panel
+*~
+*.autosave
+*-swp
+CMakeLists.txt.user*
+/build
+nbproject/
index 05333e9..389c8d9 100644 (file)
@@ -1,95 +1,13 @@
 cmake_minimum_required( VERSION 2.6 )
 
-project(librazorqt)
-
-if (NOT CMAKE_BUILD_TYPE)
-    set ( CMAKE_BUILD_TYPE Release )
-endif (NOT CMAKE_BUILD_TYPE)
-
-if (CMAKE_BUILD_TYPE MATCHES [Dd]ebug)
-    message(STATUS "Debug build")
-    add_definitions(-DDEBUG)
-else()
-    message(STATUS "non-debug build")
-    add_definitions(-DNDEBUG)
-endif()
-
-if (NOT CMAKE_INSTALL_PREFIX)
-    message(FATAL_ERROR "CMAKE_INSTALL_PREFIX is not set but it has to be. Something is wrong.")
-endif ()
-
-set(MAJOR_VERSION 0)
-set(MINOR_VERSION 5)
-set(PATCH_VERSION 0)
-set(RAZOR_VERSION ${MAJOR_VERSION}.${MINOR_VERSION}.${PATCH_VERSION})
-add_definitions(-DRAZOR_VERSION=\"${RAZOR_VERSION}\")
-message(STATUS "")
-message(STATUS "Razor-qt version: ${RAZOR_VERSION}")
-message(STATUS "")
-
-link_directories(/usr/local/lib/)
-
-add_definitions ( -Wall )
-set( QT_USE_QTDBUS 1 )
-find_package ( Qt4 4.6.0 REQUIRED )
-include ( ${QT_USE_FILE} )
-include_directories (
-       ${QT_QTCORE_INCLUDE_DIR}
-       ${QT_QTGUI_INCLUDE_DIR}
-)
-
-# additional cmake files
-set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_SOURCE_DIR}/cmake)
-# Qt *must* be detected before this one
-include(RazorInstallConfigPath)
-add_definitions(-DRAZOR_ETC_XDG_DIRECTORY=\"${RAZOR_ETC_XDG_DIRECTORY}\")
-include(RazorLibSuffix)
-
-# This allows to install and read the configs from non-standard locations
-add_definitions(-DSHARE_DIR=\"${CMAKE_INSTALL_PREFIX}/share/razor/\")
-
-message(STATUS "")
-get_filename_component(MAKE_PROGRAM_NAME ${CMAKE_MAKE_PROGRAM} NAME)
-message(STATUS "Developer documentation (doxygen) can be generated by '${MAKE_PROGRAM_NAME} doc'")
-message(STATUS "")
-
-message(STATUS "")
-message(STATUS "For building tests use -DBUILD_TESTS=Yes option.")
-message(STATUS "")
-
-########### Add uninstall target ###############
-CONFIGURE_FILE(
-    "${CMAKE_SOURCE_DIR}/cmake/cmake_uninstall.cmake.in"
-    "${CMAKE_CURRENT_BINARY_DIR}/cmake/cmake_uninstall.cmake"
-    IMMEDIATE @ONLY)
+project(liblxqt)
 
-ADD_CUSTOM_TARGET(uninstall
-    "${CMAKE_COMMAND}" -P "${CMAKE_CURRENT_BINARY_DIR}/cmake/cmake_uninstall.cmake")
+set(LXQT_MAJOR_VERSION 0)
+set(LXQT_MINOR_VERSION 5)
+set(LXQT_PATCH_VERSION 0)
 
-########## Add make dist target ################
-SET(CPACK_PACKAGE_VERSION "${RAZOR_VERSION}")
-SET(CPACK_SOURCE_GENERATOR "TBZ2")
-SET(CPACK_SOURCE_PACKAGE_FILE_NAME "razorqt-${CPACK_PACKAGE_VERSION}")
-SET(CPACK_IGNORE_FILES "/CVS/;/\\\\.git\;/\\\\.svn/;\\\\.swp$;\\\\.#;/#;\\\\.tar.gz$;/CMakeFiles/;CMakeCache.txt;refresh-copyright-and-license.pl")
-SET(CPACK_SOURCE_IGNORE_FILES ${CPACK_IGNORE_FILES})
-INCLUDE(CPack)
-# simulate autotools' "make dist"
-add_custom_target(dist COMMAND ${CMAKE_MAKE_PROGRAM} package_source)
 
-# add_subdirectory( doxygen )
-
-# component specific part
-
-find_package(X11 REQUIRED)
-
-include_directories (
-       ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR}
-    ${QT_QTCORE_INCLUDE_DIR} ${QT_QTGUI_INCLUDE_DIR} ${QT_QTDBUS_INCLUDE_DIR}
-       ${X11_INCLUDE_DIR}
-    ${CMAKE_SOURCE_DIR}/libraries
-)
-
-set(razorqt_PUB_HDRS
+set(PUB_HDRS
     aboutdialog/razoraboutdlg.h
     razorsettings.h
     xfitman.h
@@ -114,12 +32,16 @@ set(razorqt_PUB_HDRS
     rotatedwidget.h
 )
 
-set(razorqt_PRIV_HDRS
+set(PUB_LINKS
+    aboutdialog/RazorAboutDialog
+)
+
+set(PRIV_HDRS
     aboutdialog/razoraboutdlg_p.h
     aboutdialog/technicalinfo.h
 )
 
-set(razorqt_SRCS
+set(SRCS
     aboutdialog/razoraboutdlg.cpp
     aboutdialog/technicalinfo.cpp
     xfitman.cpp
@@ -145,7 +67,7 @@ set(razorqt_SRCS
     rotatedwidget.cpp
 )
 
-set(razorqt_MOCS
+set(MOCS
     aboutdialog/razoraboutdlg.h
     aboutdialog/razoraboutdlg_p.h
     powermanager.h
@@ -167,59 +89,112 @@ set(razorqt_MOCS
     rotatedwidget.h
 )
 
-QT4_ADD_DBUS_INTERFACE(razorqt_SRCS
+set(FORMS
+    aboutdialog/razoraboutdlg.ui
+    razorconfigdialog.ui
+    addplugindialog/addplugindialog.ui
+)
+
+
+find_package(Qt4 REQUIRED)
+include(${QT_USE_FILE})
+
+QT4_ADD_DBUS_INTERFACE(SRCS
     dbus/org.freedesktop.Notifications.xml
     notifications_interface
 )
 
-set( razorqt_UIS
-    aboutdialog/razoraboutdlg.ui
-    razorconfigdialog.ui
-    addplugindialog/addplugindialog.ui
+find_package(X11 REQUIRED)
+
+find_package(QTXDG REQUIRED)
+include(${QTXDG_USE_FILE})
+
+
+include_directories (
+    ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR}
+    ${QT_QTCORE_INCLUDE_DIR} ${QT_QTGUI_INCLUDE_DIR} ${QT_QTDBUS_INCLUDE_DIR}
+    ${X11_INCLUDE_DIR}
+    ${CMAKE_SOURCE_DIR}/libraries
 )
 
-#message(STATUS "+++++++++++++++++++"  ${dbus_generated})
+set(LXQT_VERSION ${LXQT_MAJOR_VERSION}.${LXQT_MINOR_VERSION}.${LXQT_PATCH_VERSION})
 
-set(APP_SHARE_DIR ${CMAKE_INSTALL_PREFIX}/share/librazorqt)
+message(STATUS "")
+message(STATUS "liblxqt version: ${LXQT_VERSION}")
+message(STATUS "")
+
+
+#************************************************
+# Build config.cmake files
+#************************************************
+set(LXQT_SHARE_DIR ${CMAKE_INSTALL_PREFIX}/share/lxqt/)
+include(cmake/FindInstallConfigPath.cmake)
+
+set(LXQT_INCLUDE_DIR ${CMAKE_INSTALL_PREFIX}/include/lxqt)
+
+configure_file(
+    ${CMAKE_CURRENT_SOURCE_DIR}/cmake/lxqt-config.cmake.in
+    ${CMAKE_CURRENT_BINARY_DIR}/lxqt-config.cmake
+    @ONLY
+)
+#************************************************
+# End of build config.cmake
+#************************************************
+include_directories(${LXQT_INCLUDE_DIR})
+
+set(APP_SHARE_DIR ${CMAKE_INSTALL_PREFIX}/share/liblxqrt)
 add_definitions(-DTRANSLATIONS_DIR=\"${APP_SHARE_DIR}\")
 
 # Translations **********************************
-include(RazorTranslate)
-razor_translate_ts(RAZORQT_QM_FILES
+include(cmake/lxqt_use.cmake)
+razor_translate_ts(QM_FILES
     SOURCES
-        ${razorqt_PUB_HDRS}
-        ${razorqt_PRIV_HDRS}
-        ${razorqt_SRCS}
-        ${razorqt_MOCS}
-        ${razorqt_UIS}
+        ${PUB_HDRS}
+        ${PRIV_HDRS}
+        ${SRCS}
+        ${MOCS}
+        ${FORMS}
     INSTALLATION_DIR
         ${APP_SHARE_DIR}
 )
 
 #************************************************
 
-QT4_WRAP_CPP(MOCS ${razorqt_MOCS})
-QT4_WRAP_UI(UIS ${razorqt_UIS})
+
+QT4_WRAP_CPP(MOCS ${MOCS})
+QT4_WRAP_UI(UIS ${FORMS})
 
 include(translatorsinfo/CMakeLists.txt)
 get_translatorsinfo_qrc(translatorsinfo_qrc)
 qt4_add_resources(QRC_CXX_SOURCES ${translatorsinfo_qrc})
 
-add_library ( razorqt SHARED ${razorqt_PUB_HDRS} ${razorqt_PRIV_HDRS} ${razorqt_SRCS} ${dbus_generated} ${UIS} ${MOCS} ${RAZORQT_QM_FILES} ${QRC_CXX_SOURCES})
-
-target_link_libraries ( razorqt  ${QT_QTCORE_LIBRARY} ${QT_QTGUI_LIBRARY}
-                                 ${QT_QTDBUS_LIBRARY}
-                                 ${X11_X11_LIB}
-                                 qtxdg
-                      )
+add_library(lxqt
+    SHARED ${PUB_HDRS}
+           ${PRIV_HDRS}
+           ${SRCS}
+           ${dbus_generated}
+           ${UIS} ${MOCS}
+           ${QM_FILES}
+           ${QRC_CXX_SOURCES})
+
+target_link_libraries(lxqt
+    ${QT_QTCORE_LIBRARY} ${QT_QTGUI_LIBRARY}
+    ${QT_QTDBUS_LIBRARY}
+    ${X11_X11_LIB}
+    qtxdg
+)
 
-set_target_properties(razorqt PROPERTIES
-  VERSION ${MAJOR_VERSION}.${MINOR_VERSION}.${PATCH_VERSION}
-  SOVERSION ${MAJOR_VERSION}
+set_target_properties(lxqt PROPERTIES
+    VERSION   ${LXQT_VERSION}
+    SOVERSION ${LXQT_MAJOR_VERSION}
 )
 
-install(TARGETS razorqt DESTINATION lib${LIB_SUFFIX})
-install(FILES ${razorqt_PUB_HDRS} DESTINATION include/razorqt)
+install(TARGETS lxqt DESTINATION lib${LIB_SUFFIX})
+install(FILES ${PUB_HDRS}  DESTINATION ${LXQT_INCLUDE_DIR})
+install(FILES ${PUB_LINKS} DESTINATION ${LXQT_INCLUDE_DIR})
+
+install(FILES ${CMAKE_CURRENT_BINARY_DIR}/lxqt-config.cmake DESTINATION share/cmake/lxqt)
+install(FILES cmake/lxqt_use.cmake DESTINATION share/cmake/lxqt)
 
-include(create_pkgconfig_file)
-create_pkgconfig_file(razorqt "Shared library for Razor-qt applications")
+include(cmake/create_pkgconfig_file.cmake)
+create_pkgconfig_file(lxqt "Shared library for LXQt applications")
diff --git a/aboutdialog/RazorAboutDialog b/aboutdialog/RazorAboutDialog
new file mode 100644 (file)
index 0000000..853aca5
--- /dev/null
@@ -0,0 +1 @@
+#include "razoraboutdlg.h"
index 11ee0f1..a59fcef 100644 (file)
@@ -54,7 +54,7 @@ RazorAboutDLGPrivate::RazorAboutDLGPrivate()
 
     iconLabel->setFixedSize(48, 48);
     iconLabel->setScaledContents(true);
-    iconLabel->setPixmap(QPixmap(QString(SHARE_DIR) + "/graphics/razor_logo.png"));
+    iconLabel->setPixmap(QPixmap(QString(LXQT_SHARE_DIR) + "/graphics/razor_logo.png"));
 
     nameLabel->setText(css + titleText());
 
index 3abf72a..d600da4 100644 (file)
@@ -159,11 +159,11 @@ TechnicalInfo::TechnicalInfo()
     QString buildType("Release");
 #endif
 
-    table->add("Version",              RAZOR_VERSION);
+    table->add("Version",              LXQT_VERSION);
     table->add("Qt",                   qVersion());
     table->add("Build type",           buildType);
-    table->add("System Configuration", RAZOR_ETC_XDG_DIRECTORY);
-    table->add("Share Directory",      SHARE_DIR);
+    table->add("System Configuration", LXQT_ETC_XDG_DIR);
+    table->add("Share Directory",      LXQT_SHARE_DIR);
     table->add("Translations",         TRANSLATIONS_DIR);
 
 
diff --git a/cmake/FindICU.cmake b/cmake/FindICU.cmake
deleted file mode 100644 (file)
index 0fe5ecc..0000000
+++ /dev/null
@@ -1,290 +0,0 @@
-# This module can find the International Components for Unicode (ICU) Library
-#
-# Requirements:
-# - CMake >= 2.8.3 (for new version of find_package_handle_standard_args)
-#
-# The following variables will be defined for your use:
-#   - ICU_FOUND             : were all of your specified components found (include dependencies)?
-#   - ICU_INCLUDE_DIRS      : ICU include directory
-#   - ICU_LIBRARIES         : ICU libraries
-#   - ICU_VERSION           : complete version of ICU (x.y.z)
-#   - ICU_MAJOR_VERSION     : major version of ICU
-#   - ICU_MINOR_VERSION     : minor version of ICU
-#   - ICU_PATCH_VERSION     : patch version of ICU
-#   - ICU_<COMPONENT>_FOUND : were <COMPONENT> found? (FALSE for non specified component if it is not a dependency)
-#
-# For windows or non standard installation, define ICU_ROOT variable to point to the root installation of ICU. Two ways:
-#   - run cmake with -DICU_ROOT=<PATH>
-#   - define an environment variable with the same name before running cmake
-# With cmake-gui, before pressing "Configure":
-#   1) Press "Add Entry" button
-#   2) Add a new entry defined as:
-#     - Name: ICU_ROOT
-#     - Type: choose PATH in the selection list
-#     - Press "..." button and select the root installation of ICU
-#
-# Example Usage:
-#
-#   1. Copy this file in the root of your project source directory
-#   2. Then, tell CMake to search this non-standard module in your project directory by adding to your CMakeLists.txt:
-#     set(CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR})
-#   3. Finally call find_package() once, here are some examples to pick from
-#
-#   Require ICU 4.4 or later
-#     find_package(ICU 4.4 REQUIRED)
-#
-#   if(ICU_FOUND)
-#      include_directories(${ICU_INCLUDE_DIRS})
-#      add_executable(myapp myapp.c)
-#      target_link_libraries(myapp ${ICU_LIBRARIES})
-#   endif()
-
-#=============================================================================
-# Copyright (c) 2011-2012, julp
-#
-# Distributed under the OSI-approved BSD License
-#
-# This software is distributed WITHOUT ANY WARRANTY; without even the
-# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
-#=============================================================================
-
-find_package(PkgConfig QUIET)
-
-########## Private ##########
-set(ICU_PUBLIC_VAR_NS "ICU")                          # Prefix for all ICU relative public variables
-set(ICU_PRIVATE_VAR_NS "_${ICU_PUBLIC_VAR_NS}")       # Prefix for all ICU relative internal variables
-set(PC_ICU_PRIVATE_VAR_NS "_PC${ICU_PRIVATE_VAR_NS}") # Prefix for all pkg-config relative internal variables
-
-function(icudebug _VARNAME)
-    if(${ICU_PUBLIC_VAR_NS}_DEBUG)
-        if(DEFINED ${ICU_PUBLIC_VAR_NS}_${_VARNAME})
-            message("${ICU_PUBLIC_VAR_NS}_${_VARNAME} = ${${ICU_PUBLIC_VAR_NS}_${_VARNAME}}")
-        else(DEFINED ${ICU_PUBLIC_VAR_NS}_${_VARNAME})
-            message("${ICU_PUBLIC_VAR_NS}_${_VARNAME} = <UNDEFINED>")
-        endif(DEFINED ${ICU_PUBLIC_VAR_NS}_${_VARNAME})
-    endif(${ICU_PUBLIC_VAR_NS}_DEBUG)
-endfunction(icudebug)
-
-set(${ICU_PRIVATE_VAR_NS}_ROOT "")
-if(DEFINED ENV{ICU_ROOT})
-    set(${ICU_PRIVATE_VAR_NS}_ROOT "$ENV{ICU_ROOT}")
-endif(DEFINED ENV{ICU_ROOT})
-if (DEFINED ICU_ROOT)
-    set(${ICU_PRIVATE_VAR_NS}_ROOT "${ICU_ROOT}")
-endif(DEFINED ICU_ROOT)
-
-set(${ICU_PRIVATE_VAR_NS}_BIN_SUFFIXES )
-set(${ICU_PRIVATE_VAR_NS}_LIB_SUFFIXES )
-if(CMAKE_SIZEOF_VOID_P EQUAL 8)
-    list(APPEND ${ICU_PRIVATE_VAR_NS}_BIN_SUFFIXES "bin64")
-    list(APPEND ${ICU_PRIVATE_VAR_NS}_LIB_SUFFIXES "lib64")
-endif(CMAKE_SIZEOF_VOID_P EQUAL 8)
-list(APPEND ${ICU_PRIVATE_VAR_NS}_BIN_SUFFIXES "bin")
-list(APPEND ${ICU_PRIVATE_VAR_NS}_LIB_SUFFIXES "lib")
-
-set(${ICU_PRIVATE_VAR_NS}_COMPONENTS )
-# <icu component name> <library name 1> ... <library name N>
-macro(icu_declare_component _NAME)
-    list(APPEND ${ICU_PRIVATE_VAR_NS}_COMPONENTS ${_NAME})
-    set("${ICU_PRIVATE_VAR_NS}_COMPONENTS_${_NAME}" ${ARGN})
-endmacro(icu_declare_component)
-
-icu_declare_component(data icudata)
-icu_declare_component(uc   icuuc)         # Common and Data libraries
-icu_declare_component(i18n icui18n icuin) # Internationalization library
-icu_declare_component(io   icuio ustdio)  # Stream and I/O Library
-icu_declare_component(le   icule)         # Layout library
-icu_declare_component(lx   iculx)         # Paragraph Layout library
-
-########## Public ##########
-set(${ICU_PUBLIC_VAR_NS}_FOUND TRUE)
-set(${ICU_PUBLIC_VAR_NS}_LIBRARIES )
-set(${ICU_PUBLIC_VAR_NS}_INCLUDE_DIRS )
-set(${ICU_PUBLIC_VAR_NS}_DEFINITIONS )
-foreach(${ICU_PRIVATE_VAR_NS}_COMPONENT ${${ICU_PRIVATE_VAR_NS}_COMPONENTS})
-    string(TOUPPER "${${ICU_PRIVATE_VAR_NS}_COMPONENT}" ${ICU_PRIVATE_VAR_NS}_UPPER_COMPONENT)
-    set("${ICU_PUBLIC_VAR_NS}_${${ICU_PRIVATE_VAR_NS}_UPPER_COMPONENT}_FOUND" FALSE) # may be done in the icu_declare_component macro
-endforeach(${ICU_PRIVATE_VAR_NS}_COMPONENT)
-
-# Check components
-if(NOT ${ICU_PUBLIC_VAR_NS}_FIND_COMPONENTS) # uc required at least
-    set(${ICU_PUBLIC_VAR_NS}_FIND_COMPONENTS uc)
-else(NOT ${ICU_PUBLIC_VAR_NS}_FIND_COMPONENTS)
-    list(APPEND ${ICU_PUBLIC_VAR_NS}_FIND_COMPONENTS uc)
-    list(REMOVE_DUPLICATES ${ICU_PUBLIC_VAR_NS}_FIND_COMPONENTS)
-    foreach(${ICU_PRIVATE_VAR_NS}_COMPONENT ${${ICU_PUBLIC_VAR_NS}_FIND_COMPONENTS})
-        if(NOT DEFINED ${ICU_PRIVATE_VAR_NS}_COMPONENTS_${${ICU_PRIVATE_VAR_NS}_COMPONENT})
-            message(FATAL_ERROR "Unknown ICU component: ${${ICU_PRIVATE_VAR_NS}_COMPONENT}")
-        endif(NOT DEFINED ${ICU_PRIVATE_VAR_NS}_COMPONENTS_${${ICU_PRIVATE_VAR_NS}_COMPONENT})
-    endforeach(${ICU_PRIVATE_VAR_NS}_COMPONENT)
-endif(NOT ${ICU_PUBLIC_VAR_NS}_FIND_COMPONENTS)
-
-# Includes
-find_path(
-    ${ICU_PUBLIC_VAR_NS}_INCLUDE_DIRS
-    NAMES unicode/utypes.h utypes.h
-    HINTS ${${ICU_PRIVATE_VAR_NS}_ROOT}
-    PATH_SUFFIXES "include"
-    DOC "Include directories for ICU"
-)
-
-if(${ICU_PUBLIC_VAR_NS}_INCLUDE_DIRS)
-    ########## <part to keep synced with tests/version/CMakeLists.txt> ##########
-    if(EXISTS "${${ICU_PUBLIC_VAR_NS}_INCLUDE_DIRS}/unicode/uvernum.h") # ICU >= 4
-        file(READ "${${ICU_PUBLIC_VAR_NS}_INCLUDE_DIRS}/unicode/uvernum.h" ${ICU_PRIVATE_VAR_NS}_VERSION_HEADER_CONTENTS)
-    elseif(EXISTS "${${ICU_PUBLIC_VAR_NS}_INCLUDE_DIRS}/unicode/uversion.h") # ICU [2;4[
-        file(READ "${${ICU_PUBLIC_VAR_NS}_INCLUDE_DIRS}/unicode/uversion.h" ${ICU_PRIVATE_VAR_NS}_VERSION_HEADER_CONTENTS)
-    elseif(EXISTS "${${ICU_PUBLIC_VAR_NS}_INCLUDE_DIRS}/unicode/utypes.h") # ICU [1.4;2[
-        file(READ "${${ICU_PUBLIC_VAR_NS}_INCLUDE_DIRS}/unicode/utypes.h" ${ICU_PRIVATE_VAR_NS}_VERSION_HEADER_CONTENTS)
-    elseif(EXISTS "${${ICU_PUBLIC_VAR_NS}_INCLUDE_DIRS}/utypes.h") # ICU 1.3
-        file(READ "${${ICU_PUBLIC_VAR_NS}_INCLUDE_DIRS}/utypes.h" ${ICU_PRIVATE_VAR_NS}_VERSION_HEADER_CONTENTS)
-    else()
-        message(FATAL_ERROR "ICU version header not found")
-    endif()
-
-    if(${ICU_PRIVATE_VAR_NS}_VERSION_HEADER_CONTENTS MATCHES ".*# *define *ICU_VERSION *\"([0-9]+)\".*") # ICU 1.3
-        # [1.3;1.4[ as #define ICU_VERSION "3" (no patch version, ie all 1.3.X versions will be detected as 1.3.0)
-        set(${ICU_PUBLIC_VAR_NS}_MAJOR_VERSION "1")
-        set(${ICU_PUBLIC_VAR_NS}_MINOR_VERSION "${CMAKE_MATCH_1}")
-        set(${ICU_PUBLIC_VAR_NS}_PATCH_VERSION "0")
-    elseif(${ICU_PRIVATE_VAR_NS}_VERSION_HEADER_CONTENTS MATCHES ".*# *define *U_ICU_VERSION_MAJOR_NUM *([0-9]+).*")
-        set(${ICU_PUBLIC_VAR_NS}_MAJOR_VERSION "${CMAKE_MATCH_1}")
-        #
-        # Since version 4.9.1, ICU release version numbering was totaly changed, see:
-        # - http://site.icu-project.org/download/49
-        # - http://userguide.icu-project.org/design#TOC-Version-Numbers-in-ICU
-        #
-        if(${ICU_PUBLIC_VAR_NS}_MAJOR_VERSION LESS 49)
-            string(REGEX REPLACE ".*# *define *U_ICU_VERSION_MINOR_NUM *([0-9]+).*" "\\1" ${ICU_PUBLIC_VAR_NS}_MINOR_VERSION "${${ICU_PRIVATE_VAR_NS}_VERSION_HEADER_CONTENTS}")
-            string(REGEX REPLACE ".*# *define *U_ICU_VERSION_PATCHLEVEL_NUM *([0-9]+).*" "\\1" ${ICU_PUBLIC_VAR_NS}_PATCH_VERSION "${${ICU_PRIVATE_VAR_NS}_VERSION_HEADER_CONTENTS}")
-        else(${ICU_PUBLIC_VAR_NS}_MAJOR_VERSION LESS 49)
-            string(REGEX MATCH [0-9]$ ${ICU_PUBLIC_VAR_NS}_MINOR_VERSION "${${ICU_PUBLIC_VAR_NS}_MAJOR_VERSION}")
-            string(REGEX REPLACE [0-9]$ "" ${ICU_PUBLIC_VAR_NS}_MAJOR_VERSION "${${ICU_PUBLIC_VAR_NS}_MAJOR_VERSION}")
-            string(REGEX REPLACE ".*# *define *U_ICU_VERSION_MINOR_NUM *([0-9]+).*" "\\1" ${ICU_PUBLIC_VAR_NS}_PATCH_VERSION "${${ICU_PRIVATE_VAR_NS}_VERSION_HEADER_CONTENTS}")
-        endif(${ICU_PUBLIC_VAR_NS}_MAJOR_VERSION LESS 49)
-    elseif(${ICU_PRIVATE_VAR_NS}_VERSION_HEADER_CONTENTS MATCHES ".*# *define *U_ICU_VERSION *\"(([0-9]+)(\\.[0-9]+)*)\".*") # ICU [1.4;1.8[
-        # [1.4;1.8[ as #define U_ICU_VERSION "1.4.1.2" but it seems that some 1.4.1(?:\.\d)? have releasing error and appears as 1.4.0
-        set(${ICU_PRIVATE_VAR_NS}_FULL_VERSION "${CMAKE_MATCH_1}") # copy CMAKE_MATCH_1, no longer valid on the following if
-        if(${ICU_PRIVATE_VAR_NS}_FULL_VERSION MATCHES "^([0-9]+)\\.([0-9]+)$")
-            set(${ICU_PUBLIC_VAR_NS}_MAJOR_VERSION "${CMAKE_MATCH_1}")
-            set(${ICU_PUBLIC_VAR_NS}_MINOR_VERSION "${CMAKE_MATCH_2}")
-            set(${ICU_PUBLIC_VAR_NS}_PATCH_VERSION "0")
-        elseif(${ICU_PRIVATE_VAR_NS}_FULL_VERSION MATCHES "^([0-9]+)\\.([0-9]+)\\.([0-9]+)")
-            set(${ICU_PUBLIC_VAR_NS}_MAJOR_VERSION "${CMAKE_MATCH_1}")
-            set(${ICU_PUBLIC_VAR_NS}_MINOR_VERSION "${CMAKE_MATCH_2}")
-            set(${ICU_PUBLIC_VAR_NS}_PATCH_VERSION "${CMAKE_MATCH_3}")
-        endif()
-    else()
-        message(FATAL_ERROR "failed to detect ICU version")
-    endif()
-    set(${ICU_PUBLIC_VAR_NS}_VERSION "${${ICU_PUBLIC_VAR_NS}_MAJOR_VERSION}.${${ICU_PUBLIC_VAR_NS}_MINOR_VERSION}.${${ICU_PUBLIC_VAR_NS}_PATCH_VERSION}")
-    ########## </part to keep synced with tests/version/CMakeLists.txt> ##########
-
-    # Check dependencies (implies pkg-config)
-    if(PKG_CONFIG_FOUND)
-        set(${ICU_PRIVATE_VAR_NS}_COMPONENTS_DUP ${${ICU_PUBLIC_VAR_NS}_FIND_COMPONENTS})
-        foreach(${ICU_PRIVATE_VAR_NS}_COMPONENT ${${ICU_PRIVATE_VAR_NS}_COMPONENTS_DUP})
-            pkg_check_modules(PC_ICU_PRIVATE_VAR_NS "icu-${${ICU_PRIVATE_VAR_NS}_COMPONENT}" QUIET)
-
-            if(${PC_ICU_PRIVATE_VAR_NS}_FOUND)
-                foreach(${PC_ICU_PRIVATE_VAR_NS}_LIBRARY ${PC_ICU_LIBRARIES})
-                    string(REGEX REPLACE "^icu" "" ${PC_ICU_PRIVATE_VAR_NS}_STRIPPED_LIBRARY ${${PC_ICU_PRIVATE_VAR_NS}_LIBRARY})
-                    list(APPEND ${ICU_PUBLIC_VAR_NS}_FIND_COMPONENTS ${${PC_ICU_PRIVATE_VAR_NS}_STRIPPED_LIBRARY})
-                endforeach(${PC_ICU_PRIVATE_VAR_NS}_LIBRARY)
-            endif(${PC_ICU_PRIVATE_VAR_NS}_FOUND)
-        endforeach(${ICU_PRIVATE_VAR_NS}_COMPONENT)
-        list(REMOVE_DUPLICATES ${ICU_PUBLIC_VAR_NS}_FIND_COMPONENTS)
-    endif(PKG_CONFIG_FOUND)
-
-    # Check libraries
-    foreach(${ICU_PRIVATE_VAR_NS}_COMPONENT ${${ICU_PUBLIC_VAR_NS}_FIND_COMPONENTS})
-        set(${ICU_PRIVATE_VAR_NS}_POSSIBLE_RELEASE_NAMES )
-        set(${ICU_PRIVATE_VAR_NS}_POSSIBLE_DEBUG_NAMES )
-        foreach(${ICU_PRIVATE_VAR_NS}_BASE_NAME ${${ICU_PRIVATE_VAR_NS}_COMPONENTS_${${ICU_PRIVATE_VAR_NS}_COMPONENT}})
-            list(APPEND ${ICU_PRIVATE_VAR_NS}_POSSIBLE_RELEASE_NAMES "${${ICU_PRIVATE_VAR_NS}_BASE_NAME}")
-            list(APPEND ${ICU_PRIVATE_VAR_NS}_POSSIBLE_DEBUG_NAMES "${${ICU_PRIVATE_VAR_NS}_BASE_NAME}d")
-            list(APPEND ${ICU_PRIVATE_VAR_NS}_POSSIBLE_RELEASE_NAMES "${${ICU_PRIVATE_VAR_NS}_BASE_NAME}${ICU_MAJOR_VERSION}${ICU_MINOR_VERSION}")
-            list(APPEND ${ICU_PRIVATE_VAR_NS}_POSSIBLE_DEBUG_NAMES "${${ICU_PRIVATE_VAR_NS}_BASE_NAME}${ICU_MAJOR_VERSION}${ICU_MINOR_VERSION}d")
-        endforeach(${ICU_PRIVATE_VAR_NS}_BASE_NAME)
-
-        find_library(
-            ${ICU_PRIVATE_VAR_NS}_LIB_RELEASE_${${ICU_PRIVATE_VAR_NS}_COMPONENT}
-            NAMES ${${ICU_PRIVATE_VAR_NS}_POSSIBLE_RELEASE_NAMES}
-            HINTS ${${ICU_PRIVATE_VAR_NS}_ROOT}
-            PATH_SUFFIXES ${_ICU_LIB_SUFFIXES}
-            DOC "Release libraries for ICU"
-        )
-        find_library(
-            ${ICU_PRIVATE_VAR_NS}_LIB_DEBUG_${${ICU_PRIVATE_VAR_NS}_COMPONENT}
-            NAMES ${${ICU_PRIVATE_VAR_NS}_POSSIBLE_DEBUG_NAMES}
-            HINTS ${${ICU_PRIVATE_VAR_NS}_ROOT}
-            PATH_SUFFIXES ${_ICU_LIB_SUFFIXES}
-            DOC "Debug libraries for ICU"
-        )
-
-        string(TOUPPER "${${ICU_PRIVATE_VAR_NS}_COMPONENT}" ${ICU_PRIVATE_VAR_NS}_UPPER_COMPONENT)
-        if(NOT ${ICU_PRIVATE_VAR_NS}_LIB_RELEASE_${${ICU_PRIVATE_VAR_NS}_COMPONENT} AND NOT ${ICU_PRIVATE_VAR_NS}_LIB_DEBUG_${${ICU_PRIVATE_VAR_NS}_COMPONENT}) # both not found
-            set("${ICU_PUBLIC_VAR_NS}_${${ICU_PRIVATE_VAR_NS}_UPPER_COMPONENT}_FOUND" FALSE)
-            set("${ICU_PUBLIC_VAR_NS}_FOUND" FALSE)
-        else(NOT ${ICU_PRIVATE_VAR_NS}_LIB_RELEASE_${${ICU_PRIVATE_VAR_NS}_COMPONENT} AND NOT ${ICU_PRIVATE_VAR_NS}_LIB_DEBUG_${${ICU_PRIVATE_VAR_NS}_COMPONENT}) # one or both found
-            set("${ICU_PUBLIC_VAR_NS}_${${ICU_PRIVATE_VAR_NS}_UPPER_COMPONENT}_FOUND" TRUE)
-            if(NOT ${ICU_PRIVATE_VAR_NS}_LIB_RELEASE_${${ICU_PRIVATE_VAR_NS}_COMPONENT}) # release not found => we are in debug
-                set(${ICU_PRIVATE_VAR_NS}_LIB_${${ICU_PRIVATE_VAR_NS}_COMPONENT} "${${ICU_PRIVATE_VAR_NS}_LIB_DEBUG_${${ICU_PRIVATE_VAR_NS}_COMPONENT}}")
-            elseif(NOT ${ICU_PRIVATE_VAR_NS}_LIB_DEBUG_${${ICU_PRIVATE_VAR_NS}_COMPONENT}) # debug not found => we are in release
-                set(${ICU_PRIVATE_VAR_NS}_LIB_${${ICU_PRIVATE_VAR_NS}_COMPONENT} "${${ICU_PRIVATE_VAR_NS}_LIB_RELEASE_${${ICU_PRIVATE_VAR_NS}_COMPONENT}}")
-            else() # both found
-                set(
-                    ${ICU_PRIVATE_VAR_NS}_LIB_${${ICU_PRIVATE_VAR_NS}_COMPONENT}
-                    optimized ${${ICU_PRIVATE_VAR_NS}_LIB_RELEASE_${${ICU_PRIVATE_VAR_NS}_COMPONENT}}
-                    debug ${${ICU_PRIVATE_VAR_NS}_LIB_DEBUG_${${ICU_PRIVATE_VAR_NS}_COMPONENT}}
-                )
-            endif()
-            list(APPEND ${ICU_PUBLIC_VAR_NS}_LIBRARIES ${${ICU_PRIVATE_VAR_NS}_LIB_${${ICU_PRIVATE_VAR_NS}_COMPONENT}})
-        endif(NOT ${ICU_PRIVATE_VAR_NS}_LIB_RELEASE_${${ICU_PRIVATE_VAR_NS}_COMPONENT} AND NOT ${ICU_PRIVATE_VAR_NS}_LIB_DEBUG_${${ICU_PRIVATE_VAR_NS}_COMPONENT})
-    endforeach(${ICU_PRIVATE_VAR_NS}_COMPONENT)
-endif(${ICU_PUBLIC_VAR_NS}_INCLUDE_DIRS)
-
-if(${ICU_PUBLIC_VAR_NS}_INCLUDE_DIRS)
-    include(FindPackageHandleStandardArgs)
-    if(${ICU_PUBLIC_VAR_NS}_FIND_REQUIRED AND NOT ${ICU_PUBLIC_VAR_NS}_FIND_QUIETLY)
-        find_package_handle_standard_args(
-            ${ICU_PUBLIC_VAR_NS}
-            REQUIRED_VARS ${ICU_PUBLIC_VAR_NS}_LIBRARIES ${ICU_PUBLIC_VAR_NS}_INCLUDE_DIRS
-            VERSION_VAR ${ICU_PUBLIC_VAR_NS}_VERSION
-        )
-    else(${ICU_PUBLIC_VAR_NS}_FIND_REQUIRED AND NOT ${ICU_PUBLIC_VAR_NS}_FIND_QUIETLY)
-        find_package_handle_standard_args(${ICU_PUBLIC_VAR_NS} "ICU not found" ${ICU_PUBLIC_VAR_NS}_LIBRARIES ${ICU_PUBLIC_VAR_NS}_INCLUDE_DIRS)
-    endif(${ICU_PUBLIC_VAR_NS}_FIND_REQUIRED AND NOT ${ICU_PUBLIC_VAR_NS}_FIND_QUIETLY)
-else(${ICU_PUBLIC_VAR_NS}_INCLUDE_DIRS)
-    if(${ICU_PUBLIC_VAR_NS}_FIND_REQUIRED AND NOT ${ICU_PUBLIC_VAR_NS}_FIND_QUIETLY)
-        message(FATAL_ERROR "Could not find ICU include directory")
-    endif(${ICU_PUBLIC_VAR_NS}_FIND_REQUIRED AND NOT ${ICU_PUBLIC_VAR_NS}_FIND_QUIETLY)
-endif(${ICU_PUBLIC_VAR_NS}_INCLUDE_DIRS)
-
-mark_as_advanced(
-    ${ICU_PUBLIC_VAR_NS}_INCLUDE_DIRS
-    ${ICU_PUBLIC_VAR_NS}_LIBRARIES
-)
-
-# IN (args)
-icudebug("FIND_COMPONENTS")
-icudebug("FIND_REQUIRED")
-icudebug("FIND_QUIETLY")
-icudebug("FIND_VERSION")
-# OUT
-# Found
-icudebug("FOUND")
-icudebug("UC_FOUND")
-icudebug("I18N_FOUND")
-icudebug("IO_FOUND")
-icudebug("LE_FOUND")
-icudebug("LX_FOUND")
-icudebug("DATA_FOUND")
-# Linking
-icudebug("INCLUDE_DIRS")
-icudebug("LIBRARIES")
-# Version
-icudebug("MAJOR_VERSION")
-icudebug("MINOR_VERSION")
-icudebug("PATCH_VERSION")
-icudebug("VERSION")
diff --git a/cmake/FindInstallConfigPath.cmake b/cmake/FindInstallConfigPath.cmake
new file mode 100644 (file)
index 0000000..62dadb4
--- /dev/null
@@ -0,0 +1,20 @@
+# 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)
+    if(NOT QT_QMAKE_EXECUTABLE)
+        message(FATAL_ERROR "LXQT_ETC_XDG_DIR: qmake not found or wrongly detected (inlude before qt 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 ()
+
diff --git a/cmake/FindPulseAudio.cmake b/cmake/FindPulseAudio.cmake
deleted file mode 100644 (file)
index 35bcbc2..0000000
+++ /dev/null
@@ -1,71 +0,0 @@
-# Try to find the PulseAudio library
-#
-# Once done this will define:
-#
-#  PULSEAUDIO_FOUND - system has the PulseAudio library
-#  PULSEAUDIO_INCLUDE_DIR - the PulseAudio include directory
-#  PULSEAUDIO_LIBRARY - the libraries needed to use PulseAudio
-#  PULSEAUDIO_MAINLOOP_LIBRARY - the libraries needed to use PulsAudio Mainloop
-#
-# The minimum required version of PulseAudio can be specified using the
-# standard syntax, e.g. find_package(PulseAudio 1.0)
-
-# Copyright (c) 2008, Matthias Kretz, <kretz@kde.org>
-# Copyright (c) 2009, Marcus Hufgard, <Marcus.Hufgard@hufgard.de>
-#
-# Redistribution and use is allowed according to the terms of the BSD license.
-# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
-
-# Support PULSEAUDIO_MINIMUM_VERSION for compatibility:
-if(NOT PulseAudio_FIND_VERSION)
-  set(PulseAudio_FIND_VERSION "${PULSEAUDIO_MINIMUM_VERSION}")
-endif(NOT PulseAudio_FIND_VERSION)
-
-# the minimum version of PulseAudio we require
-if(NOT PulseAudio_FIND_VERSION)
-  set(PulseAudio_FIND_VERSION "0.9.9")
-endif(NOT PulseAudio_FIND_VERSION)
-
-if (NOT WIN32)
-   include(FindPkgConfig)
-   pkg_check_modules(PC_PULSEAUDIO QUIET libpulse>=${PulseAudio_FIND_VERSION})
-   pkg_check_modules(PC_PULSEAUDIO_MAINLOOP QUIET libpulse-mainloop-glib)
-endif (NOT WIN32)
-
-find_path(PULSEAUDIO_INCLUDE_DIR pulse/pulseaudio.h
-   HINTS
-   ${PC_PULSEAUDIO_INCLUDEDIR}
-   ${PC_PULSEAUDIO_INCLUDE_DIRS}
-   )
-
-find_library(PULSEAUDIO_LIBRARY NAMES pulse libpulse
-   HINTS
-   ${PC_PULSEAUDIO_LIBDIR}
-   ${PC_PULSEAUDIO_LIBRARY_DIRS}
-   )
-
-find_library(PULSEAUDIO_MAINLOOP_LIBRARY NAMES pulse-mainloop pulse-mainloop-glib libpulse-mainloop-glib
-   HINTS
-   ${PC_PULSEAUDIO_LIBDIR}
-   ${PC_PULSEAUDIO_LIBRARY_DIRS}
-   )
-
-# Store the version number in the cache, so we don't have to search every time again:
-if (PULSEAUDIO_INCLUDE_DIR  AND NOT  PULSEAUDIO_VERSION)
-
-   # get PulseAudio's version from its version.h, and compare it with our minimum version
-   file(STRINGS "${PULSEAUDIO_INCLUDE_DIR}/pulse/version.h" pulse_version_h
-        REGEX ".*pa_get_headers_version\\(\\).*"
-        )
-   string(REGEX REPLACE ".*pa_get_headers_version\\(\\)\ \\(\"([0-9]+\\.[0-9]+\\.[0-9]+)[^\"]*\"\\).*" "\\1"
-                         _PULSEAUDIO_VERSION "${pulse_version_h}")
-
-   set(PULSEAUDIO_VERSION "${_PULSEAUDIO_VERSION}" CACHE STRING "Version number of PulseAudio" FORCE)
-endif (PULSEAUDIO_INCLUDE_DIR  AND NOT  PULSEAUDIO_VERSION)
-
-# Use the new extended syntax of find_package_handle_standard_args(), which also handles version checking:
-include(FindPackageHandleStandardArgs)
-find_package_handle_standard_args(PulseAudio REQUIRED_VARS PULSEAUDIO_LIBRARY PULSEAUDIO_INCLUDE_DIR
-                                             VERSION_VAR PULSEAUDIO_VERSION )
-
-mark_as_advanced(PULSEAUDIO_INCLUDE_DIR PULSEAUDIO_LIBRARY PULSEAUDIO_MAINLOOP_LIBRARY)
diff --git a/cmake/FindUDev.cmake b/cmake/FindUDev.cmake
deleted file mode 100644 (file)
index 866608d..0000000
+++ /dev/null
@@ -1,53 +0,0 @@
-# razor-de: Configure libudev environment
-#
-# UDEV_FOUND - system has a libudev
-# UDEV_INCLUDE_DIR - where to find header files
-# UDEV_LIBRARIES - the libraries to link against udev
-# UDEV_STABLE - it's true when is the version greater or equals to 143 - version when the libudev was stabilized in its API
-#
-# copyright (c) 2011 Petr Vanek <petr@scribus.info>
-# Redistribution and use is allowed according to the terms of the BSD license.
-#
-
-FIND_PATH(
-    UDEV_INCLUDE_DIR
-    libudev.h
-    /usr/include
-    /usr/local/include
-    ${UDEV_PATH_INCLUDES}
-)
-
-FIND_LIBRARY(
-    UDEV_LIBRARIES
-    NAMES udev libudev
-    PATHS
-        /usr/lib${LIB_SUFFIX}
-        /usr/local/lib${LIB_SUFFIX}
-        ${UDEV_PATH_LIB}
-)
-
-IF (UDEV_LIBRARIES AND UDEV_INCLUDE_DIR)
-    SET(UDEV_FOUND "YES")
-    execute_process(COMMAND pkg-config --atleast-version=143 libudev RESULT_VARIABLE UDEV_STABLE)
-    # retvale is 0 of the condition is "true" so we need to negate the value...
-    if (UDEV_STABLE)
-       set(UDEV_STABLE 0)
-    else (UDEV_STABLE)
-       set(UDEV_STABLE 1)
-    endif (UDEV_STABLE)
-    message(STATUS "libudev stable: ${UDEV_STABLE}")
-ENDIF (UDEV_LIBRARIES AND UDEV_INCLUDE_DIR)
-
-IF (UDEV_FOUND)
-    MESSAGE(STATUS "Found UDev: ${UDEV_LIBRARIES}")
-    MESSAGE(STATUS "   include: ${UDEV_INCLUDE_DIR}")
-ELSE (UDEV_FOUND)
-    MESSAGE(STATUS "UDev not found.")
-    MESSAGE(STATUS "UDev: You can specify includes: -DUDEV_PATH_INCLUDES=/opt/udev/include")
-    MESSAGE(STATUS "      currently found includes: ${UDEV_INCLUDE_DIR}")
-    MESSAGE(STATUS "UDev: You can specify libs: -DUDEV_PATH_LIB=/opt/udev/lib")
-    MESSAGE(STATUS "      currently found libs: ${UDEV_LIBRARIES}")
-    IF (UDev_FIND_REQUIRED)
-        MESSAGE(FATAL_ERROR "Could not find UDev library")
-    ENDIF (UDev_FIND_REQUIRED)
-ENDIF (UDEV_FOUND)
diff --git a/cmake/RazorInstallConfigPath.cmake b/cmake/RazorInstallConfigPath.cmake
deleted file mode 100644 (file)
index f7a8b99..0000000
+++ /dev/null
@@ -1,25 +0,0 @@
-# XDG standards expects system-wide configuration files in the /etc/xdg/razor 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 RAZOR_ETC_XDG_DIRECTORY)
-    message(STATUS "*********************************************************************")
-    message(STATUS "RAZOR_ETC_XDG_DIRECTORY will be autodetected now")
-    message(STATUS "You can set it manually with -DRAZOR_ETC_XDG_DIRECTORY=<value>")
-
-    if (NOT QT_QMAKE_EXECUTABLE)
-        message(FATAL_ERROR "RAZOR_ETC_XDG_DIRECTORY: qmake not found or wrongly detected (inlude before qt configured?)")
-    endif (NOT QT_QMAKE_EXECUTABLE)
-
-    execute_process(COMMAND ${QT_QMAKE_EXECUTABLE} -query QT_INSTALL_CONFIGURATION
-                           OUTPUT_VARIABLE RAZOR_ETC_XDG_DIRECTORY
-                           OUTPUT_STRIP_TRAILING_WHITESPACE)
-
-    message(STATUS "RAZOR_ETC_XDG_DIRECTORY autodetected as '${RAZOR_ETC_XDG_DIRECTORY}'")
-    message(STATUS "*********************************************************************")
-else ()
-    message(STATUS "RAZOR_ETC_XDG_DIRECTORY already set: ${RAZOR_ETC_XDG_DIRECTORY}")
-endif ()
-
diff --git a/cmake/RazorLibSuffix.cmake b/cmake/RazorLibSuffix.cmake
deleted file mode 100644 (file)
index c321670..0000000
+++ /dev/null
@@ -1,28 +0,0 @@
-# some system (rpm builds) setup LIB_SUFFIX for cmake. If there is no set, try to get it from system
-IF (NOT DEFINED LIB_SUFFIX AND NOT DEFINED LIB_SUFFIX_ALREADY_SET)
-    MESSAGE(STATUS "*********************************************************************")
-    MESSAGE(STATUS "LIB_SUFFIX variable is not defined. It will be autodetected now")
-    MESSAGE(STATUS "You can set it manually with -DLIB_SUFFIX=<value> (64 for example)")
-
-    # All 32bit system have empty lib suffix
-    if(CMAKE_SIZEOF_VOID_P EQUAL 8)
-        # If there is lib64 dir, set suffix to 64
-        if(IS_DIRECTORY ${CMAKE_INSTALL_PREFIX}/lib64)
-            set(LIB_SUFFIX 64)
-        elseif(IS_DIRECTORY ${CMAKE_INSTALL_PREFIX}/lib)
-            set(LIB_SUFFIX "")
-        else()
-            message(WARNING "LIB_SUFFIX cannot be autodetected. No ${CMAKE_INSTALL_PREFIX}/lib neither ${CMAKE_INSTALL_PREFIX}/lib64 found.")
-            set(LIB_SUFFIX "")
-        endif()
-    else()
-        set(LIB_SUFFIX "")
-    endif()
-    
-    set(LIB_SUFFIX_ALREADY_SET 1)
-
-    message(STATUS "LIB_SUFFIX autodetected as '${LIB_SUFFIX}', libraries will be installed into ${CMAKE_INSTALL_PREFIX}/lib${LIB_SUFFIX}")
-    MESSAGE(STATUS "*********************************************************************")
-else ()
-    message(STATUS "LIB_SUFFIX already set: ${LIB_SUFFIX}")
-ENDIF ()
diff --git a/cmake/RazorTranslate.cmake b/cmake/RazorTranslate.cmake
deleted file mode 100644 (file)
index 5bbc0b2..0000000
+++ /dev/null
@@ -1,275 +0,0 @@
-#  funtion razor_translate_ts(qm_files 
-#                           SOURCES sources ... 
-#                           [TRANSLATION_DIR] translation_directory
-#                           [INSTALLATION_DIR] qm_install_directory
-#                          )
-#     out: qm_files 
-#     generates commands to create .ts.src and .qm files from sources. 
-#     The generated filenames can be found in qm_files.
-#
-#     in: sources 
-#     List of the h, cpp and ui files
-#
-#     in: translation_directory
-#     A relative path to the directory with .ts files, it is relative 
-#     to the CMakeList.txt. By default is "translations"
-#
-#     in: qm_install_directory
-#     A full path to the directory n which will be installed .qm files.
-#     By default is "${CMAKE_INSTALL_PREFIX}/share/razor/${PROJECT_NAME}" 
-
-
-MACRO(QT4_ADD_TRANSLATION_FIXED _qm_files)
-  FOREACH (_current_FILE ${ARGN})
-    GET_FILENAME_COMPONENT(_abs_FILE ${_current_FILE} ABSOLUTE)
-    GET_FILENAME_COMPONENT(qm ${_abs_FILE} NAME)
-    #Extract the real extension ............
-    STRING(REPLACE ".ts" "" qm ${qm})
-    GET_SOURCE_FILE_PROPERTY(output_location ${_abs_FILE} OUTPUT_LOCATION)
-    IF(output_location)
-      FILE(MAKE_DIRECTORY "${output_location}")
-      SET(qm "${output_location}/${qm}.qm")
-    ELSE(output_location)
-      SET(qm "${CMAKE_CURRENT_BINARY_DIR}/${qm}.qm")
-    ENDIF(output_location)
-
-    ADD_CUSTOM_COMMAND(OUTPUT ${qm}
-       COMMAND ${QT_LRELEASE_EXECUTABLE}
-       ARGS -silent -removeidentical ${_abs_FILE} -qm ${qm}
-       DEPENDS ${_abs_FILE}
-    )
-    SET(${_qm_files} ${${_qm_files}} ${qm})
-  ENDFOREACH (_current_FILE)
-ENDMACRO(QT4_ADD_TRANSLATION_FIXED)
-
-if(NOT TARGET UpdateTsFiles)
-  add_custom_target(UpdateTsFiles DEPENDS)
-endif()
-
-if(NOT TARGET UpdateTxFile)
-  file(WRITE ${CMAKE_BINARY_DIR}/tx/_updateTxFile.sh
-        "echo '[main]'\n"
-        "echo 'host = https://www.transifex.com'\n"
-        "echo 'minimum_perc = 1'\n"
-        "echo ''\n"
-        "for f in `ls ${CMAKE_BINARY_DIR}/tx/*.tx.sh`; do\n"
-        " sh $f;\n"
-        "done\n"
-      )
-
-  add_custom_target(UpdateTxFile  
-    COMMAND sh ${CMAKE_BINARY_DIR}/tx/_updateTxFile.sh > ${CMAKE_SOURCE_DIR}/.tx/config
-  )
-endif()
-
-
-function(razor_translate_ts _qmFiles)
-    set(_translationDir "translations")
-    set(_installDir "${CMAKE_INSTALL_PREFIX}/share/razor/${PROJECT_NAME}")
-    
-    # Parse arguments ***************************************
-    set(_state "")
-    foreach (_arg ${ARGN})
-        if (
-            ("${_arg}_I_HATE_CMAKE" STREQUAL "SOURCES_I_HATE_CMAKE") OR
-            ("${_arg}_I_HATE_CMAKE" STREQUAL "TRANSLATION_DIR_I_HATE_CMAKE") OR
-            ("${_arg}_I_HATE_CMAKE" STREQUAL "INSTALLATION_DIR_I_HATE_CMAKE") OR
-            ("${_arg}_I_HATE_CMAKE" STREQUAL "TS_SRC_FILE_I_HATE_CMAKE")        
-           )        
-            set(_state ${_arg})
-      
-        else()
-            if("${_state}" STREQUAL "SOURCES")
-                get_filename_component (__file ${_arg} ABSOLUTE)
-                set(_sources  ${_sources} ${__file})
-                set(_sourcesSpace  "${_sourcesSpace} ${__file}")
-            elseif("${_state}" STREQUAL "TRANSLATION_DIR")
-                set(_translationDir ${_arg})       
-                set(_state "")
-
-            elseif("${_state}" STREQUAL "INSTALLATION_DIR")
-                set(_installDir ${_arg})       
-                set(_state "")
-
-            elseif("${_state}" STREQUAL "TS_SRC_FILE")
-                set(_tsSrcFile ${_arg})       
-                set(_state "")
-        
-            else()  
-                MESSAGE(FATAL_ERROR 
-                  "Unknown argument '${_arg}'.\n"
-                  "See ${CMAKE_CURRENT_LIST_FILE} for more information.\n"
-                )
-            endif()  
-        endif()
-    endforeach(_arg)
-
-    get_filename_component (_translationDir ${_translationDir} ABSOLUTE)
-    if ("${_tsSrcFile}" STREQUAL "") 
-        set(_tsSrcFile  "${_translationDir}/${PROJECT_NAME}.ts.src")
-    endif()
-    
-    get_filename_component (_tsSrcFile  ${_tsSrcFile} ABSOLUTE)
-    get_filename_component (_tsSrcFileName  ${_tsSrcFile} NAME)
-    get_filename_component (_tsSrcFileNameWE  ${_tsSrcFile} NAME_WE)
-      
-    # TS.SRC file *******************************************    
-    file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/updateTsFile.sh
-        "#/bin/sh\n"
-        "\n"
-        "mkdir -p ${_translationDir} 2>/dev/null\n"
-        "cd ${_translationDir} && "
-        "${QT_LUPDATE_EXECUTABLE} -locations none -target-language en_US ${_sourcesSpace} -ts ${_tsSrcFile}.ts &&"
-        "mv ${_tsSrcFile}.ts ${_tsSrcFile}\n"
-        "grep -q 'source' '${_tsSrcFile}' || rm '${_tsSrcFile}'\n"
-    )
-
-    add_custom_target(Update_${_tsSrcFileName}
-        COMMAND sh ${CMAKE_CURRENT_BINARY_DIR}/updateTsFile.sh
-        DEPENDS ${_sources}
-        VERBATIM
-    )
-  
-    add_dependencies(UpdateTsFiles Update_${_tsSrcFileName})
-    
-    # TX file ***********************************************
-    set(_txFile "${CMAKE_BINARY_DIR}/tx/${_tsSrcFileName}.tx.sh")
-    string(REPLACE "${CMAKE_SOURCE_DIR}/" "" _tx_translationDir ${_translationDir})
-    string(REPLACE "${CMAKE_SOURCE_DIR}/" "" _tx_tsSrcFile ${_tsSrcFile})
-    
-    file(WRITE ${_txFile}
-        "[ -f ${_tsSrcFile} ] || exit 0\n"
-        "echo '[razor-qt.${_tsSrcFileNameWE}]'\n"
-        "echo 'type = QT'\n"
-        "echo 'source_lang = en'\n"
-        "echo 'source_file = ${_tx_tsSrcFile}'\n"
-        "echo 'file_filter = ${_tx_translationDir}/${_tsSrcFileNameWE}_<lang>.ts'\n"
-        "echo ''\n"
-    )
-
-    # translate.h file *************************************
-    file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/razortranslate.h
-        "#ifndef RAZOR_TRANSLATE_H\n"
-        "#include <QtCore/QLocale>\n"
-        "#include <QtCore/QTranslator>\n"
-        "#include <QtCore/QLibraryInfo>\n"
-        "class RazorTranslator {\n"
-        "public:\n"
-        "  static void translate()\n"
-        "  {\n"
-        "    QString locale = QLocale::system().name();\n"
-
-        "    QTranslator *qtTranslator = new QTranslator(qApp);\n"
-        "    qtTranslator->load(\"qt_\" + locale, QLibraryInfo::location(QLibraryInfo::TranslationsPath));\n"
-        "    qApp->installTranslator(qtTranslator);\n"
-
-        "    QTranslator *appTranslator = new QTranslator(qApp);\n"
-        "    appTranslator->load(QString(\"${_installDir}/${PROJECT_NAME}_%1.qm\").arg(locale));\n"
-        "    qApp->installTranslator(appTranslator);\n"
-        "  }\n"
-        "};\n"
-
-        "#define TRANSLATE_APP  RazorTranslator::translate();\n"
-        "#endif // RAZOR_TRANSLATE_H\n"
-    )
-
-    # QM files **********************************************    
-    file(GLOB _tsFiles ${_translationDir}/${_tsSrcFileNameWE}_*.ts)    
-    QT4_ADD_TRANSLATION_FIXED(_qmFilesLocal ${_tsFiles})
-    install(FILES ${_qmFilesLocal} DESTINATION ${_installDir})
-    
-    set(${_qmFiles} ${_qmFilesLocal} PARENT_SCOPE)
-endfunction(razor_translate_ts)
-
-
-#**********************************************************
-# DESKTOP files
-#**********************************************************
-
-function(razor_translate_desktop _RESULT)
-    set(_translationDir "translations")
-    
-    # Parse arguments ***************************************
-    set(_state "")
-    foreach (_arg ${ARGN})  
-        if (
-            ("${_arg}_I_HATE_CMAKE" STREQUAL "SOURCES_I_HATE_CMAKE") OR
-            ("${_arg}_I_HATE_CMAKE" STREQUAL "TRANSLATION_DIR_I_HATE_CMAKE")
-           )        
-
-            set(_state ${_arg})
-      
-        else()
-            if("${_state}" STREQUAL "SOURCES")
-                get_filename_component (__file ${_arg} ABSOLUTE)
-                set(_sources  ${_sources} ${__file})
-                #set(_sources  ${_sources} ${_arg})
-            elseif("${_state}" STREQUAL "TRANSLATION_DIR")
-                set(_translationDir ${_arg})       
-                set(_state "")
-
-            else()  
-                MESSAGE(FATAL_ERROR 
-                  "Unknown argument '${_arg}'.\n"
-                  "See ${CMAKE_CURRENT_LIST_FILE} for more information.\n"
-                )
-            endif()  
-        endif()
-    endforeach(_arg)    
-
-    get_filename_component (_translationDir ${_translationDir} ABSOLUTE)    
-    
-    foreach (_inFile ${_sources})
-        get_filename_component(_inFile   ${_inFile} ABSOLUTE)
-        get_filename_component(_fileName ${_inFile} NAME_WE)
-        #Extract the real extension ............
-        get_filename_component(_fileExt  ${_inFile} EXT)
-        string(REPLACE ".in" "" _fileExt ${_fileExt})
-        #.......................................
-        set(_outFile "${CMAKE_CURRENT_BINARY_DIR}/${_fileName}${_fileExt}")
-
-        file(GLOB _translations
-            ${_translationDir}/${_fileName}_*${_fileExt}
-            ${_translationDir}/local/${_fileName}_*${_fileExt}
-        )    
-  
-        set(_pattern "'\\[.*]\\s*='")
-        if (_translations)
-            add_custom_command(OUTPUT ${_outFile}
-                COMMAND grep -v "'#TRANSLATIONS_DIR='" ${_inFile} > ${_outFile}
-                COMMAND grep --no-filename ${_pattern} ${_translations} >> ${_outFile}
-                COMMENT "Generating ${_fileName}${_fileExt}"
-            )
-        else()
-            add_custom_command(OUTPUT ${_outFile}
-                COMMAND grep -v "'#TRANSLATIONS_DIR='" ${_inFile} > ${_outFile}
-                COMMENT "Generating ${_fileName}${_fileExt}"
-            )
-        endif()
-
-        set(__result ${__result} ${_outFile}) 
-
-
-        # TX file ***********************************************
-        set(_txFile "${CMAKE_BINARY_DIR}/tx/${_fileName}${_fileExt}.tx.sh")
-        string(REPLACE "${CMAKE_SOURCE_DIR}/" "" _tx_translationDir ${_translationDir})
-        string(REPLACE "${CMAKE_SOURCE_DIR}/" "" _tx_inFile ${_inFile})
-        string(REPLACE "." "" _fileType ${_fileExt})
-    
-        file(WRITE ${_txFile}
-            "[ -f ${_inFile} ] || exit 0\n"
-            "echo '[razor-qt.${_fileName}_${_fileType}]'\n"
-            "echo 'type = DESKTOP'\n"
-            "echo 'source_lang = en'\n"
-            "echo 'source_file = ${_tx_inFile}'\n"
-            "echo 'file_filter = ${_tx_translationDir}/${_fileName}_<lang>${_fileExt}'\n"
-            "echo ''\n"
-        )
-
-    endforeach()
-
-    set(${_RESULT} ${__result} PARENT_SCOPE)    
-endfunction(razor_translate_desktop)
-
diff --git a/cmake/cmake_uninstall.cmake.in b/cmake/cmake_uninstall.cmake.in
deleted file mode 100644 (file)
index 8c32e20..0000000
+++ /dev/null
@@ -1,19 +0,0 @@
-if(NOT EXISTS "@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt")
-       message(FATAL_ERROR "Cannot find install manifest: "@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt"")
-endif()
-
-file(READ "@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt" files)
-string(REGEX REPLACE "\n" ";" files "${files}")
-foreach(file ${files})
-       message(STATUS "Uninstalling \"$ENV{DESTDIR}${file}\"")
-       if((EXISTS "$ENV{DESTDIR}${file}") OR (IS_SYMLINK "$ENV{DESTDIR}${file}"))
-               exec_program("@CMAKE_COMMAND@" ARGS "-E remove \"$ENV{DESTDIR}${file}\""
-                       OUTPUT_VARIABLE rm_out
-                       RETURN_VALUE rm_retval)
-               if(NOT "${rm_retval}" STREQUAL 0)
-                       message(FATAL_ERROR "Problem when removing \"$ENV{DESTDIR}${file}\"")
-               endif()
-       else()
-               message(STATUS "File \"$ENV{DESTDIR}${file}\" does not exist.")
-       endif()
-endforeach()
index 2c02a9c..96ac25a 100644 (file)
@@ -6,20 +6,21 @@
 #
 macro (create_pkgconfig_file name desc)
     set(_pkgfname "${CMAKE_CURRENT_BINARY_DIR}/${name}.pc")
-    message(STATUS "${name}: writing pkgconfig file ${_pkgfname}")
+    #message(STATUS "${name}: writing pkgconfig file ${_pkgfname}")
 
-    file(WRITE "${_pkgfname}" "# file generated by razor-qt cmake build
-prefix=${CMAKE_INSTALL_PREFIX}
-libdir=\${prefix}/lib${LIB_SUFFIX}
-includedir=\${prefix}/include
-
-Name: ${name}
-Description: ${desc}
-Version: ${RAZOR_VERSION}
-Libs: -L\${libdir} -l${name}
-Cflags: -I\${includedir}
-
-")
+    file(WRITE "${_pkgfname}"
+            "# file generated by razor-qt cmake build\n"
+            "prefix=${CMAKE_INSTALL_PREFIX}\n"
+            "libdir=\${prefix}/lib${LIB_SUFFIX}\n"
+            "includedir=\${prefix}/include\n"
+            "\n"
+            "Name: ${name}\n"
+            "Description: ${desc}\n"
+            "Version: ${RAZOR_VERSION}\n"
+            "Libs: -L\${libdir} -l${name}\n"
+            "Cflags: -I\${includedir}\n"
+            "\n"
+    )
 
     install(FILES ${_pkgfname} DESTINATION lib${LIB_SUFFIX}/pkgconfig)
 endmacro()
diff --git a/cmake/lxqt-config.cmake.in b/cmake/lxqt-config.cmake.in
new file mode 100644 (file)
index 0000000..8480b99
--- /dev/null
@@ -0,0 +1,97 @@
+# - Find the lxqt include and library dirs and define a some macros
+#
+# The module defines the following variables
+#
+#  LXQT_FOUND         - Set to TRUE if all of the above has been found
+#
+#  LXQT_INCLUDE_DIR   - The lxqt include directory
+#
+#  LXQT_INCLUDE_DIRS  - The lxqt and the Qt include directory, for use with INCLUDE_DIRECTORIES()
+#
+#  LXQT_LIBRARIES     - The libraries needed to use lxqt
+#
+#  LXQT_SHARE_DIR     - This allows to install and read the configs from non-standard locations
+#
+#  LXQT_ETC_XDG_DIR   - XDG standards expects system-wide configuration files in the
+#                        /etc/xdg/razor 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
+#
+# LXQT_USE_FILE       - The variable LXQT_USE_FILE is set which is the path to a CMake file that
+#                        can be included to compile lxqt applications and libraries. It sets up
+#                        the compilation environment for include directories and populates a
+#                        LXQT_LIBRARIES variable.
+#
+# When using the components argument, LXQT_USE_* variables are automatically set
+# for the LXQT_USE_FILE to pick up.  If one wishes to manually set them, the
+# available ones to set include:
+#               LXQT_USE_MOUNT
+#               LXQT_USE_GLOBAL_KEY_CLIENT
+#
+# Typical usage could be something like:
+#   set(LXQT_USE_MOUNT 1)
+#   find_package(LXQT REQUIRED)
+#   include(${LXQT_USE_FILE})
+#
+#   razor_translate_ts(QM_FILES
+#     SOURCES
+#        ${H_FILES}
+#        ${CPP_FILES}
+#        ${UI_FILES}
+#   )
+#   razor_translate_desktop(DESKTOP_FILES
+#     SOURCES
+#        ${DESKTOP_FILES_IN}
+#  )
+#
+#   add_executable(myexe main.cpp)
+#   target_link_libraries(myexe $LXQT_LIBRARIES})
+
+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_SHARE_DIR     @LXQT_SHARE_DIR@)
+set(LXQT_ETC_XDG_DIR   @LXQT_ETC_XDG_DIR@)
+set(LXQT_INCLUDE_DIR   @LXQT_INCLUDE_DIR@)
+set(LXQT_LIBRARY       lxqt)
+
+set(LXQT_LIBRARIES     ${LXQT_LIBRARY} )
+set(LXQT_INCLUDE_DIRS  ${LXQT_INCLUDE_DIR} )
+set(LXQT_USE_FILE      ${CMAKE_CURRENT_LIST_DIR}/lxqt_use.cmake)
+set(LXQT_FOUND         1)
+
+# for backward compatability ----->
+#set(RAZOR_SHARE_DIR     ${})
+#set(RAZOR_ETC_XDG_DIR   ${})
+#set(RAZOR_INCLUDE_DIR   ${LXQT_INCLUDE_DIR})
+#set(RAZOR_INCLUDE_DIRS  ${LXQT_INCLUDE_DIRS})
+#set(RAZOR_LIBRARY       ${LXQT_LIBRARY})
+# for backward compatability <-----
+
+mark_as_advanced(LXQT_LIBRARY LXQT_INCLUDE_DIR)
+
+
+#************************************************
+# RAZOR_USE_MOUNT
+#
+#if (RAZOR_USE_MOUNT)
+#    include(${CMAKE_CURRENT_LIST_DIR}/razormount-config.cmake)
+#    set(RAZOR_INCLUDE_DIRS       ${RAZOR_INCLUDE_DIRS} ${RAZORMOUNT_INCLUDE_DIR})
+#    set(RAZOR_LIBRARIES          ${RAZOR_LIBRARIES}    ${RAZORMOUNT_LIBRARY})
+
+#endif(RAZOR_USE_MOUNT)
+
+
+#************************************************
+# RAZOR_USE_GLOBALKEYCLIENT
+#
+#if (RAZOR_USE_GLOBALKEYCLIENT)
+#    include(${CMAKE_CURRENT_LIST_DIR}/razorglobalkeyclient-config.cmake)
+#    set(RAZOR_INCLUDE_DIRS       ${RAZOR_INCLUDE_DIRS} ${RAZORGLOBALKEYCLIENT_INCLUDE_DIR})
+#    set(RAZOR_LIBRARIES          ${RAZOR_LIBRARIES}    ${RAZORGLOBALKEYCLIENT_LIBRARIES})
+
+#endif(RAZOR_USE_GLOBALKEYCLIENT)
diff --git a/cmake/lxqt_use.cmake b/cmake/lxqt_use.cmake
new file mode 100644 (file)
index 0000000..85f3207
--- /dev/null
@@ -0,0 +1,329 @@
+# - Find the LXQt include and library dirs and define a some macros
+#
+# The module defines the following functions
+#
+# razor_translate_ts(qm_files
+#                    SOURCES sources ...
+#                    [TRANSLATION_DIR] translation_directory
+#                    [INSTALLATION_DIR] qm_install_directory
+#                   )
+#     out: qm_files
+#     generates commands to create .ts.src and .qm files from sources.
+#     The generated filenames can be found in qm_files.
+#
+#     in: sources
+#     List of the h, cpp and ui files
+#
+#     in: translation_directory
+#     A relative path to the directory with .ts files, it is relative
+#     to the CMakeList.txt. By default is "translations"
+#
+#     in: qm_install_directory
+#     A full path to the directory n which will be installed .qm files.
+#     By default is "${CMAKE_INSTALL_PREFIX}/share/razor/${PROJECT_NAME}"
+#
+# razor_translate_desktop(desktop_files
+#                         SOURCES sources ...
+#                         [TRANSLATION_DIR] translation_directory
+#                        )
+#     out: desktop_files
+#     generates commands to create .desktop files from sources.
+#     The generated filenames can be found in desktop_files.
+#
+#     in: sources
+#     List of the desktop.in files
+#
+#     in: translation_directory
+#     A relative path to the directory with translations files, it is
+#     relative to the CMakeList.txt. By default is "translations"
+#
+#
+# lxqt_set_default_value(VAR_NAME VAR_VALUE)
+#
+#
+#
+# The module defines the following definitions
+#
+#  -DLXQT_SHARE_DIR      - This allows to install and read the configs from non-standard locations
+#
+#  -DLXQT_ETC_XDG_DIR    - XDG standards expects system-wide configuration files in the
+#                          /etc/xdg/razor 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
+#
+#
+#
+
+include_directories(${LXQT_INCLUDE_DIRS})
+
+#cmake_policy(SET CMP0005 NEW)
+add_definitions(-DLXQT_SHARE_DIR=\"${LXQT_SHARE_DIR}\")
+add_definitions(-DLXQT_ETC_XDG_DIR=\"${LXQT_ETC_XDG_DIR}\")
+add_definitions(-DLXQT_VERSION=\"${LXQT_VERSION}\")
+
+# for backward compatability ----->
+add_definitions(-DRAZOR_SHARE_DIR=\"${LXQT_SHARE_DIR}\")
+add_definitions(-DRAZOR_ETC_XDG_DIR=\"${LXQT_ETC_XDG_DIR}\")
+add_definitions(-DRAZOR_VERSION=\"${LXQT_VERSION}\")
+# for backward compatability <-----
+
+find_package(Qt4 REQUIRED QUIET)
+include(${QT_USE_FILE})
+
+if(NOT TARGET UpdateTsFiles)
+  add_custom_target(UpdateTsFiles DEPENDS)
+endif()
+
+MACRO(QT4_ADD_TRANSLATION_FIXED _qm_files)
+  FOREACH (_current_FILE ${ARGN})
+    GET_FILENAME_COMPONENT(_abs_FILE ${_current_FILE} ABSOLUTE)
+    GET_FILENAME_COMPONENT(qm ${_abs_FILE} NAME)
+    #Extract the real extension ............
+    STRING(REPLACE ".ts" "" qm ${qm})
+    GET_SOURCE_FILE_PROPERTY(output_location ${_abs_FILE} OUTPUT_LOCATION)
+    IF(output_location)
+      FILE(MAKE_DIRECTORY "${output_location}")
+      SET(qm "${output_location}/${qm}.qm")
+    ELSE(output_location)
+      SET(qm "${CMAKE_CURRENT_BINARY_DIR}/${qm}.qm")
+    ENDIF(output_location)
+
+    ADD_CUSTOM_COMMAND(OUTPUT ${qm}
+       COMMAND ${QT_LRELEASE_EXECUTABLE}
+       ARGS ${_abs_FILE} -qm ${qm}
+       DEPENDS ${_abs_FILE}
+    )
+    SET(${_qm_files} ${${_qm_files}} ${qm})
+  ENDFOREACH (_current_FILE)
+ENDMACRO(QT4_ADD_TRANSLATION_FIXED)
+
+
+function(razor_translate_ts _qmFiles)
+    set(_translationDir "translations")
+    set(_installDir "${CMAKE_INSTALL_PREFIX}/share/razor/${PROJECT_NAME}")
+
+    # Parse arguments ***************************************
+    set(_state "")
+    foreach (_arg ${ARGN})
+        if (
+            ("${_arg}_I_HATE_CMAKE" STREQUAL "SOURCES_I_HATE_CMAKE") OR
+            ("${_arg}_I_HATE_CMAKE" STREQUAL "TRANSLATION_DIR_I_HATE_CMAKE") OR
+            ("${_arg}_I_HATE_CMAKE" STREQUAL "INSTALLATION_DIR_I_HATE_CMAKE") OR
+            ("${_arg}_I_HATE_CMAKE" STREQUAL "TS_SRC_FILE_I_HATE_CMAKE")
+           )
+            set(_state ${_arg})
+
+        else()
+            if("${_state}" STREQUAL "SOURCES")
+                get_filename_component (__file ${_arg} ABSOLUTE)
+                set(_sources  ${_sources} ${__file})
+                set(_sourcesSpace  "${_sourcesSpace} ${__file}")
+
+            elseif("${_state}" STREQUAL "TRANSLATION_DIR")
+                set(_translationDir ${_arg})
+                set(_state "")
+
+            elseif("${_state}" STREQUAL "INSTALLATION_DIR")
+                set(_installDir ${_arg})
+                set(_state "")
+
+            elseif("${_state}" STREQUAL "TS_SRC_FILE")
+                set(_tsSrcFile ${_arg})
+                set(_state "")
+
+            else()
+                MESSAGE(FATAL_ERROR
+                  "Unknown argument '${_arg}'.\n"
+                  "See ${CMAKE_CURRENT_LIST_FILE} for more information.\n"
+                )
+            endif()
+        endif()
+    endforeach(_arg)
+
+    get_filename_component (_translationDir ${_translationDir} ABSOLUTE)
+    if ("${_tsSrcFile}" STREQUAL "")
+        set(_tsSrcFile  "${_translationDir}/${PROJECT_NAME}.ts.src")
+    endif()
+
+    get_filename_component (_tsSrcFile  ${_tsSrcFile} ABSOLUTE)
+    get_filename_component (_tsSrcFileName  ${_tsSrcFile} NAME)
+    get_filename_component (_tsSrcFileNameWE  ${_tsSrcFile} NAME_WE)
+
+    # TS.SRC file *******************************************
+    file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/updateTsFile.sh
+        "#/bin/sh\n"
+        "\n"
+        "mkdir -p ${_translationDir} 2>/dev/null\n"
+        "cd ${_translationDir} && "
+        "${QT_LUPDATE_EXECUTABLE} -locations none -target-language en_US ${_sourcesSpace} -ts ${_tsSrcFile}.ts &&"
+        "mv ${_tsSrcFile}.ts ${_tsSrcFile}\n"
+        "grep -q 'source' '${_tsSrcFile}' || rm '${_tsSrcFile}'\n"
+    )
+
+    add_custom_target(Update_${_tsSrcFileName}
+        COMMAND sh ${CMAKE_CURRENT_BINARY_DIR}/updateTsFile.sh
+        DEPENDS ${_sources}
+        VERBATIM
+    )
+
+    add_dependencies(UpdateTsFiles Update_${_tsSrcFileName})
+
+    # TX file ***********************************************
+    set(_txFile "${CMAKE_BINARY_DIR}/tx/${_tsSrcFileName}.tx.sh")
+    string(REPLACE "${CMAKE_SOURCE_DIR}/" "" _tx_translationDir ${_translationDir})
+    string(REPLACE "${CMAKE_SOURCE_DIR}/" "" _tx_tsSrcFile ${_tsSrcFile})
+
+    file(WRITE ${_txFile}
+        "[ -f ${_tsSrcFile} ] || exit 0\n"
+        "echo '[razor-qt.${_tsSrcFileNameWE}]'\n"
+        "echo 'type = QT'\n"
+        "echo 'source_lang = en'\n"
+        "echo 'source_file = ${_tx_tsSrcFile}'\n"
+        "echo 'file_filter = ${_tx_translationDir}/${_tsSrcFileNameWE}_<lang>.ts'\n"
+        "echo ''\n"
+    )
+
+    # translate.h file *************************************
+    file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/razortranslate.h
+        "#ifndef RAZOR_TRANSLATE_H\n"
+        "#include <QtCore/QLocale>\n"
+        "#include <QtCore/QTranslator>\n"
+        "#include <QtCore/QLibraryInfo>\n"
+        "class RazorTranslator {\n"
+        "public:\n"
+        "  static void translate()\n"
+        "  {\n"
+        "    QString locale = QLocale::system().name();\n"
+
+        "    QTranslator *qtTranslator = new QTranslator(qApp);\n"
+        "    qtTranslator->load(\"qt_\" + locale, QLibraryInfo::location(QLibraryInfo::TranslationsPath));\n"
+        "    qApp->installTranslator(qtTranslator);\n"
+
+        "    QTranslator *appTranslator = new QTranslator(qApp);\n"
+        "    appTranslator->load(QString(\"${_installDir}/${PROJECT_NAME}_%1.qm\").arg(locale));\n"
+        "    qApp->installTranslator(appTranslator);\n"
+        "  }\n"
+        "};\n"
+
+        "#define TRANSLATE_APP  RazorTranslator::translate();\n"
+        "#endif // RAZOR_TRANSLATE_H\n"
+    )
+
+    # QM files **********************************************
+    file(GLOB _tsFiles ${_translationDir}/${_tsSrcFileNameWE}_*.ts)
+    QT4_ADD_TRANSLATION_FIXED(_qmFilesLocal ${_tsFiles})
+    install(FILES ${_qmFilesLocal} DESTINATION ${_installDir})
+
+    set(${_qmFiles} ${_qmFilesLocal} PARENT_SCOPE)
+endfunction(razor_translate_ts)
+
+
+#**********************************************************
+# DESKTOP files
+#**********************************************************
+
+function(razor_translate_desktop _RESULT)
+    set(_translationDir "translations")
+
+    # Parse arguments ***************************************
+    set(_state "")
+    foreach (_arg ${ARGN})
+        if (
+            ("${_arg}_I_HATE_CMAKE" STREQUAL "SOURCES_I_HATE_CMAKE") OR
+            ("${_arg}_I_HATE_CMAKE" STREQUAL "TRANSLATION_DIR_I_HATE_CMAKE")
+           )
+
+            set(_state ${_arg})
+
+        else()
+            if("${_state}" STREQUAL "SOURCES")
+                get_filename_component (__file ${_arg} ABSOLUTE)
+                set(_sources  ${_sources} ${__file})
+                #set(_sources  ${_sources} ${_arg})
+
+            elseif("${_state}" STREQUAL "TRANSLATION_DIR")
+                set(_translationDir ${_arg})
+                set(_state "")
+
+            else()
+                MESSAGE(FATAL_ERROR
+                  "Unknown argument '${_arg}'.\n"
+                  "See ${CMAKE_CURRENT_LIST_FILE} for more information.\n"
+                )
+            endif()
+        endif()
+    endforeach(_arg)
+
+    get_filename_component (_translationDir ${_translationDir} ABSOLUTE)
+
+    foreach (_inFile ${_sources})
+        get_filename_component(_inFile   ${_inFile} ABSOLUTE)
+        get_filename_component(_fileName ${_inFile} NAME_WE)
+        #Extract the real extension ............
+        get_filename_component(_fileExt  ${_inFile} EXT)
+        string(REPLACE ".in" "" _fileExt ${_fileExt})
+        #.......................................
+        set(_outFile "${CMAKE_CURRENT_BINARY_DIR}/${_fileName}${_fileExt}")
+
+        file(GLOB _translations
+            ${_translationDir}/${_fileName}_*${_fileExt}
+            ${_translationDir}/local/${_fileName}_*${_fileExt}
+        )
+
+        set(_pattern "'\\[.*]\\s*='")
+        if (_translations)
+            add_custom_command(OUTPUT ${_outFile}
+                COMMAND grep -v "'#TRANSLATIONS_DIR='" ${_inFile} > ${_outFile}
+                COMMAND grep --no-filename ${_pattern} ${_translations} >> ${_outFile}
+                COMMENT "Generating ${_fileName}${_fileExt}"
+            )
+        else()
+            add_custom_command(OUTPUT ${_outFile}
+                COMMAND grep -v "'#TRANSLATIONS_DIR='" ${_inFile} > ${_outFile}
+                COMMENT "Generating ${_fileName}${_fileExt}"
+            )
+        endif()
+
+        set(__result ${__result} ${_outFile})
+
+
+        # TX file ***********************************************
+        set(_txFile "${CMAKE_BINARY_DIR}/tx/${_fileName}${_fileExt}.tx.sh")
+        string(REPLACE "${CMAKE_SOURCE_DIR}/" "" _tx_translationDir ${_translationDir})
+        string(REPLACE "${CMAKE_SOURCE_DIR}/" "" _tx_inFile ${_inFile})
+        string(REPLACE "." "" _fileType ${_fileExt})
+
+        file(WRITE ${_txFile}
+            "[ -f ${_inFile} ] || exit 0\n"
+            "echo '[razor-qt.${_fileName}_${_fileType}]'\n"
+            "echo 'type = DESKTOP'\n"
+            "echo 'source_lang = en'\n"
+            "echo 'source_file = ${_tx_inFile}'\n"
+            "echo 'file_filter = ${_tx_translationDir}/${_fileName}_<lang>${_fileExt}'\n"
+            "echo ''\n"
+        )
+
+    endforeach()
+
+    set(${_RESULT} ${__result} PARENT_SCOPE)
+endfunction(razor_translate_desktop)
+
+
+macro(razor_summary_line _RESULT _MODULE _DESCRIPTION)
+    set(_str "  ${_MODULE} ")
+    string(LENGTH ${_str} _len)
+    while(_len LESS 30)
+        set(_str "${_str} ")
+        string(LENGTH ${_str} _len)
+    endwhile()
+    set(${_RESULT} "${_str} ${_DESCRIPTION}")
+endmacro()
+
+
+macro(lxqt_set_default_value VAR_NAME VAR_VALUE)
+    if (NOT DEFINED ${VAR_NAME})
+        set (${VAR_NAME} ${VAR_VALUE})
+    endif ()
+endmacro()
diff --git a/cmake/razortranslate.h.in b/cmake/razortranslate.h.in
deleted file mode 100644 (file)
index d68d418..0000000
+++ /dev/null
@@ -1,24 +0,0 @@
-#ifndef RAZOR_TRANSLATE_H
-
-#include <QtCore/QLocale>
-#include <QtCore/QTranslator>
-#include <QtCore/QLibraryInfo>
-
-class RazorTranslator {
-public:
-    static void translate()
-    {
-        QString locale = QLocale::system().name();
-
-        QTranslator *qtTranslator = new QTranslator(qApp);
-        qtTranslator->load("qt_" + locale, QLibraryInfo::location(QLibraryInfo::TranslationsPath));
-        qApp->installTranslator(qtTranslator);
-
-        QTranslator *appTranslator = new QTranslator(qApp);
-        appTranslator->load(QString("${TRANSLATIONS_DIR}/${PROJECT_NAME}_%1.qm").arg(locale));
-        qApp->installTranslator(appTranslator);
-    }
-};
-
-#define TRANSLATE_APP  RazorTranslator::translate();
-#endif // RAZOR_TRANSLATE_H
\ No newline at end of file
index e6ba8b0..73ab7b3 100644 (file)
@@ -100,7 +100,7 @@ RazorApplication::RazorApplication(int &argc, char** argv)
 #endif
 
     XdgIcon::setThemeName(RazorSettings::globalSettings()->value("icon_theme").toString());
-    setWindowIcon(QIcon(QString(SHARE_DIR) + "/graphics/razor_logo.png"));
+    setWindowIcon(QIcon(QString(LXQT_SHARE_DIR) + "/graphics/razor_logo.png"));
     connect(RazorSettings::globalSettings(), SIGNAL(razorThemeChanged()), this, SLOT(updateTheme()));
     updateTheme();
 }