CMakeLists.txt 3.75 KB
Newer Older
1 2
project( okteta )

3 4
cmake_minimum_required(VERSION 2.8.11.1)
set(QT_MIN_VERSION "5.2.0")
5 6

find_package(ECM 0.0.8 REQUIRED NO_MODULE)
7

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

11 12
include(FeatureSummary)

Stephen Kelly's avatar
Stephen Kelly committed
13 14 15
include(KDEInstallDirs)
include(KDECMakeSettings)
include(KDECompilerSettings)
16

17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48
find_package(Qt5 REQUIRED NO_MODULE
    COMPONENTS
    Core
    Network
    Designer
    PrintSupport
    Script
    ScriptTools
    Test
    Widgets
    Xml
)

find_package(KF5 CONFIG REQUIRED
    COMPONENTS
    Bookmarks
    Codecs
    Completion
    ConfigWidgets
    DBusAddons
    I18n
    KCMUtils
    KDE4Support
    KIO
    NewStuff
    Parts
    PrintUtils
    Service
    Solid
    WidgetsAddons
    XmlGui
)
49

Alex Richardson's avatar
Alex Richardson committed
50
if( UNIX )
Alex Richardson's avatar
Alex Richardson committed
51
  set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -std=c++0x -fno-rtti")
Alex Richardson's avatar
Alex Richardson committed
52 53
endif()

54 55 56 57
find_package(QCA2)
set_package_properties(QCA2 PROPERTIES DESCRIPTION "Qt Cryptographic Architecture"
                       URL "http://delta.affinix.com/qca" TYPE OPTIONAL
                       PURPOSE "Needed for most of the algorithms of the checksum tool")
58

59 60 61 62 63 64 65 66 67 68 69 70 71 72
# control build scope
# TODO: examples and templates not internal need headers and libs as installed
# so they can be only build after the installation was done
# How to handle this best, as in: they are per default always build after an install?
# set( KASTEN_BUILD_EXAMPLES  NOT OMIT_EXAMPLES )
# set( OKTETA_BUILD_EXAMPLES  NOT OMIT_EXAMPLES )
set( KASTEN_BUILD_INTERNAL_EXAMPLES  NOT OMIT_INTERNAL_EXAMPLES )
set( OKTETA_BUILD_INTERNAL_EXAMPLES  NOT OMIT_INTERNAL_EXAMPLES )

# set( KASTEN_BUILD_TEMPLATES NOT SKIPTEMPLATES )
# set( OKTETA_BUILD_TEMPLATES NOT SKIPTEMPLATES )
set( KASTEN_BUILD_INTERNAL_TEMPLATES NOT OMIT_INTERNAL_TEMPLATES )
set( OKTETA_BUILD_INTERNAL_TEMPLATES NOT OMIT_INTERNAL_TEMPLATES )

73 74 75
# mobile needs
option(OKTETA_MOBILE_UI "Build UI for mobile devices instead of for desktops" FALSE)
if (OKTETA_MOBILE_UI)
76
  find_package(Qt5Quick REQUIRED)
77 78
  add_definitions( -DOKTETA_MOBILE_UI )
endif (OKTETA_MOBILE_UI)
79

80
add_definitions(
81
    -DQT_USE_QSTRINGBUILDER
82 83 84 85 86 87 88 89
)
# switch between no cast to/from ascii and a warning about it
if (KDE4_ASCII_CAST)
add_definitions(
    -DQT_ASCII_CAST_WARNINGS
)
else (KDE4_ASCII_CAST)
add_definitions(
90 91
    -DQT_NO_CAST_TO_ASCII
    -DQT_NO_CAST_FROM_ASCII
92
    -DQT_NO_CAST_FROM_BYTEARRAY
93
)
94
endif (KDE4_ASCII_CAST)
95

96
# helper libs
97
add_subdirectory( libs )
98
add_subdirectory( doc )
99

100
set( OKTETALIBS_MAJOR_VERSION 0 )
101
set( OKTETALIBS_MINOR_VERSION 8 )
102
set( OKTETALIBS_PATCHLEVEL_VERSION 1 )
103 104
set( OKTETALIBS_VERSION "${OKTETALIBS_MAJOR_VERSION}.${OKTETALIBS_MINOR_VERSION}.${OKTETALIBS_PATCHLEVEL_VERSION}" )
set( OKTETALIBS_ABI_VERSION 1 )
105
set( OKTETALIBS_INCLUDE_INSTALL_DIR  ${INCLUDE_INSTALL_DIR}/okteta${OKTETALIBS_ABI_VERSION} )
106
set( OKTETALIBS_CCINCLUDE_INSTALL_DIR  ${INCLUDE_INSTALL_DIR}/KDE/Okteta${OKTETALIBS_ABI_VERSION} )
107

108 109 110 111
set( oktetacore_LIB  oktetacore )
set( oktetagui_LIB   oktetagui )
set( oktetacore_LIB_NAME  okteta${OKTETALIBS_ABI_VERSION}core )
set( oktetagui_LIB_NAME   okteta${OKTETALIBS_ABI_VERSION}gui )
112

113 114
set( OKTETALIBS_LIB_SOVERSION ${OKTETALIBS_ABI_VERSION} )
set( OKTETALIBS_LIB_VERSION ${OKTETALIBS_VERSION} )
115

116
# Okteta libs
117 118
add_subdirectory( core )
add_subdirectory( gui )
119
add_subdirectory( designer )
120

121
# Okteta Kasten components
122
add_subdirectory( kasten )
123
# special mimetypes
124 125 126
#disable this for now, FindSharedMimeInfo is no longer installed by KF5
#TODO fix this
#add_subdirectory( mimetypes )
127

128
# programs and parts for desktop
129 130
add_subdirectory( parts )
add_subdirectory( program )
131 132

# program for mobile
133
if (Qt5Quick_FOUND AND OKTETA_MOBILE_UI)
134
    macro_optional_add_subdirectory(mobile)
135
endif ()
136

137
feature_summary(WHAT ALL INCLUDE_QUIET_PACKAGES FATAL_ON_MISSING_REQUIRED_PACKAGES)