CMakeLists.txt 2.98 KB
Newer Older
1
2
# KDevelop version
set( KDEVELOP_VERSION_MAJOR 4 )
Milian Wolff's avatar
Milian Wolff committed
3
set( KDEVELOP_VERSION_MINOR 7 )
Milian Wolff's avatar
Milian Wolff committed
4
set( KDEVELOP_VERSION_PATCH 1 )
5
6
7
8
9
# KDevplatform dependency version
set( KDEVPLATFORM_VERSION "1.${KDEVELOP_VERSION_MINOR}.${KDEVELOP_VERSION_PATCH}" )

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

Milian Wolff's avatar
Milian Wolff committed
10
cmake_minimum_required(VERSION 2.8.9)
11

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

14
set(CMAKE_MODULE_PATH ${KDevelop_SOURCE_DIR}/cmake/modules ${CMAKE_MODULE_PATH})
Alexander Dymo's avatar
Alexander Dymo committed
15

Kevin Funk's avatar
Kevin Funk committed
16
17
set(KDE_MIN_VERSION "4.7.0")
find_package(KDE4 4.7.0 REQUIRED)
18

19
20
include (KDE4Defaults)
include (MacroLibrary)
21
include (MacroOptionalAddSubdirectory)
22

23
find_package(QJSON)
24
# QJSON <=0.7.1 provides variables with lower case prefix, see bug 331426
25
if (QJSON_VERSION VERSION_LESS "0.7.2")
26
27
28
    set(QJSON_LIBRARIES   ${qjson_LIBRARIES})
    set(QJSON_INCLUDE_DIR ${qjson_INCLUDE_DIR})
endif()
29

30
31
# Make sure that we're having RPATH on our installed libs, else using kdevelop
# from prefixes like $HOME/kdevelop breaks
32
33
34
35
36
37
# Code taken from FindKDE4Internal.cmake from KDE 4.5
list(FIND CMAKE_PLATFORM_IMPLICIT_LINK_DIRECTORIES "${LIB_INSTALL_DIR}"
  _isSystemLibDir)
if("${_isSystemLibDir}" STREQUAL "-1")
 set(CMAKE_INSTALL_RPATH "${LIB_INSTALL_DIR}")
endif("${_isSystemLibDir}" STREQUAL "-1")
38
39
set(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)

40
find_package(KDevPlatform ${KDEVPLATFORM_VERSION} REQUIRED)
Andreas Pakulat's avatar
Andreas Pakulat committed
41

42
include_directories(${KDEVPLATFORM_INCLUDE_DIR})
43

44
add_definitions (${QT_DEFINITIONS} ${KDE4_DEFINITIONS} -DHAVE_CONFIG_H=1)
45
add_definitions(-DQT_USE_FAST_CONCATENATION -DQT_USE_FAST_OPERATOR_PLUS)
46

Milian Wolff's avatar
Milian Wolff committed
47
48
49
50
if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID STREQUAL "Clang" OR CMAKE_CXX_COMPILER_ID STREQUAL "Intel")
    set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
endif()

51
52
53
54
55
if(CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
    # in Qt 4, clang support is lacking...
    add_definitions("-DQ_COMPILER_INITIALIZER_LISTS=1")
endif()

56
57
58
59
60
61
# 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
if (CMAKE_COMPILER_IS_GNUCXX)
    set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-missing-field-initializers")
endif()

62
include_directories(${KDevelop_SOURCE_DIR} ${KDevelop_BINARY_DIR} ${KDE4_INCLUDES} )
Alexander Dymo's avatar
Alexander Dymo committed
63
64

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

67
add_subdirectory(cmake)
68
add_subdirectory(pics)
69
add_subdirectory(app)
70
add_subdirectory(formatters)
71
72
add_subdirectory(languages)
add_subdirectory(projectbuilders)
73
add_subdirectory(projectmanagers)
74
add_subdirectory(debuggers)
75
add_subdirectory(app_templates)
76
add_subdirectory(documentation)
77
add_subdirectory(kdeintegration)
78
add_subdirectory(utils)
79
add_subdirectory(file_templates)
80
add_subdirectory(providers)
81

82
macro_optional_add_subdirectory(doc)
83
84
85

macro_display_feature_log()

Milian Wolff's avatar
Milian Wolff committed
86
87
88
89
90
include(CTest)

# 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)