CMakeLists.txt 2.32 KB
Newer Older
1
project(kshisen)
2

3
cmake_minimum_required (VERSION 3.5 FATAL_ERROR)
4 5
set(QT_MIN_VERSION "5.7.0")
set(KF5_MIN_VERSION "5.30.0")
Raymond Wooninck's avatar
Raymond Wooninck committed
6

7 8 9 10 11 12
set(CMAKE_CXX_STANDARD 14) # C++14...
set(CMAKE_CXX_STANDARD_REQUIRED ON) # ...is required...
set(CMAKE_CXX_EXTENSIONS OFF) # ...without compiler extensions like gnu++14

# Found this somewhere but cannot re-find it now ... but want to investigate later, so keeping this here for now.
#set(CXX_CLANG_TIDY ON)
13

14
find_package(ECM ${KF5_MIN_VERSION} REQUIRED NO_MODULE)
Raymond Wooninck's avatar
Raymond Wooninck committed
15

16 17 18
if(ENABLE_CLAZY)
    set(CMAKE_CXX_COMPILER clazy)
endif()
19

Raymond Wooninck's avatar
Raymond Wooninck committed
20 21
set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake/modules ${ECM_MODULE_PATH} ${ECM_KDE_MODULE_DIR})

22
find_package(Qt5 ${QT_MIN_VERSION} REQUIRED NO_MODULE COMPONENTS Core Gui)
Frederik Schwarzer's avatar
Frederik Schwarzer committed
23 24 25 26 27 28 29
find_package(KF5 ${KF5_MIN_VERSION} REQUIRED COMPONENTS
    Config
    Crash
    DBusAddons
    DocTools
    XmlGui
)
Raymond Wooninck's avatar
Raymond Wooninck committed
30 31

include(FeatureSummary)
Laurent Montel's avatar
Laurent Montel committed
32
include(ECMAddAppIcon)
Raymond Wooninck's avatar
Raymond Wooninck committed
33
include(GenerateExportHeader)
34
include(CMakePackageConfigHelpers)
Raymond Wooninck's avatar
Raymond Wooninck committed
35 36 37 38 39
include(ECMSetupVersion)
include(ECMGenerateHeaders)
include(ECMMarkNonGuiExecutable)
include(KDEInstallDirs)
include(ECMInstallIcons)
40
include(KDECompilerSettings NO_POLICY_SCOPE)
Raymond Wooninck's avatar
Raymond Wooninck committed
41
include(KDECMakeSettings)
42 43
include(ECMQtDeclareLoggingCategory)

Raymond Wooninck's avatar
Raymond Wooninck committed
44 45 46

find_package(KF5KMahjongglib REQUIRED)
find_package(KF5KDEGames 4.9.0 REQUIRED)
47 48 49 50
if (${KF5Config_VERSION} STRGREATER "5.56.0")
        add_definitions(-DQT_NO_FOREACH)
        MESSAGE(STATUS "compile without foreach")
endif()
51 52 53
if (EXISTS "${CMAKE_SOURCE_DIR}/.git")
   add_definitions(-DQT_DISABLE_DEPRECATED_BEFORE=0x060000)
endif()
Raymond Wooninck's avatar
Raymond Wooninck committed
54

Frederik Schwarzer's avatar
Frederik Schwarzer committed
55
add_definitions(
56
    -DQT_STRICT_ITERATORS
Frederik Schwarzer's avatar
Frederik Schwarzer committed
57 58 59 60 61
    -DQT_NO_CAST_FROM_ASCII
    -DQT_NO_CAST_TO_ASCII
    -DQT_NO_CAST_FROM_BYTEARRAY
    -DQT_NO_URL_CAST_FROM_STRING
    -DQT_USE_QSTRINGBUILDER
62
    -DQT_NO_NARROWING_CONVERSIONS_IN_CONNECT
Frederik Schwarzer's avatar
Frederik Schwarzer committed
63
)
64 65

add_subdirectory(src)
Frederik Schwarzer's avatar
Frederik Schwarzer committed
66
add_subdirectory(icons)
67 68 69 70 71 72
add_subdirectory(sounds)
add_subdirectory(doc)

install(PROGRAMS org.kde.kshisen.desktop DESTINATION ${KDE_INSTALL_APPDIR})
install(FILES org.kde.kshisen.appdata.xml DESTINATION ${KDE_INSTALL_METAINFODIR})

73 74 75 76 77
if (${ECM_VERSION} STRGREATER "5.58.0")
    install(FILES kshisen.categories  DESTINATION  ${KDE_INSTALL_LOGGINGCATEGORIESDIR})
else()
    install(FILES kshisen.categories  DESTINATION ${KDE_INSTALL_CONFDIR})
endif()
Raymond Wooninck's avatar
Raymond Wooninck committed
78
########### Display Summary ###############
Frederik Schwarzer's avatar
Frederik Schwarzer committed
79
feature_summary(WHAT ALL INCLUDE_QUIET_PACKAGES FATAL_ON_MISSING_REQUIRED_PACKAGES)