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

3
# KDE Application Version, managed by release script
4
set(RELEASE_SERVICE_VERSION_MAJOR "20")
5
set(RELEASE_SERVICE_VERSION_MINOR "07")
6
7
set(RELEASE_SERVICE_VERSION_MICRO "70")
set(RELEASE_SERVICE_VERSION "${RELEASE_SERVICE_VERSION_MAJOR}.${RELEASE_SERVICE_VERSION_MINOR}.${RELEASE_SERVICE_VERSION_MICRO}")
8

9
project(step VERSION ${RELEASE_SERVICE_VERSION})
10

Laurent Montel's avatar
Laurent Montel committed
11
find_package(ECM 1.7.0 REQUIRED NO_MODULE)
12
13
find_package(KF5DocTools)
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${ECM_MODULE_PATH} ${ECM_KDE_MODULE_DIR})
Pepe Osca's avatar
Pepe Osca committed
14
set(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake/modules" ${CMAKE_MODULE_PATH})
15

Pepe Osca's avatar
Pepe Osca committed
16
include(KDEInstallDirs)
17
include(ECMAddTests)
Andreas Cord-Landwehr's avatar
Andreas Cord-Landwehr committed
18
include(KDECompilerSettings NO_POLICY_SCOPE)
Pepe Osca's avatar
Pepe Osca committed
19
20
include(KDECMakeSettings)
include(ECMInstallIcons)
21
22
include(ECMOptionalAddSubdirectory)
include(ECMSetupVersion)
Pepe Osca's avatar
Pepe Osca committed
23
include(FeatureSummary)
Burkhard Lück's avatar
Burkhard Lück committed
24
include(ECMPoQmTools)
25

26
27
28
29
30
31
32
33
find_package(Qt5 5.2 REQUIRED NO_MODULE COMPONENTS
    Xml
    Svg
    OpenGL
    Test
)

find_package(KF5 REQUIRED COMPONENTS
Andreas Cord-Landwehr's avatar
Andreas Cord-Landwehr committed
34
    Crash
35
    Config
Andreas Cord-Landwehr's avatar
Andreas Cord-Landwehr committed
36
    I18n
37
    IconThemes
Andreas Cord-Landwehr's avatar
Andreas Cord-Landwehr committed
38
    KIO
39
40
    NewStuff
    Plotting
Andreas Cord-Landwehr's avatar
Andreas Cord-Landwehr committed
41
    TextWidgets
42
)
43
find_package(Eigen3 3.2.2 REQUIRED)
Pepe Osca's avatar
Pepe Osca committed
44
45
find_package(GSL)
find_package(Qalculate)
46

47
set_package_properties(EIGEN3 PROPERTIES
Andreas Cord-Landwehr's avatar
Andreas Cord-Landwehr committed
48
                       DESCRIPTION "Eigen3"
49
                       URL "https://eigen.tuxfamily.org"
Pepe Osca's avatar
Pepe Osca committed
50
51
                       TYPE OPTIONAL
                       PURPOSE "Required to build step")
52

Pepe Osca's avatar
Pepe Osca committed
53
54
set_package_properties(QALCULATE PROPERTIES
# 		       REQUIRED_VERSION "0.9.5"
Andreas Cord-Landwehr's avatar
Andreas Cord-Landwehr committed
55
                       DESCRIPTION "Qalculate"
56
                       URL "https://qalculate.github.io/"
Pepe Osca's avatar
Pepe Osca committed
57
58
59
60
61
                       TYPE OPTIONAL
                       PURPOSE "Unit conversion support in Step")

set_package_properties(GSL PROPERTIES
# 		       REQUIRED_VERSION "1.8"
Andreas Cord-Landwehr's avatar
Andreas Cord-Landwehr committed
62
                       DESCRIPTION "GSL"
63
                       URL "https://www.gnu.org/software/gsl/"
Pepe Osca's avatar
Pepe Osca committed
64
65
                       TYPE OPTIONAL
                       PURPOSE "Provides a GSL-powered solver for Step")
66

Allen Winter's avatar
Allen Winter committed
67
68
69
set(STEPCORE_WITH_GSL ${GSL_FOUND} CACHE BOOL "Enable GSL-powered features for StepCore")
set(STEPCORE_WITH_QT ON) # CACHE BOOL "Enable QT-powered features for StepCore")
set(STEP_WITH_QALCULATE ${QALCULATE_FOUND} CACHE BOOL "Enable unit conversion support using libqalculate")
70

71
72
73
74
75
76
77
78
79
80
# Compiler specific options
if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
    # Clang specific options
    include(${CMAKE_CURRENT_SOURCE_DIR}/Clang.cmake)
elseif("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
    # GCC specific options
    include(${CMAKE_CURRENT_SOURCE_DIR}/GCC.cmake)
else()
    # Some other compiler
endif()
81

82
83
# Eigen3 generates a lot of warnings. Suppress them by including as system headers (-isystem /PATH/TO/EIGEN3_INCLUDE_DIR)
include_directories(${CMAKE_CURRENT_SOURCE_DIR} SYSTEM ${EIGEN3_INCLUDE_DIR})
84

85
add_definitions(-DQT_NO_URL_CAST_FROM_STRING)
86

87
88
89
if(KF5DocTools_FOUND)
    ecm_optional_add_subdirectory(doc)
endif()
90
91
add_subdirectory(stepcore)
add_subdirectory(step)
92
add_subdirectory(autotests)
93

94
install(FILES org.kde.step.appdata.xml DESTINATION ${KDE_INSTALL_METAINFODIR})
Andreas Cord-Landwehr's avatar
Andreas Cord-Landwehr committed
95

Yuri Chornoivan's avatar
Yuri Chornoivan committed
96
97
98
99
find_package(SharedMimeInfo REQUIRED)
install(FILES org.kde.step.xml DESTINATION ${XDG_MIME_INSTALL_DIR})
update_xdg_mimetypes(${XDG_MIME_INSTALL_DIR})

Pepe Osca's avatar
Pepe Osca committed
100
feature_summary(WHAT ALL FATAL_ON_MISSING_REQUIRED_PACKAGES)