Adds the LXQtranslateTs cmake module
[lxde/liblxqt.git] / cmake / lxqt-config.cmake.in
1 # - Find the lxqt include and library dirs and define a some macros
2 #
3 # The module defines the following variables
4 #
5 #  LXQT_FOUND         - Set to TRUE if all of the above has been found
6 #
7 #  LXQT_INCLUDE_DIR   - The lxqt include directory
8 #
9 #  LXQT_INCLUDE_DIRS  - The lxqt and the Qt include directory, for use with INCLUDE_DIRECTORIES()
10 #
11 #  LXQT_LIBRARY_DIRS  - The lxqt and the Qt library directories
12 #
13 #  LXQT_LIBRARIES     - The libraries needed to use lxqt
14 #
15 #  LXQT_SHARE_DIR     - This allows to install and read the configs from non-standard locations
16 #
17 #  LXQT_TRANSLATIONS_DIR - The default translations directory
18 #
19 #  LXQT_ETC_XDG_DIR   - XDG standards expects system-wide configuration files in the
20 #                        /etc/xdg/lxqt location. Unfortunately QSettings we are using internally
21 #                        can be overriden in the Qt compilation time to use different path for
22 #                        system-wide configs. (for example configure ... -sysconfdir /etc/settings ...)
23 #                        This path can be found calling Qt4's qmake:
24 #                             qmake -query QT_INSTALL_CONFIGURATION
25 #
26 # LXQT_USE_FILE       - The variable LXQT_USE_FILE is set which is the path to a CMake file that
27 #                        can be included to compile lxqt applications and libraries. It sets up
28 #                        the compilation environment for include directories and populates a
29 #                        LXQT_LIBRARIES variable.
30 #
31 # When using the components argument, LXQT_USE_* variables are automatically set
32 # for the LXQT_USE_FILE to pick up.  If one wishes to manually set them, the
33 # available ones to set include:
34 #               LXQT_USE_MOUNT
35 #               LXQT_USE_GLOBAL_KEY_CLIENT
36 #
37 # Typical usage could be something like:
38 #   set(LXQT_USE_MOUNT 1)
39 #   find_package(LXQT REQUIRED)
40 #   include(${LXQT_USE_FILE})
41 #
42 #   lxqt_translate_ts(QM_FILES
43 #     SOURCES
44 #        ${H_FILES}
45 #        ${CPP_FILES}
46 #        ${UI_FILES}
47 #   )
48 #   lxqt_translate_desktop(DESKTOP_FILES
49 #     SOURCES
50 #        ${DESKTOP_FILES_IN}
51 #  )
52 #
53 #   add_executable(myexe main.cpp)
54 #   target_link_libraries(myexe $LXQT_LIBRARIES})
55
56 option(USE_QT5 "Build with Qt5." $ENV{USE_QT5})
57
58 if(LXQT_FIND_REQUIRED)
59   set(REQUIRED_OPT "REQUIRED")
60 endif()
61
62 set(LXQT_LIBRARY_DIRS  @CMAKE_INSTALL_PREFIX@/@LIB_INSTALL_DIR@)
63 set(LXQT_LIBRARIES     ${LXQT_LIBRARY} )
64 set(LXQT_INCLUDE_DIRS  ${LXQT_INCLUDE_DIR} @CMAKE_INSTALL_PREFIX@/include)
65 set(LXQT_USE_FILE      ${CMAKE_CURRENT_LIST_DIR}/lxqt_use.cmake)
66 set(LXQT_CMAKE_MODULES_DIR @CFG_LXQT_CMAKE_MODULES_DIR@)
67 set(LXQT_FOUND         1)
68
69 if(LXQT_FIND_QUIETLY)
70   set(QUIET_OPT "QUIET")
71 endif()
72
73 if(USE_QT5)
74   find_package(LxQt5 ${REQUIRED_OPT} ${QUIET_OPT})
75 else()
76   find_package(LxQt4 ${REQUIRED_OPT} ${QUIET_OPT})
77 endif()