CMakeLists.txt 2.76 KB
Newer Older
1
cmake_minimum_required(VERSION 2.8.12 FATAL_ERROR)
Michael Reeves's avatar
Michael Reeves committed
2
cmake_policy(SET CMP0063 NEW)#repress unneeded warning
Joachim Eibl's avatar
Joachim Eibl committed
3
4
project(kdiff3)

5
6
7
8
9
10
set(ECM_MIN_VERSION "1.0.0")
set(QT_MIN_VERSION "5.3.0")
set(KF5_MIN_VERSION "5.5.0")

find_package(ECM ${ECM_MIN_VERSION} CONFIG REQUIRED)
set(CMAKE_MODULE_PATH ${ECM_MODULE_PATH} ${ECM_KDE_MODULE_DIR} ${CMAKE_SOURCE_DIR}/cmake)
Michael Reeves's avatar
Michael Reeves committed
11
12

include(KDEInstallDirs)
13
include(KDECompilerSettings)
Michael Reeves's avatar
Michael Reeves committed
14
include(KDECMakeSettings)
15
16
17
include(KDEFrameworkCompilerSettings)
include(FeatureSummary)

Michael Reeves's avatar
Michael Reeves committed
18
19
include(ECMInstallIcons)

20
find_package(Qt5 ${QT_MIN_VERSION} CONFIG REQUIRED COMPONENTS Core Gui Widgets)
Michael Reeves's avatar
Michael Reeves committed
21
find_package(KF5 ${KF5_MIN_VERSION} REQUIRED COMPONENTS I18n KDELibs4Support)
22
find_package(KF5DocTools ${KF5_MIN_VERSION} REQUIRED )
Joachim Eibl's avatar
Joachim Eibl committed
23

24
25
SET(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_CURRENT_SOURCE_DIR}/cmake/modules)
SET(KDiff3_LIBRARIES KF5::I18n KF5::KDELibs4Support)
26
add_definitions(${QT_DEFINITIONS} ${KF5_DEFINITIONS})
27
28
#remove unnneeded errors
remove_definitions(-DQT_NO_CAST_FROM_ASCII -DQT_STRICT_ITERATORS -DQT_NO_CAST_FROM_BYTEARRAY -DQT_NO_KEYWORDS)
Joachim Eibl's avatar
Joachim Eibl committed
29
30

include_directories( 
31
    ${QT_INCLUDES} ${Qt5Core_INCLUDE_DIRS} ${Qt5Widgets_INCLUDE_DIRS} ${Qt5Gui_INCLUDE_DIRS}
Joachim Eibl's avatar
Joachim Eibl committed
32
33
34
35
36
    ${CMAKE_CURRENT_BINARY_DIR}
    )

configure_file(${CMAKE_CURRENT_SOURCE_DIR}/config-kdiff3.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/config-kdiff3.h )

Michael Reeves's avatar
Michael Reeves committed
37
add_subdirectory(src)
Michael Reeves's avatar
Michael Reeves committed
38
#add_subdirectory(po)
Joachim Eibl's avatar
Joachim Eibl committed
39
add_subdirectory(doc)
40

Michael Reeves's avatar
Michael Reeves committed
41
find_file(KFILEITEMACTIONPLUGIN_FOUND kabstractfileitemactionplugin.h PATHS)
42
if(KFILEITEMACTIONPLUGIN_FOUND)
Joachim Eibl's avatar
Joachim Eibl committed
43
  message(STATUS "")
Michael Reeves's avatar
Michael Reeves committed
44
  message(STATUS "kabstractfileitemactionplugin.h found........... YES")
45
  message(STATUS "   => kdiff3fileitemactionplugin (KDiff3 contextmenu plugin for Konqueror/Dolphin, KDE>4.6) will be built.")
Joachim Eibl's avatar
Joachim Eibl committed
46
  message(STATUS "")
47
48
  add_subdirectory(kdiff3fileitemactionplugin)
else(KFILEITEMACTIONPLUGIN_FOUND)
Joachim Eibl's avatar
Joachim Eibl committed
49
  message(STATUS "")
Michael Reeves's avatar
Michael Reeves committed
50
  message(STATUS "kabstractfileitemactionplugin.h found........... NO")
51
52
  message(STATUS "   => kdiff3fileitemactionplugin (KDiff3 contextmenu plugin for Konqueror/Dolphin, KDE>4.6) will not be built.)")
  message(STATUS "Trying fallback via libkonq (works with Konqueror only) ...")
53
  FIND_PACKAGE(LibKonq)
54
  if(LIBKONQ_FOUND)
55
56
    set(HAVE_LIBKONQ 1)
    
57
58
59
60
    message(STATUS "")
    message(STATUS "libkonq module found........... YES")
    message(STATUS "   => kdiff3plugin (KDiff3 contextmenu plugin for Konqueror) will be built.")
    message(STATUS "")
Michael Reeves's avatar
Michael Reeves committed
61
    add_subdirectory(kdiff3plugin)
62
  else(LIBKONQ_FOUND)
63
64
    set(HAVE_LIBKONQ 0)
    
65
66
67
68
69
70
    message(STATUS "")
    message(STATUS "libkonq module found........... NO")
    message(STATUS "   => kdiff3plugin (KDiff3 contextmenu plugin for Konqueror) will not be built.)")
    message(STATUS "")
  endif(LIBKONQ_FOUND)
endif(KFILEITEMACTIONPLUGIN_FOUND)
71
72

feature_summary(WHAT ALL FATAL_ON_MISSING_REQUIRED_PACKAGES)