CMakeLists.txt 3.91 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
include(ECMInstallIcons)
11
include(ECMGenerateHeaders)
12 13
include(ECMSetupVersion)
include(ECMPackageConfigHelpers)
14
include(ECMAddAppIcon)
15

16
include(FeatureSummary)
17
include(GenerateExportHeader)
18

Stephen Kelly's avatar
Stephen Kelly committed
19
include(KDEInstallDirs)
20 21
include(KDECMakeSettings NO_POLICY_SCOPE)
include(KDECompilerSettings NO_POLICY_SCOPE)
22

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

39 40 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()
endif()

54

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

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

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

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

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

111
# helper libs
112
add_subdirectory( libs )
113
add_subdirectory( doc )
114

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

123 124
set( OKTETALIBS_LIB_SOVERSION ${OKTETALIBS_ABI_VERSION} )
set( OKTETALIBS_LIB_VERSION ${OKTETALIBS_VERSION} )
125

126
# Okteta libs
127 128
add_subdirectory( core )
add_subdirectory( gui )
129
add_subdirectory( designer )
130

131
# Okteta Kasten components
132
add_subdirectory( kasten )
133
# special mimetypes
134
add_subdirectory( mimetypes )
135

136
# programs and parts for desktop
137 138
add_subdirectory( parts )
add_subdirectory( program )
139

140
feature_summary(WHAT ALL INCLUDE_QUIET_PACKAGES FATAL_ON_MISSING_REQUIRED_PACKAGES)