CMakeLists.txt 5.06 KB
Newer Older
1
# KDevelop version
Sven Brauch's avatar
Sven Brauch committed
2 3 4
set( KDEVELOP_VERSION_MAJOR 5 )
set( KDEVELOP_VERSION_MINOR 0 )
set( KDEVELOP_VERSION_PATCH 0 )
5
set( KDEVELOP_VERSION "${KDEVELOP_VERSION_MAJOR}.${KDEVELOP_VERSION_MINOR}.${KDEVELOP_VERSION_PATCH}" )
6 7 8

################################################################################

9
cmake_minimum_required(VERSION 2.8.12)
10

11
project(KDevelop)
Alexander Dymo's avatar
Alexander Dymo committed
12

13 14
# we need some parts of the ECM CMake helpers
find_package (ECM 0.0.9 REQUIRED NO_MODULE)
15
set(CMAKE_MODULE_PATH ${KDevelop_SOURCE_DIR}/cmake/modules ${ECM_MODULE_PATH})
16 17
include(ECMOptionalAddSubdirectory)
include(ECMInstallIcons)
18
include(ECMAddAppIcon)
19
include(ECMSetupVersion)
20
include(ECMAddTests)
21 22
include(ECMMarkNonGuiExecutable)
include(ECMGenerateHeaders)
Kevin Funk's avatar
Kevin Funk committed
23
include(ECMPackageConfigHelpers)
24

Kevin Funk's avatar
Kevin Funk committed
25
include(CTest)
26
include(GenerateExportHeader)
27 28 29 30 31 32 33
include(CMakePackageConfigHelpers)
include(FeatureSummary)
include(WriteBasicConfigVersionFile)
include(CheckFunctionExists)

include(KDEInstallDirs)
include(KDECMakeSettings)
34
include(KDECompilerSettings NO_POLICY_SCOPE)
35

Kevin Funk's avatar
Kevin Funk committed
36
set(QT_MIN_VERSION "5.4.0")
37
find_package(Qt5 ${QT_MIN_VERSION} CONFIG REQUIRED Widgets Concurrent Quick QuickWidgets WebKitWidgets Test)
Kevin Funk's avatar
Kevin Funk committed
38
set(KF5_DEP_VERSION "5.15.0") # we need KCrash::initialize
39
find_package(KF5 ${KF5_DEP_VERSION} REQUIRED COMPONENTS
40
  Config
41
  Declarative
42 43
  DocTools
  IconThemes
44 45
  I18n
  ItemModels
Kevin Funk's avatar
Kevin Funk committed
46
  ItemViews
47 48 49 50
  JobWidgets
  KCMUtils
  KIO
  NewStuff
Kevin Funk's avatar
Kevin Funk committed
51
  NotifyConfig
52
  Parts
Kevin Funk's avatar
Kevin Funk committed
53
  Service
54 55
  TextEditor
  ThreadWeaver
56
  XmlGui
57
  WindowSystem
58
  Crash
59
)
60 61 62 63
find_package(KF5SysGuard)
set_package_properties(KF5SysGuard PROPERTIES
    PURPOSE "Framework for process listing. Required for the 'Attach to Process' feature"
)
64
find_package(KDevelop-PG-Qt 1.90.90)
65 66 67 68
set_package_properties(KDevelop-PG-Qt PROPERTIES
    PURPOSE "KDevelop parser generator library. Required for the QMake Builder/Manager plugin."
)

69
find_package(KDevPlatform ${KDEVELOP_VERSION} REQUIRED)
Andreas Pakulat's avatar
Andreas Pakulat committed
70

71 72 73 74 75 76 77 78
add_definitions(
    -DQT_DEPRECATED_WARNINGS
    -DQT_DISABLE_DEPRECATED_BEFORE=0x050400
    -DQT_NO_URL_CAST_FROM_STRING
    -DQT_STRICT_ITERATORS
    -DQT_USE_FAST_CONCATENATION
    -DQT_USE_FAST_OPERATOR_PLUS
)
79

80 81
# Turn off missing-field-initializers warning to avoid noise from false positives with empty {}
# See discussion: http://mail.kde.org/pipermail/kdevelop-devel/2014-February/046910.html
82 83 84 85
check_cxx_compiler_flag(-Wno-missing-field-initializers HAVE_MFI_FLAG)
check_cxx_compiler_flag(-Werror=undefined-bool-conversion HAVE_UBC_FLAG)
check_cxx_compiler_flag(-Werror=tautological-undefined-compare HAVE_TUC_FLAG)
if (HAVE_MFI_FLAG)
86 87
    set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-missing-field-initializers")
endif()
88 89 90 91 92
if (HAVE_UBC_FLAG)
    set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Werror=undefined-bool-conversion")
endif()
if (HAVE_TUC_FLAG)
    set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Werror=tautological-undefined-compare")
93
endif()
94

95
include_directories(${KDevelop_SOURCE_DIR} ${KDevelop_BINARY_DIR}  )
Alexander Dymo's avatar
Alexander Dymo committed
96

97 98 99 100 101 102 103 104
string(TOLOWER "${CMAKE_BUILD_TYPE}" CMAKE_BUILD_TYPE_TOLOWER)
if(CMAKE_BUILD_TYPE_TOLOWER MATCHES "debug"
  OR CMAKE_BUILD_TYPE_TOLOWER STREQUAL "")
  set(COMPILER_OPTIMIZATIONS_DISABLED TRUE)
else()
  set(COMPILER_OPTIMIZATIONS_DISABLED FALSE)
endif()

Alexander Dymo's avatar
Alexander Dymo committed
105
# create config.h
106
configure_file (config.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/config.h )
Alexander Dymo's avatar
Alexander Dymo committed
107

108
add_subdirectory(pics)
109
add_subdirectory(app)
110
add_subdirectory(formatters)
111 112
add_subdirectory(languages)
add_subdirectory(projectbuilders)
113
add_subdirectory(projectmanagers)
114
add_subdirectory(debuggers)
115
add_subdirectory(app_templates)
116
add_subdirectory(documentation)
117
add_subdirectory(kdeintegration)
118
add_subdirectory(utils)
119
add_subdirectory(file_templates)
120
add_subdirectory(providers)
121
add_subdirectory(shortcuts)
122
add_subdirectory(doc)
123

Kevin Funk's avatar
Kevin Funk committed
124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142
set(CMAKECONFIG_INSTALL_DIR "${KDE_INSTALL_CMAKEPACKAGEDIR}/KDevelop")
ecm_configure_package_config_file("${CMAKE_CURRENT_SOURCE_DIR}/KDevelopConfig.cmake.in"
                                  "${CMAKE_CURRENT_BINARY_DIR}/KDevelopConfig.cmake"
                                  INSTALL_DESTINATION ${CMAKECONFIG_INSTALL_DIR}
)
ecm_setup_version(${KDEVELOP_VERSION_MAJOR}.${KDEVELOP_VERSION_MINOR}.${KDEVELOP_VERSION_PATCH}
                  VARIABLE_PREFIX KDEVELOP
                  VERSION_HEADER "${CMAKE_CURRENT_BINARY_DIR}/kdevelop_version.h"
                  PACKAGE_VERSION_FILE "${CMAKE_CURRENT_BINARY_DIR}/KDevelopConfigVersion.cmake"
                  SOVERSION ${KDEVELOP_LIB_SOVERSION}
)
install(FILES
        "${CMAKE_CURRENT_BINARY_DIR}/kdevelop_version.h"
        DESTINATION "${KDE_INSTALL_INCLUDEDIR}/kdevelop")
install(FILES
        "${CMAKE_CURRENT_BINARY_DIR}/KDevelopConfig.cmake"
        "${CMAKE_CURRENT_BINARY_DIR}/KDevelopConfigVersion.cmake"
        DESTINATION "${CMAKECONFIG_INSTALL_DIR}" )
install(EXPORT KDevelopTargets DESTINATION "${CMAKECONFIG_INSTALL_DIR}" NAMESPACE KDev:: FILE KDevelopTargets.cmake)
Milian Wolff's avatar
Milian Wolff committed
143 144 145 146

# CTestCustom.cmake has to be in the CTEST_BINARY_DIR.
# in the KDE build system, this is the same as CMAKE_BINARY_DIR.
configure_file(${CMAKE_SOURCE_DIR}/CTestCustom.cmake ${CMAKE_BINARY_DIR}/CTestCustom.cmake)
147

148
install(FILES org.kde.kdevelop.appdata.xml DESTINATION ${KDE_INSTALL_METAINFODIR})
149

150
feature_summary(WHAT ALL FATAL_ON_MISSING_REQUIRED_PACKAGES)