CMakeLists.txt 4.03 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} "${CMAKE_SOURCE_DIR}/cmake/modules" ${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 54 55
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()
endif()

56

57 58
set(REQUIRED_KF5_VERSION "5.7.0")
find_package(KF5 ${REQUIRED_KF5_VERSION} REQUIRED
59 60 61 62 63 64
    COMPONENTS
    Bookmarks
    Codecs
    Completion
    ConfigWidgets
    DBusAddons
65
    DocTools
66
    IconThemes
67 68 69 70 71 72 73 74 75
    I18n
    KCMUtils
    KIO
    NewStuff
    Parts
    Service
    WidgetsAddons
    XmlGui
)
76

Alex Richardson's avatar
Alex Richardson committed
77
if( UNIX )
78 79 80
  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
81 82
endif()

83 84 85
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
86
                       PURPOSE "Needed for most of the algorithms of the checksum tool")
87

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

103
add_definitions(
104
    -DQT_USE_QSTRINGBUILDER
105 106
    -DQT_NO_CAST_TO_ASCII
    -DQT_NO_CAST_FROM_ASCII
107
    -DQT_NO_CAST_FROM_BYTEARRAY
108 109 110
    -DQT_STRICT_ITERATORS
    -DQT_NO_URL_CAST_FROM_STRING
    -DQT_NO_SIGNALS_SLOTS_KEYWORDS
111 112
)

113
# helper libs
114
add_subdirectory( libs )
115
add_subdirectory( doc )
116

117
set( OKTETALIBS_MAJOR_VERSION 0 )
118
set( OKTETALIBS_MINOR_VERSION 9 )
119
set( OKTETALIBS_PATCHLEVEL_VERSION 1 )
120
set( OKTETALIBS_VERSION "${OKTETALIBS_MAJOR_VERSION}.${OKTETALIBS_MINOR_VERSION}.${OKTETALIBS_PATCHLEVEL_VERSION}" )
121 122 123
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} )
124

125 126
set( OKTETALIBS_LIB_SOVERSION ${OKTETALIBS_ABI_VERSION} )
set( OKTETALIBS_LIB_VERSION ${OKTETALIBS_VERSION} )
127

128
# Okteta libs
129 130
add_subdirectory( core )
add_subdirectory( gui )
131
add_subdirectory( designer )
132

133
# Okteta Kasten components
134
add_subdirectory( kasten )
135
# special mimetypes
136
add_subdirectory( mimetypes )
137

138
# programs and parts for desktop
139 140
add_subdirectory( parts )
add_subdirectory( program )
141

142
feature_summary(WHAT ALL INCLUDE_QUIET_PACKAGES FATAL_ON_MISSING_REQUIRED_PACKAGES)