forked from QtCurve/qtcurve-gtk3
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
167 lines (148 loc) · 7.84 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
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
project(QtCurve-Gtk3)
cmake_minimum_required(VERSION 2.4.4)
set(CPACK_PACKAGE_DESCRIPTION_FILE "${CMAKE_CURRENT_SOURCE_DIR}/README")
set(CPACK_GENERATOR "DEB;RPM;TGZ")
set(DEBIAN_PACKAGE_DESCRIPTION "QtCurve for Gtk3")
set(DEBIAN_PACKAGE_SECTION "gtk")
set(CPACK_SOURCE_GENERATOR "TBZ2")
set(CPACK_PACKAGE_VERSION_MAJOR "1")
set(CPACK_PACKAGE_VERSION_MINOR "8")
set(CPACK_PACKAGE_VERSION_PATCH "1")
set(CPACK_PACKAGE_CONTACT "Craig Drummond <craig.p.drummond@gmail.com>")
set(QTCURVE_VERSION "${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}")
set(QTCURVE_VERSION_FULL "${QTCURVE_VERSION}.${CPACK_PACKAGE_VERSION_PATCH}")
set(CPACK_SOURCE_PACKAGE_FILE_NAME "${CMAKE_PROJECT_NAME}-${QTCURVE_VERSION_FULL}")
set(CPACK_PACKAGE_FILE_NAME "${CMAKE_PROJECT_NAME}-${QTCURVE_VERSION_FULL}")
include(CPack)
include(UsePkgConfig)
set(GTK_MAJOR_VERSION "3")
pkgconfig(gtk+-${GTK_MAJOR_VERSION}.0 GTK_INCLUDE_DIR GTK_LIB_DIR GTK_LINK_FLAGS GTK_CFLAGS)
if (GTK_INCLUDE_DIR)
# Try to determine KDE3's icon prefix...
find_program(KDE3CONFIG_EXECUTABLE NAMES kde-config
PATHS $ENV{KDEDIR}/bin /opt/kde3/bin /opt/kde/bin NO_DEFAULT_PATH)
find_program(KDE3CONFIG_EXECUTABLE kde-config)
if(KDE3CONFIG_EXECUTABLE)
exec_program(${KDE3CONFIG_EXECUTABLE}
ARGS --expandvars --install icon
OUTPUT_VARIABLE KDE3_ICONS_PREFIX)
exec_program(${KDE3CONFIG_EXECUTABLE}
ARGS --prefix
OUTPUT_VARIABLE KDE3PREFIX)
endif(KDE3CONFIG_EXECUTABLE)
# Try to determine KDE4's icon prefix...
file(TO_CMAKE_PATH "$ENV{KDEDIRS}" _KDEDIRS)
find_program(KDE4CONFIG_EXECUTABLE NAMES kde4-config
PATHS ${CMAKE_INSTALL_PREFIX}/bin ${_KDEDIRS} /opt/kde4/bin /usr/lib/kde4/bin NO_DEFAULT_PATH )
if(NOT KDE4CONFIG_EXECUTABLE)
find_program(KDE4CONFIG_EXECUTABLE NAMES kde4-config )
endif(NOT KDE4CONFIG_EXECUTABLE)
if(KDE4CONFIG_EXECUTABLE)
exec_program(${KDE4CONFIG_EXECUTABLE}
ARGS --expandvars --install icon
OUTPUT_VARIABLE KDE4_ICONS_PREFIX)
exec_program(${KDE4CONFIG_EXECUTABLE}
ARGS --prefix
OUTPUT_VARIABLE KDE4PREFIX)
endif(KDE4CONFIG_EXECUTABLE)
exec_program(${PKGCONFIG_EXECUTABLE}
ARGS --variable=gtk_binary_version gtk+-${GTK_MAJOR_VERSION}.0
OUTPUT_VARIABLE GTK_VERSION)
if(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
exec_program(${PKGCONFIG_EXECUTABLE}
ARGS --variable=prefix gtk+-${GTK_MAJOR_VERSION}.0
OUTPUT_VARIABLE GTK_PREFIX)
set(CMAKE_INSTALL_PREFIX ${GTK_PREFIX})
else(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
set(GTK_PREFIX ${CMAKE_INSTALL_PREFIX})
endif(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
set(GTK_THEME_DIR ${GTK_PREFIX}/share/themes/QtCurve)
if(NOT KDE3PREFIX)
if(KDE4PREFIX)
set(KDE3PREFIX ${KDE4PREFIX})
else(KDE4PREFIX)
set(KDE3PREFIX /usr)
endif(KDE4PREFIX)
endif(NOT KDE3PREFIX)
if(NOT KDE4PREFIX)
if(KDE3PREFIX)
set(KDE4PREFIX ${KDE3PREFIX})
else(KDE3PREFIX)
set(KDE4PREFIX /usr)
endif(KDE3PREFIX)
endif(NOT KDE4PREFIX)
if(NOT KDE3_ICONS_PREFIX)
if(KDE4_ICONS_PREFIX)
set(KDE3_ICONS_PREFIX ${KDE4_ICONS_PREFIX})
else(KDE4_ICONS_PREFIX)
set(KDE3_ICONS_PREFIX ${KDE3PREFIX}/share/icons)
endif(KDE4_ICONS_PREFIX)
endif(NOT KDE3_ICONS_PREFIX)
if(NOT KDE4_ICONS_PREFIX)
if(KDE3_ICONS_PREFIX)
set(KDE4_ICONS_PREFIX ${KDE3_ICONS_PREFIX})
else(KDE3_ICONS_PREFIX)
set(KDE4_ICONS_PREFIX ${KDE4PREFIX}/share/icons)
endif(KDE3_ICONS_PREFIX)
endif(NOT KDE4_ICONS_PREFIX)
configure_file(config.h.cmake ${CMAKE_BINARY_DIR}/config.h)
add_subdirectory(style)
#add_subdirectory(mozilla)
message("** PREFIX=${CMAKE_INSTALL_PREFIX}\n")
if(QTC_REORDER_GTK_DIALOG_BUTTONS)
message("**************************************************************\n"
"Warning: You have enabled the option for QtCurve to try to manually\n"
" re-order the buttons of Gtk dialogs. Note: This will cause\n"
" errors to be printed to the console, and is only an\n"
" experiment!\n"
"**************************************************************\n")
endif(QTC_REORDER_GTK_DIALOG_BUTTONS)
if(QTC_OLD_MOZILLA)
message("**************************************************************\n"
"Information: Defaulting to treating Firefox as Firefox < 3.0\n"
"**************************************************************\n")
else(QTC_OLD_MOZILLA)
message("**************************************************************\n"
"Information: Defaulting to treating Firefox as Firefox >= 3.0\n"
"**************************************************************\n")
endif(QTC_OLD_MOZILLA)
if(QTC_DEFAULT_TO_KDE3)
message("**************************************************************\n"
"Information: Defaulting to reading KDE3 settings if \n"
" KDE_SESSION_VERSION is not set\n"
"**************************************************************\n")
else(QTC_DEFAULT_TO_KDE3)
message("**************************************************************\n"
"Information: Defaulting to reading KDE4 settings if \n"
" KDE_SESSION_VERSION is not set\n"
"**************************************************************\n")
endif(QTC_DEFAULT_TO_KDE3)
if(QTC_MODIFY_MOZILLA)
message("**************************************************************\n"
"**************************************************************\n"
"Warning: You have enabled the option for QtCurve to modify the\n"
" configuration files of Mozilla applications (Firefox, \n"
" Thunderbird, Seamonkey). Note: This sometimes causes\n"
" issues with newer versions of these applications. Should\n"
" such issues occur, you should recompile QtCurve without\n"
" this option - and you will have to remove BY HAND the \n"
" changes that QtCurve has made. This will entail removing\n"
" lines from userChrom.css that indicate 'Added by QtCurve'\n"
" userChrome.css is usually in a folder such as:\n"
" ~/.mozilla/firefox/xxxxxxx.default/chrome/userChrome.css\n"
" ~/.thunderbird/xxxxxxx.default/chrome/userChrome.css\n"
" Where xxxxxxx is a series of random characters.\n"
"**************************************************************\n"
"**************************************************************\n")
endif(QTC_MODIFY_MOZILLA)
if (QTC_ENABLE_PARENTLESS_DIALOG_FIX_SUPPORT)
message("**************************************************************\n"
"Warning: You have enabled support for the 'fix parentless dialogs'\n"
" option. This is known to BREAK some applications. Please\n"
" DO NOT report errors to application authors when you have\n"
" this enabled. Please reconsider DISABLING this option.\n"
"**************************************************************\n")
endif (QTC_ENABLE_PARENTLESS_DIALOG_FIX_SUPPORT)
else (GTK_INCLUDE_DIR)
message(FATAL_ERROR "Could not locate Gtk3 include files")
endif (GTK_INCLUDE_DIR)