author | Myhailo Danylenko <isbear@ukrpost.net> |
Sun, 17 Feb 2013 06:00:16 +0200 | |
changeset 61 | b0b6e8307e38 |
parent 59 | 50173578fddc |
child 63 | d644c08bbc27 |
permissions | -rw-r--r-- |
56 | 1 |
## Copyright 2009-2012 Myhailo Danylenko |
2 |
# This file is part of mcabber-disco |
|
0 | 3 |
# |
56 | 4 |
# mcabber-disco is a free software: you can redistribute it and/or |
5 |
# modify it under the terms of the GNU General Public License as |
|
6 |
# published by the Free Software Foundation, either version 2 of the |
|
7 |
# License, or (at your option) any later version. |
|
0 | 8 |
# |
9 |
# This program is distributed in the hope that it will be useful, |
|
10 |
# but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
11 |
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
12 |
# GNU General Public License for more details. |
|
13 |
# |
|
14 |
# You should have received a copy of the GNU General Public License |
|
15 |
# along with this program. If not, see <http://www.gnu.org/licenses/>. |
|
16 |
||
17 |
cmake_minimum_required(VERSION 2.6) |
|
18 |
project(disco C) |
|
61
b0b6e8307e38
v0.0.2, change deb naming scheme
Myhailo Danylenko <isbear@ukrpost.net>
parents:
59
diff
changeset
|
19 |
set(PROJECT_VERSION "0.0.2") |
0 | 20 |
|
20
035a59c47d69
Fix linker libraries search path
Myhailo Danylenko <isbear@ukrpost.net>
parents:
19
diff
changeset
|
21 |
## User settable options |
035a59c47d69
Fix linker libraries search path
Myhailo Danylenko <isbear@ukrpost.net>
parents:
19
diff
changeset
|
22 |
|
035a59c47d69
Fix linker libraries search path
Myhailo Danylenko <isbear@ukrpost.net>
parents:
19
diff
changeset
|
23 |
## Check for build dependencies |
035a59c47d69
Fix linker libraries search path
Myhailo Danylenko <isbear@ukrpost.net>
parents:
19
diff
changeset
|
24 |
find_package(PkgConfig REQUIRED) |
035a59c47d69
Fix linker libraries search path
Myhailo Danylenko <isbear@ukrpost.net>
parents:
19
diff
changeset
|
25 |
pkg_check_modules(GLIB REQUIRED glib-2.0) |
22
6d0d6bbf98d0
Use xmpp_is_online and unregiste_reply_handler
Myhailo Danylenko <isbear@ukrpost.net>
parents:
20
diff
changeset
|
26 |
pkg_check_modules(LM REQUIRED loudmouth-1.0) |
26
91987ea19f24
Use pkg-config to find mcabber headers
Myhailo Danylenko <isbear@ukrpost.net>
parents:
24
diff
changeset
|
27 |
pkg_check_modules(MCABBER REQUIRED mcabber) |
22
6d0d6bbf98d0
Use xmpp_is_online and unregiste_reply_handler
Myhailo Danylenko <isbear@ukrpost.net>
parents:
20
diff
changeset
|
28 |
include(CheckSymbolExists) |
6d0d6bbf98d0
Use xmpp_is_online and unregiste_reply_handler
Myhailo Danylenko <isbear@ukrpost.net>
parents:
20
diff
changeset
|
29 |
set(CMAKE_REQUIRED_INCLUDES ${LM_INCLUDE_DIRS}) |
6d0d6bbf98d0
Use xmpp_is_online and unregiste_reply_handler
Myhailo Danylenko <isbear@ukrpost.net>
parents:
20
diff
changeset
|
30 |
set(CMAKE_REQUIRED_LIBRARIES ${LM_LIBRARIES}) |
6d0d6bbf98d0
Use xmpp_is_online and unregiste_reply_handler
Myhailo Danylenko <isbear@ukrpost.net>
parents:
20
diff
changeset
|
31 |
set(CMAKE_REQUIRED_FLAGS ${LM_LDFLAGS} ${LM_CFLAGS}) |
6d0d6bbf98d0
Use xmpp_is_online and unregiste_reply_handler
Myhailo Danylenko <isbear@ukrpost.net>
parents:
20
diff
changeset
|
32 |
check_symbol_exists(lm_connection_unregister_reply_handler loudmouth/loudmouth.h HAVE_LM_CONNECTION_UNREGISTER_REPLY_HANDLER) |
59 | 33 |
include(CheckCSourceCompiles) |
34 |
set(CMAKE_REQUIRED_INCLUDES ${MCABBER_INCLUDE_DIRS}) |
|
35 |
set(CMAKE_REQUIRED_LIBRARIES ${MCABBER_LIBRARIES}) |
|
36 |
set(CMAKE_REQUIRED_FLAGS ${MCABBER_LDFLAGS} ${MCABBER_CFLAGS}) |
|
37 |
check_c_source_compiles(" |
|
38 |
#include <glib.h> |
|
39 |
#include <mcabber/api.h> |
|
40 |
#ifdef MCABBER_API_HAVE_COMPL_FLAGS |
|
41 |
int main (void) { return 0; } |
|
42 |
#endif |
|
43 |
" HAVE_MCABBER_COMPLETION_FLAGS) |
|
20
035a59c47d69
Fix linker libraries search path
Myhailo Danylenko <isbear@ukrpost.net>
parents:
19
diff
changeset
|
44 |
link_directories(${GLIB_LIBRARY_DIRS} |
26
91987ea19f24
Use pkg-config to find mcabber headers
Myhailo Danylenko <isbear@ukrpost.net>
parents:
24
diff
changeset
|
45 |
${LM_LIBRARY_DIRS} |
91987ea19f24
Use pkg-config to find mcabber headers
Myhailo Danylenko <isbear@ukrpost.net>
parents:
24
diff
changeset
|
46 |
${MCABBER_LIBRARY_DIRS}) |
20
035a59c47d69
Fix linker libraries search path
Myhailo Danylenko <isbear@ukrpost.net>
parents:
19
diff
changeset
|
47 |
|
0 | 48 |
## Target definitions |
16
e903da874e63
Provide public interface to disco requests
Myhailo Danylenko <isbear@ukrpost.net>
parents:
12
diff
changeset
|
49 |
add_library(disco MODULE disco.c) |
0 | 50 |
|
20
035a59c47d69
Fix linker libraries search path
Myhailo Danylenko <isbear@ukrpost.net>
parents:
19
diff
changeset
|
51 |
## Compiler setup |
22
6d0d6bbf98d0
Use xmpp_is_online and unregiste_reply_handler
Myhailo Danylenko <isbear@ukrpost.net>
parents:
20
diff
changeset
|
52 |
configure_file(config.h.in config.h) |
20
035a59c47d69
Fix linker libraries search path
Myhailo Danylenko <isbear@ukrpost.net>
parents:
19
diff
changeset
|
53 |
include_directories(SYSTEM ${GLIB_INCLUDE_DIRS} |
035a59c47d69
Fix linker libraries search path
Myhailo Danylenko <isbear@ukrpost.net>
parents:
19
diff
changeset
|
54 |
${LM_INCLUDE_DIRS} |
26
91987ea19f24
Use pkg-config to find mcabber headers
Myhailo Danylenko <isbear@ukrpost.net>
parents:
24
diff
changeset
|
55 |
${MCABBER_INCLUDE_DIRS}) |
20
035a59c47d69
Fix linker libraries search path
Myhailo Danylenko <isbear@ukrpost.net>
parents:
19
diff
changeset
|
56 |
target_link_libraries(disco ${GLIB_LIBRARIES} |
26
91987ea19f24
Use pkg-config to find mcabber headers
Myhailo Danylenko <isbear@ukrpost.net>
parents:
24
diff
changeset
|
57 |
${LM_LIBRARIES} |
91987ea19f24
Use pkg-config to find mcabber headers
Myhailo Danylenko <isbear@ukrpost.net>
parents:
24
diff
changeset
|
58 |
${MCABBER_LIBRARIES}) |
20
035a59c47d69
Fix linker libraries search path
Myhailo Danylenko <isbear@ukrpost.net>
parents:
19
diff
changeset
|
59 |
include_directories(${disco_SOURCE_DIR} |
035a59c47d69
Fix linker libraries search path
Myhailo Danylenko <isbear@ukrpost.net>
parents:
19
diff
changeset
|
60 |
${disco_BINARY_DIR}) |
30
060c59f6f3de
Fix compilation warnings
Myhailo Danylenko <isbear@ukrpost.net>
parents:
28
diff
changeset
|
61 |
set_target_properties(disco PROPERTIES COMPILE_FLAGS "-Wall") |
20
035a59c47d69
Fix linker libraries search path
Myhailo Danylenko <isbear@ukrpost.net>
parents:
19
diff
changeset
|
62 |
|
0 | 63 |
## Packaging information |
61
b0b6e8307e38
v0.0.2, change deb naming scheme
Myhailo Danylenko <isbear@ukrpost.net>
parents:
59
diff
changeset
|
64 |
set(CPACK_PACKAGE_NAME mcabber-mod-disco) |
28
ff36ae7e2b1e
Use new module struct with api
Myhailo Danylenko <isbear@ukrpost.net>
parents:
27
diff
changeset
|
65 |
set(CPACK_PACKAGE_VERSION ${PROJECT_VERSION}) |
0 | 66 |
set(CPACK_PACKAGE_VENDOR "IsBear") |
67 |
set(CPACK_PACKAGE_CONTACT "Myhailo Danylenko <isbear@ukrpost.net>") |
|
16
e903da874e63
Provide public interface to disco requests
Myhailo Danylenko <isbear@ukrpost.net>
parents:
12
diff
changeset
|
68 |
set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "Mcabber module for service discovery requests") |
0 | 69 |
set(CPACK_RESOURCE_FILE_LICENSE ${disco_SOURCE_DIR}/COPYING) |
70 |
set(CPACK_SOURCE_GENERATOR TBZ2) |
|
71 |
set(CPACK_GENERATOR DEB CACHE TEXT "Binary package generator, eg DEB, RPM, TGZ, NSIS...") |
|
72 |
set(CPACK_DEBIAN_PACKAGE_SECTION libs) |
|
73 |
find_program(DPKG_EXECUTABLE dpkg) |
|
74 |
if(DPKG_EXECUTABLE) |
|
75 |
execute_process(COMMAND ${DPKG_EXECUTABLE} --print-architecture OUTPUT_VARIABLE CPACK_DEBIAN_PACKAGE_ARCHITECTURE OUTPUT_STRIP_TRAILING_WHITESPACE) |
|
76 |
else() |
|
77 |
set(CPACK_DEBIAN_PACKAGE_ARCHITECTURE i386 CACHE TEXT "Architecture of package") |
|
78 |
endif() |
|
79 |
set(CPACK_PACKAGE_FILE_NAME "${CPACK_PACKAGE_NAME}_${CPACK_PACKAGE_VERSION}_${CPACK_DEBIAN_PACKAGE_ARCHITECTURE}") |
|
80 |
set(CPACK_SOURCE_IGNORE_FILES "/\\\\..*;\\\\.swp;~$;/build/;\\\\.tar\\\\.;\\\\.deb;\\\\.so") |
|
81 |
include(CPack) |
|
82 |
||
59 | 83 |
if(HAVE_MCABBER_COMPLETION_FLAGS) |
84 |
set(AVV_COMPL_VERSION "compl:4") |
|
85 |
else() |
|
86 |
set(AVV_COMPL_VERSION "compl:2 | compl:3") |
|
87 |
endif() |
|
49
a9c3cc3626ca
Update versions & add AVV description
Myhailo Danylenko <isbear@ukrpost.net>
parents:
30
diff
changeset
|
88 |
configure_file(disco.avv.in disco.avv) |
a9c3cc3626ca
Update versions & add AVV description
Myhailo Danylenko <isbear@ukrpost.net>
parents:
30
diff
changeset
|
89 |
|
24
220a7d7b8be0
Fix documentation installation path
Myhailo Danylenko <isbear@ukrpost.net>
parents:
22
diff
changeset
|
90 |
## Installation |
220a7d7b8be0
Fix documentation installation path
Myhailo Danylenko <isbear@ukrpost.net>
parents:
22
diff
changeset
|
91 |
install(TARGETS disco DESTINATION lib/mcabber) |
56 | 92 |
install(FILES docs/disco.rc COPYING docs/todo.mdwn docs/readme.mdwn DESTINATION share/doc/${CPACK_PACKAGE_NAME}) |
24
220a7d7b8be0
Fix documentation installation path
Myhailo Danylenko <isbear@ukrpost.net>
parents:
22
diff
changeset
|
93 |
install(FILES disco.h DESTINATION include/mcabber) |
220a7d7b8be0
Fix documentation installation path
Myhailo Danylenko <isbear@ukrpost.net>
parents:
22
diff
changeset
|
94 |
install(DIRECTORY help DESTINATION share/mcabber) |
49
a9c3cc3626ca
Update versions & add AVV description
Myhailo Danylenko <isbear@ukrpost.net>
parents:
30
diff
changeset
|
95 |
install(FILES ${PROJECT_BINARY_DIR}/disco.avv DESTINATION share/mcabber/avv/modules RENAME disco) |
24
220a7d7b8be0
Fix documentation installation path
Myhailo Danylenko <isbear@ukrpost.net>
parents:
22
diff
changeset
|
96 |
|
0 | 97 |
## The End ## vim: se ts=4: ## |