summaryrefslogtreecommitdiff
path: root/cmake
diff options
context:
space:
mode:
authorMarcel Hollerbach <marcel-hollerbach@t-online.de>2017-02-03 19:23:47 +0100
committerMarcel Hollerbach <marcel-hollerbach@t-online.de>2017-02-07 09:24:52 +0100
commitbcdde959e6f43c49d520a5ec5b32aca91affa5ca (patch)
treecfe14b6b169adfcb5854eed7858cf84e952e28cf /cmake
parente34f36be12d4f32ea5d70ff8a763b37bed818083 (diff)
cmake: add ecore_x
Diffstat (limited to 'cmake')
-rw-r--r--cmake/config/ecore_x.cmake110
1 files changed, 110 insertions, 0 deletions
diff --git a/cmake/config/ecore_x.cmake b/cmake/config/ecore_x.cmake
new file mode 100644
index 0000000000..e95e6b2aba
--- /dev/null
+++ b/cmake/config/ecore_x.cmake
@@ -0,0 +1,110 @@
1include(FindX11)
2
3EFL_OPTION(XGESTURE "Whenever you want ecore_x to use gesture" OFF)
4EFL_OPTION(XPRESENT "Whenever you want ecore_x to use xpresent" OFF)
5EFL_OPTION(XINPUT2 "Whenever you want ecore_x to use xinput2" ON)
6EFL_OPTION(XINPUT22 "Whenever you want ecore_x to use xinput22" OFF)
7
8#the rest is just statically enabled
9CHECK_APPEND_DEFINE(HAVE_ECORE_X_XLIB ON)
10CHECK_APPEND_DEFINE(ECORE_XKB ON)
11CHECK_APPEND_DEFINE(ECORE_XCOMPOSITE ON)
12CHECK_APPEND_DEFINE(ECORE_XDAMAGE ON)
13CHECK_APPEND_DEFINE(ECORE_XDPMS ON)
14CHECK_APPEND_DEFINE(ECORE_XFIXES ON)
15CHECK_APPEND_DEFINE(ECORE_XINERAMA ON)
16CHECK_APPEND_DEFINE(ECORE_XRANDR ON)
17CHECK_APPEND_DEFINE(ECORE_XSS ON)
18CHECK_APPEND_DEFINE(ECORE_XTEST ON)
19
20#FindX11 does not cover all parts we need so here are the 4 extensions we need to check
21
22#copied from https://github.com/Kitware/CMake/blob/master/Modules/FindX11.cmake#L65
23set(X11_INC_SEARCH_PATH
24 /usr/pkg/xorg/include
25 /usr/X11R6/include
26 /usr/X11R7/include
27 /usr/include/X11
28 /usr/openwin/include
29 /usr/openwin/share/include
30 /opt/graphics/OpenGL/include
31 /opt/X11/include
32)
33
34set(X11_LIB_SEARCH_PATH
35 /usr/pkg/xorg/lib
36 /usr/X11R6/lib
37 /usr/X11R7/lib
38 /usr/openwin/lib
39 /opt/X11/lib
40)
41
42macro(find_lib_and_include name path lib)
43 string(TOUPPER ${name} ecore_name)
44 set(X11_${name}_FOUND OFF)
45 find_library(X11_${name}_LIB ${lib} ${X11_LIB_SEARCH_PATH})
46 find_path(X11_${name}_INCLUDE_PATH X11/extensions/${path} ${X11_INC_SEARCH_PATH})
47 if (X11_${name}_LIB AND X11_${name}_INCLUDE_PATH)
48 set(X11_${name}_FOUND ON)
49 endif()
50
51 CHECK_APPEND_DEFINE(ECORE_${ecore_name} ON)
52endmacro()
53
54if (${XGESTURE})
55 find_lib_and_include(XGesture gesture.h Xgesture)
56endif()
57
58if(${XPRESENT})
59 find_lib_and_include(Xpresent Xpresent.h Xpresent)
60endif()
61
62if(${XINPUT2})
63 find_lib_and_include(Xi2 XInput2.h Xi)
64endif()
65
66if(${XINPUT22})
67 find_lib_and_include(Xi2_2 Xpresent2.h Xi)
68endif()
69
70#build a list of all components we use
71set(_X_EXTENSIONS
72 X11
73 X11_Xkb
74 X11_Xcomposite
75 X11_Xdamage
76 X11_dpms
77 X11_Xfixes
78 X11_Xinerama
79 X11_Xrandr
80 X11_Xrender
81 X11_XTest
82 X11_Xscreensaver
83)
84
85if(${XGESTURE})
86 list(APPEND _X_EXTENSIONS X11_Xgesture)
87endif()
88
89if(${XPRESENT})
90 list(APPEND _X_EXTENSIONS X11_Xpresent)
91endif()
92
93if(${XINPUT2})
94 list(APPEND _X_EXTENSIONS X11_Xi2)
95endif()
96
97if(${XINPUT22})
98 list(APPEND _X_EXTENSIONS X11_Xi2_2)
99endif()
100
101foreach(ext ${_X_EXTENSIONS})
102 if (NOT ${ext}_FOUND)
103 message(FATAL_ERROR "Xserver extension ${ext} not found")
104 endif()
105 list(APPEND X_EXTENSIONS find-${ext})
106endforeach()
107
108configure_file(
109 ${PROJECT_SOURCE_DIR}/src/lib/ecore_x/ecore_x_version.h.cmake
110 ${PROJECT_BINARY_DIR}/src/lib/ecore_x/ecore_x_version.h)