forked from lyricat/Hotot
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
79 lines (62 loc) · 2.47 KB
/
CMakeLists.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
cmake_minimum_required(VERSION 2.6)
cmake_policy(SET CMP0002 OLD)
project(hotot)
set(CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake/modules ${CMAKE_MODULE_PATH})
find_package(Gettext REQUIRED)
option(WITH_GTK "Enable GTK Version" On)
option(WITH_GIR "Use GIR as GTK Version" Off)
option(WITH_QT "Enable Qt Version" On)
option(WITH_KDE "Enable KDE4 integration for Qt" On)
option(WITH_CHROME "Enable Chrome Version" Off)
# uninstall target
configure_file(
"${CMAKE_CURRENT_SOURCE_DIR}/cmake/cmake_uninstall.cmake.in"
"${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake"
IMMEDIATE @ONLY)
add_custom_target(uninstall
COMMAND ${CMAKE_COMMAND} -P ${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake)
##################### GTK Version ######################
if (WITH_GTK)
FIND_PACKAGE(PythonLibrary REQUIRED)
if (NOT PYTHONLIBRARY_FOUND)
message(FATAL_ERROR "GTK Wrapper for Hotot need python")
endif (NOT PYTHONLIBRARY_FOUND)
INCLUDE(PythonMacros)
if (WITH_GIR)
add_subdirectory(hotot-gir)
else (WITH_GIR)
add_subdirectory(hotot)
endif (WITH_GIR)
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/scripts/hotot.in ${CMAKE_CURRENT_BINARY_DIR}/scripts/hotot @ONLY)
install(PROGRAMS ${CMAKE_CURRENT_BINARY_DIR}/scripts/hotot DESTINATION bin )
endif (WITH_GTK)
##################### CHROME Version ######################
if (WITH_CHROME)
add_subdirectory(chrome)
endif (WITH_CHROME)
##################### Qt Version ######################
if (WITH_QT)
# Setup KDE4 support
if(WITH_KDE)
find_package(KDE4)
if(KDE4_FOUND)
message(STATUS "Enabling KDE4 integration")
include_directories(${KDE4_INCLUDES})
add_definitions(${KDE4_DEFINITIONS})
set(HAVE_KDE 1)
else(KDE4_FOUND)
message(STATUS "KDE4 not found, disabling KDE integration")
endif(KDE4_FOUND)
else(WITH_KDE)
message(STATUS "Not enabling KDE4 integration")
endif(WITH_KDE)
if(NOT HAVE_KDE)
find_package(Qt4 4.7 REQUIRED COMPONENTS QtCore QtGui QtWebkit QtSql)
endif(NOT HAVE_KDE)
set(CMAKE_CXX_FLAGS "-Wall -Wextra -Wno-sign-compare -Wno-unused-parameter -fvisibility=hidden ${CMAKE_CXX_FLAGS}")
set(CMAKE_SHARED_LINKER_FLAGS "-Wl,--as-needed ${CMAKE_SHARED_LINKER_FLAGS}")
set(CMAKE_MODULE_LINKER_FLAGS "-Wl,--as-needed ${CMAKE_MODULE_LINKER_FLAGS}")
add_subdirectory(qt)
endif (WITH_QT)
add_subdirectory(po)
add_subdirectory(misc)