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
82
83
84
85
86
87
88
89
90
cmake_minimum_required(VERSION 2.6)

#definition du projet
project (d7c)

set(EXECUTABLE_OUTPUT_PATH bin)
set(package_name d7c)
set(package_version svn0.2)
set(email_report alexisis-pristontale@hotmail.com)


#recherche de getext
include(FindGettext)
find_package(Gettext)

if (NOT GETTEXT_FOUND)
  message(FATAL_ERROR "missing gettext : please install it")
endif (NOT GETTEXT_FOUND)

#verification des bibliothéques
SET(CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake ${CMAKE_MODULE_PATH})
include(UseLibraries)
USE_LIBRARIES(glib2 gcrypt ircclient)
if (NOT HAVE_glib2)
  message(FATAL_ERROR "missing glib2 : please install it")
endif (NOT HAVE_glib2)
if (NOT HAVE_gcrypt)
  message(FATAL_ERROR "missing gcrypt : please install it")
endif (NOT HAVE_gcrypt)
if (NOT HAVE_ircclient)
  message(FATAL_ERROR "missing libircclient : please install it")
endif (NOT HAVE_ircclient)

find_package(SQLite REQUIRED)
if (NOT SQLite_FOUND)
  message(FATAL_ERROR "missing sqlite3 : please install it")
endif (NOT SQLite_FOUND)
#inclusion des bibliothéques au projet
include_directories(
      ${USE_gcrypt_INCLUDE_DIR}
      ${USE_glib2_INCLUDE_DIR_1}
      ${USE_glib2_INCLUDE_DIR_2}
      ${USE_ircclient_INCLUDE_DIR}
      ${SQLITE_INCLUDE_DIRS}
       )
link_directories(
      ${USE_gcrypt_LIBRARY}
      ${USE_glib2_LIBRARY}
      ${USE_ircclient_LIBRARY}
      ${SQLITE_LIBRARIES}
    )
message(
    "message : "
    ${USE_ircclient_INCLUDE_DIR}
       )

#identification des fichiers
file (
  GLOB_RECURSE
  sources_files
  src/*.[hc]
     )
add_executable (
      d7c
      ${sources_files}    
         )
target_link_libraries (
        d7c
        ${LIBRARIES}
        sqlite3
          )

#mise a jour du fichier pot
file (
  GLOB_RECURSE
  po_files
  po/*.po
     ) 
add_custom_target(
      update_pot
      COMMAND xgettext -d ${package_name} -s -o
${package_name}.pot ./src/*.c -p ./po 
--from-code=utf8 -j -k=_
--package-name=${package_name} 
--package-version=${package_version} 
--msgid-bugs-address=${email_report}
--force-po
      COMMAND msgmerge --update ${po_files}
./po/${package_name}.pot
    )