CMakeLists.txt 4.18 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 67
    COMPONENTS
    Bookmarks
    Codecs
    Completion
    ConfigWidgets
    DBusAddons
68
    DocTools
69
    IconThemes
70 71 72 73 74 75 76 77 78
    I18n
    KCMUtils
    KIO
    NewStuff
    Parts
    Service
    WidgetsAddons
    XmlGui
)
79

Alex Richardson's avatar
Alex Richardson committed
80
if( UNIX )
81 82 83
  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
84 85
endif()

86 87 88
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
89
                       PURPOSE "Needed for most of the algorithms of the checksum tool")
90

91 92 93
# control build scope, default to examples if BUILD_TESTING is ON
if( NOT DEFINED OMIT_EXAMPLES AND NOT BUILD_TESTING )
    set( OMIT_EXAMPLES TRUE )
94
endif()
95 96 97 98 99 100 101 102 103
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 )
104
endif()
105

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

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

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

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

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

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

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

147
feature_summary(WHAT ALL INCLUDE_QUIET_PACKAGES FATAL_ON_MISSING_REQUIRED_PACKAGES)