CMakeLists.txt 4.2 KB
Newer Older
1
cmake_minimum_required(VERSION 2.8.12)
2

3 4
project( okteta )

5
find_package(ECM 1.7.0 REQUIRED NO_MODULE)
6

7
# where to look first for cmake modules, before ${CMAKE_ROOT}/Modules/ is checked
8
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${ECM_MODULE_PATH} ${ECM_KDE_MODULE_DIR})
Stephen Kelly's avatar
Stephen Kelly committed
9

10 11 12 13 14
# ECM KDE macros (include first, to have their policies and settings effect all other macros)
include(KDEInstallDirs)
include(KDECMakeSettings NO_POLICY_SCOPE)
include(KDECompilerSettings NO_POLICY_SCOPE)
# ECM macros
15
include(ECMInstallIcons)
16
include(ECMGenerateHeaders)
17 18
include(ECMSetupVersion)
include(ECMPackageConfigHelpers)
19
include(ECMAddAppIcon)
20
# CMake macros
21
include(FeatureSummary)
22
include(GenerateExportHeader)
23

24

25 26
set(REQUIRED_QT_VERSION "5.2.0")
find_package(Qt5 ${REQUIRED_QT_VERSION} CONFIG REQUIRED
27 28 29 30 31 32 33 34 35
    COMPONENTS
    Core
    Network
    PrintSupport
    Script
    ScriptTools
    Widgets
    Xml
)
36
find_package(Qt5Test ${REQUIRED_QT_VERSION} CONFIG QUIET)
37 38 39 40
if (NOT Qt5Test_FOUND)
  message(STATUS "Qt5Test not found, unit tests will not be built.")
endif()

41 42 43 44 45 46 47 48 49 50 51 52 53
find_package(Qt5Designer ${REQUIRED_QT_VERSION} CONFIG QUIET)
set_package_properties(Qt5Designer PROPERTIES TYPE OPTIONAL
    PURPOSE "Required to build Qt Designer plugins"
)
if(NOT Qt5Designer_VERSION_STRING VERSION_LESS 5.5.0)
    find_package(Qt5UiPlugin ${REQUIRED_QT_VERSION} CONFIG QUIET)
    set_package_properties(Qt5UiPlugin PROPERTIES TYPE OPTIONAL
        PURPOSE "Required to build Qt Designer plugins"
    )
    if (Qt5UiPlugin_FOUND)
        # for some reason, Qt5UiPlugin does not set its _INCLUDE_DIRS variable. Fill it manually
        get_target_property(Qt5UiPlugin_INCLUDE_DIRS Qt5::UiPlugin INTERFACE_INCLUDE_DIRECTORIES)
    endif()
54 55 56
    set(DesignerPluginDeps_FOUND ${Qt5UiPlugin_FOUND})
else()
    set(DesignerPluginDeps_FOUND ${Qt5Designer_FOUND})
57 58
endif()

59

60 61
set(REQUIRED_KF5_VERSION "5.7.0")
find_package(KF5 ${REQUIRED_KF5_VERSION} REQUIRED
62 63 64 65 66
    COMPONENTS
    Bookmarks
    Codecs
    Completion
    ConfigWidgets
Friedrich W. H. Kossebau's avatar
Friedrich W. H. Kossebau committed
67
    Crash
68
    DBusAddons
69
    DocTools
70
    IconThemes
71 72 73 74 75 76 77 78 79
    I18n
    KCMUtils
    KIO
    NewStuff
    Parts
    Service
    WidgetsAddons
    XmlGui
)
80

Alex Richardson's avatar
Alex Richardson committed
81
if( UNIX )
82 83 84
  add_compile_options(-Wall)
  # enable this to reduce the file sizes (might crash)
  # add_compile_options(-fno-rtti)
Alex Richardson's avatar
Alex Richardson committed
85 86
endif()

87 88 89
find_package(Qca-qt5 2.1.0)
set_package_properties(Qca-qt5 PROPERTIES DESCRIPTION "Qt Cryptographic Architecture"
                       URL "http:/download.kde.org/stable/qca-qt5" TYPE OPTIONAL
90
                       PURPOSE "Needed for most of the algorithms of the checksum tool")
91

92 93 94
# control build scope, default to examples if BUILD_TESTING is ON
if( NOT DEFINED OMIT_EXAMPLES AND NOT BUILD_TESTING )
    set( OMIT_EXAMPLES TRUE )
95
endif()
96 97 98 99 100 101 102 103 104
if( NOT DEFINED OMIT_INTERNAL_TEMPLATES AND NOT BUILD_TESTING )
    set( OMIT_INTERNAL_TEMPLATES TRUE )
endif()

if( NOT OMIT_EXAMPLES )
    set( OKTETA_BUILD_EXAMPLES TRUE )
endif()
if( NOT OMIT_INTERNAL_TEMPLATES )
    set( KASTEN_BUILD_INTERNAL_TEMPLATES TRUE )
105
endif()
106

107
add_definitions(
108 109
    -DQT_DEPRECATED_WARNINGS
    -DQT_DISABLE_DEPRECATED_BEFORE=0x050200
110
    -DQT_USE_QSTRINGBUILDER
111 112
    -DQT_NO_CAST_TO_ASCII
    -DQT_NO_CAST_FROM_ASCII
113
    -DQT_NO_CAST_FROM_BYTEARRAY
114 115 116
    -DQT_STRICT_ITERATORS
    -DQT_NO_URL_CAST_FROM_STRING
    -DQT_NO_SIGNALS_SLOTS_KEYWORDS
117 118
)

119
# helper libs
120
add_subdirectory( libs )
121
add_subdirectory( doc )
122

123
set( OKTETALIBS_MAJOR_VERSION 0 )
124
set( OKTETALIBS_MINOR_VERSION 9 )
125
set( OKTETALIBS_PATCHLEVEL_VERSION 1 )
126
set( OKTETALIBS_VERSION "${OKTETALIBS_MAJOR_VERSION}.${OKTETALIBS_MINOR_VERSION}.${OKTETALIBS_PATCHLEVEL_VERSION}" )
127
set( OKTETALIBS_ABI_VERSION 2 )
128 129
set( OKTETALIBS_INCLUDE_INSTALL_DIR  ${KDE_INSTALL_INCLUDEDIR}/okteta ) #${OKTETALIBS_ABI_VERSION} )
set( OKTETALIBS_CCINCLUDE_INSTALL_DIR  ${KDE_INSTALL_INCLUDEDIR}/Okteta ) #${OKTETALIBS_ABI_VERSION} )
130

131 132
set( OKTETALIBS_LIB_SOVERSION ${OKTETALIBS_ABI_VERSION} )
set( OKTETALIBS_LIB_VERSION ${OKTETALIBS_VERSION} )
133

134
# Okteta libs
135 136
add_subdirectory( core )
add_subdirectory( gui )
137
add_subdirectory( designer )
138

139
# Okteta Kasten components
140
add_subdirectory( kasten )
141
# special mimetypes
142
add_subdirectory( mimetypes )
143

144
# programs and parts for desktop
145 146
add_subdirectory( parts )
add_subdirectory( program )
147

148
feature_summary(WHAT ALL INCLUDE_QUIET_PACKAGES FATAL_ON_MISSING_REQUIRED_PACKAGES)