summaryrefslogtreecommitdiff
blob: 460ebc2723dece5129a01fa7e16645c34c58fce1 (plain)
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
--- CMakeLists.txt.orig
+++ CMakeLists.txt
@@ -14,9 +14,6 @@ project ("cairo-dock")
 set (VERSION "3.0.0")
 
 add_definitions (-std=c99 -Wextra -Wwrite-strings -Wuninitialized -Werror-implicit-function-declaration -Wstrict-prototypes) # removed for stable versions: -Wstrict-prototypes #-Wunreachable-code -Wno-unused-parameter -Wall 
-if (NOT ${CMAKE_BUILD_TYPE})
-	add_definitions (-O3)
-endif()
 add_definitions (-DGL_GLEXT_PROTOTYPES="1")
 add_definitions (-DCAIRO_DOCK_DEFAULT_ICON_NAME="default-icon.svg")
 add_definitions (-DCAIRO_DOCK_ICON="cairo-dock.svg")
@@ -55,39 +52,33 @@ set (mandir "${prefix}/${CMAKE_INSTALL_M
 
 set (VERSION_HELP "0.9.991") # needed to parse Help.conf.in
 
-if( CMAKE_SIZEOF_VOID_P EQUAL 8 AND "${FORCE_LIB64}" STREQUAL "yes")  # 64bits and force install in lib64
-	set (libdir "${prefix}/lib64")
-else()
-	set (libdir "${prefix}/${CMAKE_INSTALL_LIBDIR}${LIB_SUFFIX}")  # (...)/lib
-endif()
+set (libdir "${prefix}/${CMAKE_INSTALL_LIBDIR}")  # (...)/lib
 
 set (includedir "${prefix}/${CMAKE_INSTALL_INCLUDEDIR}")  # (...)/include
 set (bindir "${prefix}/${CMAKE_INSTALL_BINDIR}")  # (...)/bin
 
+set (CMAKE_SKIP_BUILD_RPATH TRUE)
+set (CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)
+
 ########### dependencies ###############
 
 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
 STRING (REGEX REPLACE " " ";" packages_required_semicolon ${packages_required})  # replace blank space by semicolon => to have more details if a package is missing
 pkg_check_modules ("PACKAGE" REQUIRED "${packages_required_semicolon}")
 
-set (xextend_required "xtst xcomposite xinerama")  # for the .pc
-STRING (REGEX REPLACE " " ";" xextend_required_semicolon ${xextend_required})
-pkg_check_modules ("XEXTEND" "${xextend_required_semicolon}")
-if (${XEXTEND_FOUND})
+if (WITH_XEXTEND)
+	set (xextend_required "xtst xcomposite xinerama")  # for the .pc
+	STRING (REGEX REPLACE " " ";" xextend_required_semicolon ${xextend_required})
+	pkg_check_modules ("XEXTEND" REQUIRED "${xextend_required_semicolon}")
 	set (HAVE_XEXTEND 1)
-else()
-	set (xextend_required)
 endif()
 
-if (NOT "${force-gtk2}" STREQUAL "yes")  # by default, we use GTK+3 except if we force the use of GTK+2
-	set (gtk_required "gtk+-3.0")  # for the .pc
-	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
-endif()
-
-if (NOT "${GTK_FOUND}")
+if (WITH_GTK2) # by default, we use GTK+3 except if we force the use of GTK+2
 	set (gtk_required "gtk+-2.0")  # for the .pc
-	pkg_check_modules ("GTK" REQUIRED "${gtk_required}")  # the check is requiered this time because we need GTK anyway.
+else()
+	set (gtk_required "gtk+-3.0")  # for the .pc
 endif()
+pkg_check_modules ("GTK" REQUIRED "${gtk_required}") 
 
 STRING (REGEX REPLACE "\\..*" "" GTK_MAJOR "${GTK_VERSION}")
 
@@ -95,9 +86,13 @@ add_definitions (-DGTK_DISABLE_DEPRECATE
 # add_definitions (-DG_DISABLE_DEPRECATED="1")
 
 # We use crypt(3) which may be in libc, or in libcrypt (eg FreeBSD)
-check_library_exists (crypt encrypt "" HAVE_LIBCRYPT)
-if (${HAVE_LIBCRYPT})
-	set (LIBCRYPT_LIBS "-lcrypt")
+if (WITH_CRYPT)
+	check_library_exists (crypt encrypt "" HAVE_LIBCRYPT)
+	if (${HAVE_LIBCRYPT})
+		set (LIBCRYPT_LIBS "-lcrypt")
+	else()
+		MESSAGE (FATAL_ERROR "crypt not found!")
+	endif()
 endif()
 
 check_include_files ("math.h" HAVE_MATH_H)