CMakeLists.txt 2.72 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
14
include(KDECompilerSettings NO_POLICY_SCOPE)
include(KDECMakeSettings NO_POLICY_SCOPE)
15
16
include(FeatureSummary)

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

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

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

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

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

feature_summary(WHAT ALL FATAL_ON_MISSING_REQUIRED_PACKAGES)