/+junk/libgego

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/%2Bjunk/libgego
1 by Gustav Hartvigsson
* Initial code.
1
cmake_minimum_required (VERSION 2.8)
2
project(LibGego C)
3
4
list (APPEND CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake)
5
7 by Gustav Hartvigsson
* Fixed build... sort of
6
set (GLIB_REQUIRED 2.26)
1 by Gustav Hartvigsson
* Initial code.
7
14 by Gustav Hartvigsson
* Moved build_docs into ./docs/
8
set (LIBGEGO_VERSION 0_0)
9
set (LIBGEGO_VERSION_STRING "0.0")
10
1 by Gustav Hartvigsson
* Initial code.
11
find_package (GLIB)
12
find_package (GObjectIntrospection)
7 by Gustav Hartvigsson
* Fixed build... sort of
13
find_package (LibSoup2)
12 by Gustav Hartvigsson
* CleanUp of CMakeLists.txt
14
find_package (GIO)
15
16 by Gustav Hartvigsson
* Moved GegoWebApplication out of the way
16
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=c11 -Wall")
12 by Gustav Hartvigsson
* CleanUp of CMakeLists.txt
17
18
if (NOT GLIB2_FOUND)
19
  message (FATAL_ERROR "Could not find GLib2. This is required for compiling LibGego.")
20
else ()
21
  message ("GLib2 Found")
22
endif ()
23
24
if (NOT GIO_FOUND)
25
  message (FATAL_ERROR "Could not find GIO. This is required for compiling LibGego.")
26
else ()
27
  message ("GIO Found.")
28
endif()
29
30
if (NOT LIBSOUP2_FOUND)
31
  message (FATAL_ERROR "LibSoup is not installed. This is required for compiling of LibGego.")
32
else ()
33
  message ("LibSoup2 Found.")
34
endif ()
1 by Gustav Hartvigsson
* Initial code.
35
36
#
37
# Pull in GLib. Verison number is arbitrary, A miminum of 2.30 should do it.
38
# And add it to the build thingy.
13 by Gustav Hartvigsson
* Fixed Gir... I Think
39
list (APPEND CFLAGS ${GLIB2_CFLAGS} ${GIO_INCLUDE_DIR} ${LIBSOUP24_INCLUDE_DIRS})
40
include_directories (${CFLAGS})
12 by Gustav Hartvigsson
* CleanUp of CMakeLists.txt
41
list (APPEND LIBS ${GLIB2_LIBRARIES} ${GIO_LIBRARIES} ${LIBSOUP24_LIBRARIES})
1 by Gustav Hartvigsson
* Initial code.
42
43
add_subdirectory (src)
44
45
add_library (gego SHARED ${GEGO_SRC})
19 by Gustav Hartvigsson
* Link libgego against the GLib stuffs.
46
target_link_libraries (gego ${LIBS})
1 by Gustav Hartvigsson
* Initial code.
47
4 by Gustav Hartvigsson
* Changed err to the correct type
48
if (INTROSPECTION_FOUND)
49
  message ("GObject Introspection is installed.")
50
  include (GObjectIntrospectionMacros)
51
  
52
  set (INTROSPECTION_GIRS)
14 by Gustav Hartvigsson
* Moved build_docs into ./docs/
53
  #set (INTROSPECTION_SCANNER_ARGS "--add-include-path=${CMAKE_CURRENT_SOURCE_DIR}/src --warn-all")
54
  #set (INTROSPECTION_COMPILER_ARGS "--includedir=${CMAKE_CURRENT_SOURCE_DIR}/src --warn-all")
4 by Gustav Hartvigsson
* Changed err to the correct type
55
  
13 by Gustav Hartvigsson
* Fixed Gir... I Think
56
  set (libgego_0_0_gir "libgego")
57
  
14 by Gustav Hartvigsson
* Moved build_docs into ./docs/
58
  set (libgego_${LIBGEGO_VERSION}_gir_INCLUDES GLib-2.0 Gio-2.0 Soup-2.4)
59
  set (libgego_${LIBGEGO_VERSION}_gir_LIBS gego)
20 by Gustav Hartvigsson
* This seems more correct...
60
  set (libgego_${LIBGEGO_VERSION}_gir_NAMESPACE gego)
61
  set (libgego_${LIBGEGO_VERSION}_gir_CFLAGS "-I./src -I../src/")
13 by Gustav Hartvigsson
* Fixed Gir... I Think
62
  
14 by Gustav Hartvigsson
* Moved build_docs into ./docs/
63
  set (libgego_${LIBGEGO_VERSION}_gir_FILES ${GEGO_SRC})
64
  set (libgego_${LIBGEGO_VERSION}_gir_EXPORT_PACKAGES libgego)
13 by Gustav Hartvigsson
* Fixed Gir... I Think
65
  
66
  list (APPEND INTROSPECTION_GIRS libgego-0.0.gir)
4 by Gustav Hartvigsson
* Changed err to the correct type
67
  
68
  gir_add_introspections(INTROSPECTION_GIRS)
69
  
70
else ()
71
  message ("GObject Introspection is NOT installed.")
72
endif ()