CMakeLists.txt 2.61 KB
Newer Older
1
project(kalgebra)
2
cmake_minimum_required(VERSION 2.8.11)
3

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

Aleix Pol Gonzalez's avatar
Aleix Pol Gonzalez committed
7
find_package(Qt5 5.2 REQUIRED NO_MODULE COMPONENTS Qml Quick Xml Svg OpenGL PrintSupport Test)
8
include(KDEInstallDirs)
9
include(KDECompilerSettings)
10
include(KDECMakeSettings)
Aleix Pol Gonzalez's avatar
Aleix Pol Gonzalez committed
11
include(ECMInstallIcons)
12
include(FeatureSummary)
Laurent Montel's avatar
Laurent Montel committed
13
include(ECMAddAppIcon)
14

15
find_package(Analitza5 REQUIRED)
16
17

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

Aleix Pol Gonzalez's avatar
Aleix Pol Gonzalez committed
19
include_directories(${CMAKE_SOURCE_DIR} ${CMAKE_BINARY_DIR})
Aleix Pol Gonzalez's avatar
Aleix Pol Gonzalez committed
20

21
22
find_package(OpenGL)
set(HAVE_OPENGL ${OPENGL_FOUND})
Aleix Pol Gonzalez's avatar
Aleix Pol Gonzalez committed
23
24
25
set_package_properties(OpenGL PROPERTIES TYPE OPTIONAL
                                         PURPOSE "Support for 3D graphs in KAlgebra"
                                         URL "http://opengl.org")
26

27
28
29
30
31
32
33
34
35
36
37
set(CURSES_NEED_NCURSES TRUE)
find_package(Curses)
find_package(Readline)

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/")

Aleix Pol Gonzalez's avatar
Aleix Pol Gonzalez committed
38
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/config-kalgebra.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/src/config-kalgebra.h)
39
40
add_definitions (-DQT_USE_FAST_CONCATENATION -DQT_USE_FAST_OPERATOR_PLUS)

41
if(${MOBILE_BACKEND} STREQUAL "kde")
42
43
44
45
    find_package(KF5I18n ${KF5_VERSION} REQUIRED)
    find_package(KF5ConfigWidgets ${KF5_VERSION} REQUIRED)
    find_package(KF5WidgetsAddons ${KF5_VERSION} REQUIRED)
    find_package(KF5KIO REQUIRED)
46
    find_package(KF5DocTools REQUIRED)
47
48
    find_package(Qt5WebKitWidgets REQUIRED)

49
50
51
    add_subdirectory(src)
    add_subdirectory(plasmoids)
endif()
Aleix Pol Gonzalez's avatar
Aleix Pol Gonzalez committed
52

Aleix Pol Gonzalez's avatar
Aleix Pol Gonzalez committed
53
add_subdirectory(icons)
54
add_subdirectory(mobile)
55

56
57
58
59
if(READLINE_FOUND AND CURSES_FOUND)
    add_subdirectory(calgebra)
endif()

60
61
62
63
64
65
66
67
68
69
70
71
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()
72
install(FILES org.kde.kalgebra.appdata.xml DESTINATION ${KDE_INSTALL_DATAROOTDIR}/appdata/)
73

74
feature_summary(WHAT ALL   FATAL_ON_MISSING_REQUIRED_PACKAGES)