CMakeLists.txt 4.61 KB
Newer Older
1
cmake_minimum_required(VERSION 2.8.11.1)
2

3 4
project( okteta )

5 6 7 8 9 10
#copy the way kde-workspace does it

find_package(ECM 0.0.8 REQUIRED NO_MODULE)
# where to look first for cmake modules, before ${CMAKE_ROOT}/Modules/ is checked
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${ECM_MODULE_PATH})

11 12 13 14
find_package(Qt5 REQUIRED NO_MODULE COMPONENTS Core Widgets Script ScriptTools Xml Network PrintSupport)
if (BUILD_TESTING)
  find_package(Qt5Test REQUIRED NO_MODULE)
endif()
15 16 17 18
add_definitions(-DQT_DISABLE_DEPRECATED_BEFORE=0) #allow deprecated functions for now

# Load CMake, Compiler and InstallDirs settings from KF5 and the following are already somewhat "done" tier1/tier2 libs from kdelibs:
find_package(KF5 MODULE REQUIRED COMPONENTS CMake Compiler InstallDirs
19 20
                                            KWidgetsAddons KCoreAddons KConfig KI18n KGuiAddons KDBusAddons KService ItemViews KAuth KCodecs
                                            KConfigWidgets KWindowSystem KNotifications KIconThemes Sonnet KCompletion
21
                                            KTextWidgets XmlGui KDBusAddons KCrash KArchive ItemModels KJobWidgets Solid KWallet KJS
Alex Richardson's avatar
Alex Richardson committed
22
                                            KIO KUnitConversion KDE4Attic KBookmarks
23 24
                                            )

Alex Richardson's avatar
Alex Richardson committed
25
if( UNIX )
26
  set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -std=c++0x -fno-rtti -Wno-deprecated-declarations")
Alex Richardson's avatar
Alex Richardson committed
27 28
endif()

29 30 31 32 33
# needed for set_package_properties macro
find_package(KDELibs4 REQUIRED NO_MODULE) #needed for KDE4Support
find_package(KDE4Support REQUIRED NO_MODULE)

set(CMAKE_POSITION_INDEPENDENT_CODE ON) #this is needed since it is apparently not set by Qt5Config.cmake
34

35
set( CMAKE_INCLUDE_CURRENT_DIR ON )
36 37 38
set( CMAKE_AUTOMOC TRUE )
include_directories( ${KDE4_INCLUDES} )

39 40 41 42 43 44
include(FeatureSummary)

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")
45

46 47 48 49 50 51 52 53 54 55 56 57 58 59
# 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 )

60 61 62
# mobile needs
option(OKTETA_MOBILE_UI "Build UI for mobile devices instead of for desktops" FALSE)
if (OKTETA_MOBILE_UI)
63
  find_package(Qt5Quick REQUIRED)
64 65
  add_definitions( -DOKTETA_MOBILE_UI )
endif (OKTETA_MOBILE_UI)
66

67 68 69
add_definitions(
    -DQT_USE_FAST_CONCATENATION
    -DQT_USE_FAST_OPERATOR_PLUS
70 71 72 73 74 75 76 77
)
# 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(
78 79 80
    -DQT_NO_CAST_TO_ASCII
    -DQT_NO_CAST_FROM_ASCII
)
81
endif (KDE4_ASCII_CAST)
82

83
# helper libs
84
add_subdirectory( libs )
85
add_subdirectory( doc )
86

87
set( OKTETALIBS_MAJOR_VERSION 0 )
88
set( OKTETALIBS_MINOR_VERSION 8 )
89
set( OKTETALIBS_PATCHLEVEL_VERSION 1 )
90 91
set( OKTETALIBS_VERSION "${OKTETALIBS_MAJOR_VERSION}.${OKTETALIBS_MINOR_VERSION}.${OKTETALIBS_PATCHLEVEL_VERSION}" )
set( OKTETALIBS_ABI_VERSION 1 )
92
set( OKTETALIBS_INCLUDE_INSTALL_DIR  ${INCLUDE_INSTALL_DIR}/okteta${OKTETALIBS_ABI_VERSION} )
93
set( OKTETALIBS_CCINCLUDE_INSTALL_DIR  ${INCLUDE_INSTALL_DIR}/KDE/Okteta${OKTETALIBS_ABI_VERSION} )
94

95 96 97 98
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 )
99

100 101
set( OKTETALIBS_LIB_SOVERSION ${OKTETALIBS_ABI_VERSION} )
set( OKTETALIBS_LIB_VERSION ${OKTETALIBS_VERSION} )
102

103
# Okteta libs
104 105
add_subdirectory( core )
add_subdirectory( gui )
106
add_subdirectory( designer )
107

108
# Okteta Kasten components
109
add_subdirectory( kasten )
110
# special mimetypes
111 112 113
#disable this for now, FindSharedMimeInfo is no longer installed by KF5
#TODO fix this
#add_subdirectory( mimetypes )
114

115
# programs and parts for desktop
116 117
add_subdirectory( parts )
add_subdirectory( program )
118 119

# program for mobile
120
if (Qt5Quick_FOUND AND OKTETA_MOBILE_UI)
121
    macro_optional_add_subdirectory(mobile)
122
endif ()
123

124
feature_summary(WHAT ALL INCLUDE_QUIET_PACKAGES FATAL_ON_MISSING_REQUIRED_PACKAGES)