/+junk/libgego

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/%2Bjunk/libgego
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
cmake_minimum_required (VERSION 2.8)
project(LibGego C)

list (APPEND CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake)


set (GLIB_REQUIRED 2.26)

find_package (GLIB)
find_package (GObjectIntrospection)
find_package (LibSoup2)
find_package (GIO)


if (NOT GLIB2_FOUND)
  message (FATAL_ERROR "Could not find GLib2. This is required for compiling LibGego.")
else ()
  message ("GLib2 Found")
endif ()

if (NOT GIO_FOUND)
  message (FATAL_ERROR "Could not find GIO. This is required for compiling LibGego.")
else ()
  message ("GIO Found.")
endif()

if (NOT LIBSOUP2_FOUND)
  message (FATAL_ERROR "LibSoup is not installed. This is required for compiling of LibGego.")
else ()
  message ("LibSoup2 Found.")
endif ()

#
# Pull in GLib. Verison number is arbitrary, A miminum of 2.30 should do it.
# And add it to the build thingy.
include_directories (${GLIB2_CFLAGS} ${GIO_INCLUDE_DIR} ${LIBSOUP24_INCLUDE_DIRS})
list (APPEND LIBS ${GLIB2_LIBRARIES} ${GIO_LIBRARIES} ${LIBSOUP24_LIBRARIES})

add_subdirectory (src)

add_library (gego SHARED ${GEGO_SRC})

if (INTROSPECTION_FOUND)
  message ("GObject Introspection is installed.")
  include (GObjectIntrospectionMacros)
  
  set (INTROSPECTION_GIRS)
  set (INTROSPECTION_SCANNER_ARGS "--add-include-path=${CMAKE_CURRENT_SOURCE_DIR}/src --warn-all")
  set (INTROSPECTION_COMPILER_ARGS "--includedir=${CMAKE_CURRENT_SOURCE_DIR}/src")
  
  set (gego_0_0_gir "gego")
  
  set (gego_0_0_gir_INCLUDES GLib-2.0 Soup-2.4)
  set (gego_0_0_gir_LIBS gego)
  set (gego_0_0_gir_CFLAGS ${LIBS})
  
  set (gego_0_0_gir_FILES ${GEGO_SRC})
  set (gego_0_0_gir_SCANNERFLAGS --c-include=libgego.h)
  set (gego_0_0_gir_EXPORT_PACKAGES libgego)
  
  list (APPEND INTROSPECTION_GIRS gego-0.0.gir)
  
  gir_add_introspections(INTROSPECTION_GIRS)
  
else ()
  message ("GObject Introspection is NOT installed.")
endif ()