6
6
include (CheckIncludeFiles)
7
7
include (CheckFunctionExists)
8
8
include (CheckSymbolExists)
9
include ("${CMAKE_CURRENT_SOURCE_DIR}/cmake_modules/GNUInstallDirs.cmake")
10
11
########### project ###############
46
47
set (PACKAGE ${CMAKE_PROJECT_NAME})
47
48
set (GETTEXT_PACKAGE ${PACKAGE})
48
set (prefix ${CMAKE_INSTALL_PREFIX})
50
set (prefix ${CMAKE_INSTALL_PREFIX}) # /usr/local
49
51
set (exec_prefix ${prefix})
50
set (datadir ${prefix}/share)
51
set (pkgdatadir ${datadir}/cairo-dock)
52
set (mandir ${datadir}/man)
52
set (datadir "${prefix}/${CMAKE_INSTALL_DATAROOTDIR}") # (...)/share
53
set (pkgdatadir "${datadir}/${CMAKE_PROJECT_NAME}") # (...)/cairo-dock
54
set (mandir "${prefix}/${CMAKE_INSTALL_MANDIR}") # (...)/man
53
56
set (VERSION_HELP "0.9.99") # needed to parse Help.conf.in
55
if( CMAKE_SIZEOF_VOID_P EQUAL 8 AND NOT "${FORCE_LIB64}" STREQUAL "") # 64bits and force install in lib64
56
set (libdir ${prefix}/lib64)
58
if( CMAKE_SIZEOF_VOID_P EQUAL 8 AND "${FORCE_LIB64}" STREQUAL "yes") # 64bits and force install in lib64
59
set (libdir "${prefix}/lib64")
58
set (libdir ${prefix}/lib${LIB_SUFFIX})
61
set (libdir "${prefix}/${CMAKE_INSTALL_LIBDIR}${LIB_SUFFIX}") # (...)/lib
61
set (includedir ${prefix}/include)
62
set (bindir ${prefix}/bin)
64
set (includedir "${prefix}/${CMAKE_INSTALL_INCLUDEDIR}") # (...)/include
65
set (bindir "${prefix}/${CMAKE_INSTALL_BINDIR}") # (...)/bin
64
67
########### dependencies ###############
66
set (packages_required "cairo librsvg-2.0 dbus-1 dbus-glib-1 libxml-2.0 xrender gl glu pangox libcurl") # for the .pc
69
set (packages_required "gthread-2.0 cairo librsvg-2.0 dbus-1 dbus-glib-1 libxml-2.0 xrender gl glu pangox libcurl") # for the .pc
67
70
pkg_check_modules ("PACKAGE" REQUIRED "${packages_required}")
69
72
set (xextend_required "xtst xcomposite xinerama") # for the .pc
74
77
set (xextend_required)
77
if (NOT "${force-gtk3}" STREQUAL "")
78
set (gtk_required "gtk+-3.0 gthread-2.0") # for the .pc
79
pkg_check_modules ("GTK" "${gtk_required}") # the check is not requiered because we can do with GTK2
80
if (NOT "${force-gtk2}" STREQUAL "yes") # by default, we use GTK+3 except if we force the use of GTK+2
81
set (gtk_required "gtk+-3.0") # for the .pc
82
pkg_check_modules ("GTK" "${gtk_required}") # the check is not set as 'required' because we can use GTK+2 if GTK+3 isn't available
82
85
if (NOT "${GTK_FOUND}")
83
set (gtk_required "gtk+-2.0 gthread-2.0") # for the .pc
86
set (gtk_required "gtk+-2.0") # for the .pc
84
87
pkg_check_modules ("GTK" REQUIRED "${gtk_required}") # the check is requiered this time because we need GTK anyway.
124
127
set (CAIRO_DOCK_SHARE_DATA_DIR ${pkgdatadir})
125
128
set (CAIRO_DOCK_SHARE_THEMES_DIR ${pkgdatadir}/themes)
126
129
#set (CAIRO_DOCK_MODULES_DIR ${libdir}/cairo-dock)
127
set (CAIRO_DOCK_LOCALE_DIR ${datadir}/locale)
130
set (CAIRO_DOCK_LOCALE_DIR ${CMAKE_INSTALL_LOCALEDIR})
128
131
set (CAIRO_DOCK_THEMES_DIR "themes")
129
132
set (CAIRO_DOCK_GETTEXT_PACKAGE ${GETTEXT_PACKAGE})
131
134
set (GLDI_GETTEXT_PACKAGE ${GETTEXT_PACKAGE})
132
135
set (GLDI_SHARE_DATA_DIR ${pkgdatadir})
133
136
set (GLDI_MODULES_DIR ${libdir}/cairo-dock)
137
set (GLDI_BIN_DIR ${bindir})
135
139
########### file generation ###############