CMakeLists.txt 2.65 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)
Joachim Eibl's avatar
Joachim Eibl committed
22
23
SET(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_CURRENT_SOURCE_DIR}/cmake/modules)

24
add_definitions(${QT_DEFINITIONS} ${KF5_DEFINITIONS})
25
26
#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
27
28

include_directories( 
29
    ${QT_INCLUDES} ${Qt5Core_INCLUDE_DIRS} ${Qt5Widgets_INCLUDE_DIRS} ${Qt5Gui_INCLUDE_DIRS}
Joachim Eibl's avatar
Joachim Eibl committed
30
31
32
33
34
    ${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
35
add_subdirectory(src)
Michael Reeves's avatar
Michael Reeves committed
36
#add_subdirectory(po)
Joachim Eibl's avatar
Joachim Eibl committed
37
add_subdirectory(doc)
38

Michael Reeves's avatar
Michael Reeves committed
39
find_file(KFILEITEMACTIONPLUGIN_FOUND kabstractfileitemactionplugin.h PATHS)
40
if(KFILEITEMACTIONPLUGIN_FOUND)
Joachim Eibl's avatar
Joachim Eibl committed
41
  message(STATUS "")
Michael Reeves's avatar
Michael Reeves committed
42
  message(STATUS "kabstractfileitemactionplugin.h found........... YES")
43
  message(STATUS "   => kdiff3fileitemactionplugin (KDiff3 contextmenu plugin for Konqueror/Dolphin, KDE>4.6) will be built.")
Joachim Eibl's avatar
Joachim Eibl committed
44
  message(STATUS "")
45
46
  add_subdirectory(kdiff3fileitemactionplugin)
else(KFILEITEMACTIONPLUGIN_FOUND)
Joachim Eibl's avatar
Joachim Eibl committed
47
  message(STATUS "")
Michael Reeves's avatar
Michael Reeves committed
48
  message(STATUS "kabstractfileitemactionplugin.h found........... NO")
49
50
  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) ...")
51
  FIND_PACKAGE(LibKonq)
52
  if(LIBKONQ_FOUND)
53
54
    set(HAVE_LIBKONQ 1)
    
55
56
57
58
    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
59
    add_subdirectory(kdiff3plugin)
60
  else(LIBKONQ_FOUND)
61
62
    set(HAVE_LIBKONQ 0)
    
63
64
65
66
67
68
    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)
69
70

feature_summary(WHAT ALL FATAL_ON_MISSING_REQUIRED_PACKAGES)