CMakeLists.txt 3.55 KB
Newer Older
1 2
cmake_minimum_required (VERSION 3.5 FATAL_ERROR)

3 4 5 6 7 8 9 10 11 12 13
# Release Service version, managed by release script
set (RELEASE_SERVICE_VERSION_MAJOR "20")
set (RELEASE_SERVICE_VERSION_MINOR "11")
set (RELEASE_SERVICE_VERSION_MICRO "70")
set (RELEASE_SERVICE_COMPACT_VERSION "${RELEASE_SERVICE_VERSION_MAJOR}${RELEASE_SERVICE_VERSION_MINOR}${RELEASE_SERVICE_VERSION_MICRO}")

# Bump KJUMPINGCUBE_BASE_VERSION once new features are added
set(KJUMPINGCUBE_BASE_VERSION "2.1")
set(KJUMPINGCUBE_VERSION "${KJUMPINGCUBE_BASE_VERSION}.${RELEASE_SERVICE_COMPACT_VERSION}")

project(kjumpingcube VERSION ${KJUMPINGCUBE_VERSION})
14

15 16
set (QT_MIN_VERSION "5.12.0")
set (KF5_MIN_VERSION "5.59.0")
Laurent Montel's avatar
Laurent Montel committed
17

18
find_package(ECM ${KF5_MIN_VERSION} REQUIRED CONFIG)
19
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${ECM_MODULE_PATH})
Laurent Montel's avatar
Laurent Montel committed
20

Andreas Sturmlechner's avatar
Andreas Sturmlechner committed
21
find_package(Qt5 ${QT_MIN_VERSION} REQUIRED NO_MODULE COMPONENTS Widgets Svg)
Frederik Schwarzer's avatar
Frederik Schwarzer committed
22
find_package(KF5 ${KF5_MIN_VERSION} REQUIRED COMPONENTS
Laurent Montel's avatar
Laurent Montel committed
23 24
    CoreAddons
    Config
25
    ConfigWidgets
Frederik Schwarzer's avatar
Frederik Schwarzer committed
26
    Crash
Laurent Montel's avatar
Laurent Montel committed
27
    DBusAddons
28 29
    DocTools
    KIO
Laurent Montel's avatar
Laurent Montel committed
30 31
    I18n
    XmlGui
32
    WidgetsAddons
Frederik Schwarzer's avatar
Frederik Schwarzer committed
33
)
Laurent Montel's avatar
Laurent Montel committed
34 35 36 37

find_package(KF5KDEGames 4.9.0 REQUIRED)

include(FeatureSummary)
38
include(ECMAddAppIcon)
Laurent Montel's avatar
Laurent Montel committed
39 40
include(ECMInstallIcons)
include(KDEInstallDirs)
41
include(KDECompilerSettings NO_POLICY_SCOPE)
Laurent Montel's avatar
Laurent Montel committed
42
include(KDECMakeSettings)
Laurent Montel's avatar
Laurent Montel committed
43
include(ECMQtDeclareLoggingCategory)
44
include(ECMSetupVersion)
Laurent Montel's avatar
Laurent Montel committed
45

46
add_definitions(
47 48 49 50
    -DQT_USE_QSTRINGBUILDER
    -DQT_NO_CAST_FROM_ASCII
    -DQT_NO_CAST_TO_ASCII
    -DQT_NO_CAST_FROM_BYTEARRAY
51
    -DQT_NO_URL_CAST_FROM_STRING
52
    -DQT_NO_FOREACH
53
    -DQT_NO_KEYWORDS
54 55 56 57
    -DQT_STRICT_ITERATORS
    -DQT_NO_NARROWING_CONVERSIONS_IN_CONNECT
    -DQT_DISABLE_DEPRECATED_BEFORE=0x050C00
    -DQT_DEPRECATED_WARNINGS_SINCE=0x060000
58 59 60
    -DKF_DISABLE_DEPRECATED_BEFORE_AND_AT=0x054400
    -DKF_DEPRECATED_WARNINGS_SINCE=0x060000
)
61

Frederik Schwarzer's avatar
Frederik Schwarzer committed
62 63
add_subdirectory(pics)
add_subdirectory(doc)
64 65 66 67 68 69 70 71

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

set(kjumpingcube_SRCS 
   kjumpingcube.cpp 
   kcubeboxwidget.cpp 
   main.cpp 
   kcubewidget.cpp 
72
   game.cpp
73
   ai_main.cpp
74 75
   ai_kepler.cpp
   ai_newton.cpp
Frederik Schwarzer's avatar
Frederik Schwarzer committed
76 77
   ai_box.cpp
)
78

79 80 81 82 83
ecm_setup_version(${KJUMPINGCUBE_VERSION}
    VARIABLE_PREFIX KJUMPINGCUBE
    VERSION_HEADER kjumpingcube_version.h
)

Laurent Montel's avatar
Laurent Montel committed
84 85
ecm_qt_declare_logging_category(kjumpingcube_SRCS HEADER kjumpingcube_debug.h IDENTIFIER KJUMPINGCUBE_LOG CATEGORY_NAME org.kde.kjumpingcube)

Laurent Montel's avatar
Laurent Montel committed
86
qt5_add_resources(kjumpingcube_SRCS kjumpingcube.qrc)
Frederik Schwarzer's avatar
Frederik Schwarzer committed
87
ki18n_wrap_ui(kjumpingcube_SRCS settings.ui)
88

Frederik Schwarzer's avatar
Frederik Schwarzer committed
89
kconfig_add_kcfg_files(kjumpingcube_SRCS prefs.kcfgc)
90

Laurent Montel's avatar
Laurent Montel committed
91
file(GLOB ICONS_SRCS "${CMAKE_CURRENT_SOURCE_DIR}/*-apps-kjumpingcube.png")
92
ecm_add_app_icon(kjumpingcube_SRCS ICONS ${ICONS_SRCS})
Laurent Montel's avatar
Laurent Montel committed
93
add_executable(kjumpingcube ${kjumpingcube_SRCS})
94

Frederik Schwarzer's avatar
Frederik Schwarzer committed
95 96
target_link_libraries(kjumpingcube
    KF5KDEGames
97 98
    KF5::CoreAddons
    KF5::Crash
Andreas Sturmlechner's avatar
Andreas Sturmlechner committed
99
    KF5::DBusAddons
100 101
    KF5::KIOWidgets
    KF5::XmlGui
Frederik Schwarzer's avatar
Frederik Schwarzer committed
102 103
    Qt5::Svg
)
104

Frederik Schwarzer's avatar
Frederik Schwarzer committed
105
install(TARGETS kjumpingcube  ${KDE_INSTALL_TARGETS_DEFAULT_ARGS})
106 107 108 109


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

Frederik Schwarzer's avatar
Frederik Schwarzer committed
110
install(PROGRAMS org.kde.kjumpingcube.desktop  DESTINATION  ${KDE_INSTALL_APPDIR})
Albert Astals Cid's avatar
Albert Astals Cid committed
111
install(FILES org.kde.kjumpingcube.appdata.xml DESTINATION  ${KDE_INSTALL_METAINFODIR})
Frederik Schwarzer's avatar
Frederik Schwarzer committed
112 113 114 115 116 117 118 119 120 121 122
install(FILES kjumpingcube.kcfg  DESTINATION  ${KDE_INSTALL_KCFGDIR})

ecm_install_icons(ICONS
    128-apps-kjumpingcube.png
    16-apps-kjumpingcube.png
    22-apps-kjumpingcube.png
    32-apps-kjumpingcube.png
    48-apps-kjumpingcube.png
    64-apps-kjumpingcube.png
    DESTINATION ${KDE_INSTALL_ICONDIR} THEME hicolor
)
123

124
install(FILES kjumpingcube.categories  DESTINATION  ${KDE_INSTALL_LOGGINGCATEGORIESDIR})
Laurent Montel's avatar
Laurent Montel committed
125

126
ki18n_install(po)
127
kdoctools_install(po)
128

129
feature_summary(WHAT ALL INCLUDE_QUIET_PACKAGES FATAL_ON_MISSING_REQUIRED_PACKAGES)