CMakeLists.txt 2.92 KB
Newer Older
Laurent Montel's avatar
Laurent Montel committed
1
cmake_minimum_required(VERSION 3.5)
2

3 4
# KDE Application Version, managed by release script
set(KDE_APPLICATIONS_VERSION_MAJOR "19")
5
set(KDE_APPLICATIONS_VERSION_MINOR "12")
6
set(KDE_APPLICATIONS_VERSION_MICRO "3")
7 8 9 10
set(KDE_APPLICATIONS_VERSION "${KDE_APPLICATIONS_VERSION_MAJOR}.${KDE_APPLICATIONS_VERSION_MINOR}.${KDE_APPLICATIONS_VERSION_MICRO}")

project(kalgebra VERSION ${KDE_APPLICATIONS_VERSION})

Laurent Montel's avatar
Laurent Montel committed
11
find_package(ECM 1.7.0 REQUIRED NO_MODULE)
Aleix Pol Gonzalez's avatar
Aleix Pol Gonzalez committed
12
set(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake" ${ECM_MODULE_PATH})
13

14
find_package(Qt5 5.2 REQUIRED NO_MODULE COMPONENTS Qml Quick Xml Svg PrintSupport Test)
15
include(KDEInstallDirs)
16
include(KDECompilerSettings NO_POLICY_SCOPE)
17
include(KDECMakeSettings)
Aleix Pol Gonzalez's avatar
Aleix Pol Gonzalez committed
18
include(ECMInstallIcons)
19
include(ECMSetupVersion)
20
include(FeatureSummary)
Laurent Montel's avatar
Laurent Montel committed
21
include(ECMAddAppIcon)
22

23
find_package(Analitza5 REQUIRED)
24 25

set(MOBILE_BACKEND "kde" CACHE STRING "Backend to install, currently. Check /mobile/plugins/widgets/*")
26

Aleix Pol Gonzalez's avatar
Aleix Pol Gonzalez committed
27
include_directories(${CMAKE_SOURCE_DIR} ${CMAKE_BINARY_DIR})
Aleix Pol Gonzalez's avatar
Aleix Pol Gonzalez committed
28

29 30 31 32
set(CURSES_NEED_NCURSES TRUE)
find_package(Curses)
find_package(Readline)

33 34
ecm_setup_version(${KDE_APPLICATIONS_VERSION} VARIABLE_PREFIX KALGEBRA VERSION_HEADER kalgebra_version.h)

35 36 37 38 39 40 41
set_package_properties(Readline PROPERTIES TYPE OPTIONAL
                                           PURPOSE "Allows KAlgebra to provide a console interface."
                                           URL "http://cnswww.cns.cwru.edu/php/chet/readline/rltop.html")
set_package_properties(Curses PROPERTIES TYPE OPTIONAL
                                         PURPOSE "Allows KAlgebra to provide a console interface."
                                         URL "http://www.gnu.org/software/ncurses/")

42
add_definitions(-DQT_USE_FAST_CONCATENATION -DQT_USE_FAST_OPERATOR_PLUS)
43
add_definitions(-DQT_NO_URL_CAST_FROM_STRING)
44
add_definitions(-DQT_NO_CAST_TO_ASCII)
45

46 47
find_package(KF5 ${KF5_MIN_VERSION} REQUIRED COMPONENTS I18n CoreAddons)
find_package(KF5 ${KF5_MIN_VERSION} OPTIONAL_COMPONENTS ConfigWidgets WidgetsAddons KIO DocTools)
48
find_package(Qt5WebEngineWidgets)
49
if (EXISTS "${CMAKE_SOURCE_DIR}/.git")
David Faure's avatar
David Faure committed
50
   add_definitions(-DQT_DISABLE_DEPRECATED_BEFORE=0x050d00)
51
   add_definitions(-DKF_DISABLE_DEPRECATED_BEFORE_AND_AT=0x060000)
52
endif()
53

54
if(KF5DocTools_FOUND AND Qt5WebEngineWidgets_FOUND AND KF5ConfigWidgets_FOUND AND KF5WidgetsAddons_FOUND AND KF5KIO_FOUND AND NOT CMAKE_SYSTEM MATCHES Android*)
55 56 57
    add_subdirectory(src)
    add_subdirectory(plasmoids)
endif()
Aleix Pol Gonzalez's avatar
Aleix Pol Gonzalez committed
58

Aleix Pol Gonzalez's avatar
Aleix Pol Gonzalez committed
59
add_subdirectory(icons)
60
add_subdirectory(mobile)
61

62 63 64 65
if(READLINE_FOUND AND CURSES_FOUND)
    add_subdirectory(calgebra)
endif()

66 67 68 69 70 71 72 73 74 75 76 77
if(KF5DocTools_FOUND)
  add_subdirectory(utils)

  add_custom_target(commandsdoc
    ${CMAKE_CURRENT_BINARY_DIR}/utils/docbook_analitzacommands commands.docbook
    DEPENDS docbook_analitzacommands
    WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/doc/
    COMMENT "Generating commands docbook information"
  )

  add_subdirectory(doc)
endif()
78

79
feature_summary(WHAT ALL   FATAL_ON_MISSING_REQUIRED_PACKAGES)