File: CMakeLists.txt

package info (click to toggle)
libkf5kmahjongg 16.08.0-1
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 7,660 kB
  • ctags: 99
  • sloc: cpp: 787; sh: 16; makefile: 3
file content (136 lines) | stat: -rw-r--r-- 4,139 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
project(libkmahjongg)

cmake_minimum_required (VERSION 2.8.12 FATAL_ERROR)

set (QT_MIN_VERSION "5.2.0")

find_package(ECM 1.3.0 REQUIRED NO_MODULE)

#if(ENABLE_CLAZY)
#    set(CMAKE_CXX_COMPILER clazy)
#endif()

set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake/modules ${ECM_MODULE_PATH} ${ECM_KDE_MODULE_DIR})

find_package(Qt5 ${QT_MIN_VERSION} REQUIRED NO_MODULE COMPONENTS Core Gui Svg)
find_package(KF5 REQUIRED COMPONENTS
    CoreAddons
    Config
    ConfigWidgets
    WidgetsAddons
    Completion
    I18n
)

include(FeatureSummary)
include(GenerateExportHeader)
include(ECMPackageConfigHelpers)
include(ECMSetupVersion)
include(ECMGenerateHeaders)
include(ECMMarkNonGuiExecutable)
include(KDEInstallDirs)
include(KDECompilerSettings NO_POLICY_SCOPE)
include(KDECMakeSettings)

add_definitions(-DQT_USE_FAST_CONCATENATION -DQT_USE_FAST_OPERATOR_PLUS)
add_definitions(-DTRANSLATION_DOMAIN="libkmahjongg5")

include_directories(${CMAKE_SOURCE_DIR}/includes)

add_subdirectory(tilesets)
add_subdirectory(backgrounds)

########### next target ###############

set(KMAHJONGGLIB_VERSION 5.0.0)
set(KMAHJONGGLIB_SOVERSION 5)

set(kmahjongg_LIB_SRCS
   libkmahjongg_debug.cpp
   kmahjonggtileset.cpp
   kmahjonggbackground.cpp
   kmahjonggtilesetselector.cpp
   kmahjonggbackgroundselector.cpp
   kmahjonggconfigdialog.cpp
)

ki18n_wrap_ui(kmahjongg_LIB_SRCS kmahjonggtilesetselector.ui kmahjonggbackgroundselector.ui )

add_library(KF5KMahjongglib SHARED ${kmahjongg_LIB_SRCS})
generate_export_header(KF5KMahjongglib BASE_NAME libkmahjongg)

target_link_libraries(KF5KMahjongglib
    PRIVATE
    Qt5::Core
    Qt5::Svg
    KF5::WidgetsAddons
    KF5::I18n
    KF5::Completion
    KF5::ConfigGui
    PUBLIC
    Qt5::Gui
    KF5::ConfigWidgets
)

target_include_directories(KF5KMahjongglib INTERFACE "$<INSTALL_INTERFACE:${KF5_INCLUDE_INSTALL_DIR}/KF5KMahjongg>" INTERFACE "$<INSTALL_INTERFACE:${KF5_INCLUDE_INSTALL_DIR}>")

set_target_properties(KF5KMahjongglib PROPERTIES VERSION ${KMAHJONGGLIB_VERSION}
                                                 SOVERSION ${KMAHJONGGLIB_SOVERSION}
                                                 EXPORT_NAME KF5KMahjongglib)

ecm_setup_version(${KMAHJONGGLIB_VERSION} VARIABLE_PREFIX KF5KMAHJONGGLIB
                        VERSION_HEADER "${CMAKE_CURRENT_BINARY_DIR}/kmahjongglib_version.h"
                        PACKAGE_VERSION_FILE "${CMAKE_CURRENT_BINARY_DIR}/KF5KMahjongglibConfigVersion.cmake"
                        SOVERSION 6)


install(TARGETS KF5KMahjongglib EXPORT KF5KMahjonggLibraryDepends
        ${KF5_INSTALL_TARGETS_DEFAULT_ARGS})

########### install files ###############

install(FILES
    ${CMAKE_CURRENT_BINARY_DIR}/libkmahjongg_export.h
    kmahjonggtileset.h
    kmahjonggbackground.h
    kmahjonggconfigdialog.h
    DESTINATION ${KF5_INCLUDE_INSTALL_DIR}/KF5KMahjongg COMPONENT Devel
)

########### generate exports ###############

# add libraries to the build-tree export set
export(TARGETS KF5KMahjongglib
    FILE "${PROJECT_BINARY_DIR}/KF5KMahjonggLibraryDepends.cmake")

# define the installation directory for the CMake files
set(CMAKECONFIG_INSTALL_DIR "${CMAKECONFIG_INSTALL_PREFIX}/KF5KMahjongglib")

# create the Config.cmake and ConfigVersion.cmake files
ecm_configure_package_config_file(
    "${CMAKE_CURRENT_SOURCE_DIR}/KF5KMahjongglibConfig.cmake.in"
    "${CMAKE_CURRENT_BINARY_DIR}/KF5KMahjongglibConfig.cmake"
    INSTALL_DESTINATION ${CMAKECONFIG_INSTALL_DIR}
)

install(FILES
    "${CMAKE_CURRENT_BINARY_DIR}/KF5KMahjongglibConfig.cmake"
    "${CMAKE_CURRENT_BINARY_DIR}/KF5KMahjongglibConfigVersion.cmake"
    DESTINATION "${CMAKECONFIG_INSTALL_DIR}" COMPONENT Devel
)

# install the export set for use with the install-tree
install(EXPORT KF5KMahjonggLibraryDepends
    DESTINATION ${CMAKECONFIG_INSTALL_DIR}
    COMPONENT Devel
)

install(FILES ${CMAKE_CURRENT_BINARY_DIR}/kmahjongglib_version.h
    DESTINATION ${KF5_INCLUDE_INSTALL_DIR}/KF5KMahjongg
    COMPONENT Devel
)

########### Display Summary ###############
feature_summary(WHAT ALL
                INCLUDE_QUIET_PACKAGES
                FATAL_ON_MISSING_REQUIRED_PACKAGES)