author | Myhailo Danylenko <isbear@ukrpost.net> |
Tue, 03 May 2011 02:30:09 +0300 | |
changeset 32 | 7814ba3dc10c |
parent 27 | c641ef370d18 |
child 33 | 1cc77413e85d |
permissions | -rw-r--r-- |
0 | 1 |
## Copyright 2009 Myhailo Danylenko |
2 |
# This file is part of mcabber module writing howto examples. |
|
3 |
# |
|
4 |
# Examples are free software: you can redistribute it and/or modify |
|
5 |
# it under the terms of the GNU General Public License as published by |
|
6 |
# the Free Software Foundation, either version 2 of the License, or |
|
7 |
# (at your option) any later version. |
|
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(avatar C) |
|
24
7aa499342e2b
Use new interface to obtain available screen space
Myhailo Danylenko <isbear@ukrpost.net>
parents:
23
diff
changeset
|
19 |
set(PROJECT_VERSION "0.0.1") |
0 | 20 |
|
13
6ed6279de87f
Fix linker library search path
Myhailo Danylenko <isbear@ukrpost.net>
parents:
12
diff
changeset
|
21 |
## User settable options |
6ed6279de87f
Fix linker library search path
Myhailo Danylenko <isbear@ukrpost.net>
parents:
12
diff
changeset
|
22 |
|
6ed6279de87f
Fix linker library search path
Myhailo Danylenko <isbear@ukrpost.net>
parents:
12
diff
changeset
|
23 |
## Check for build dependencies |
6ed6279de87f
Fix linker library search path
Myhailo Danylenko <isbear@ukrpost.net>
parents:
12
diff
changeset
|
24 |
find_package(PkgConfig REQUIRED) |
6ed6279de87f
Fix linker library search path
Myhailo Danylenko <isbear@ukrpost.net>
parents:
12
diff
changeset
|
25 |
pkg_check_modules(GLIB REQUIRED glib-2.0) |
6ed6279de87f
Fix linker library search path
Myhailo Danylenko <isbear@ukrpost.net>
parents:
12
diff
changeset
|
26 |
pkg_check_modules(LM REQUIRED loudmouth-1.0) |
22
4f45c246856c
Remove dependency on libpng version
Myhailo Danylenko <isbear@ukrpost.net>
parents:
21
diff
changeset
|
27 |
pkg_check_modules(PNG REQUIRED libpng) |
20
df9cedcdb3b2
Use pkg-config to find mcabber headers
Myhailo Danylenko <isbear@ukrpost.net>
parents:
17
diff
changeset
|
28 |
pkg_check_modules(MCABBER REQUIRED mcabber) |
13
6ed6279de87f
Fix linker library search path
Myhailo Danylenko <isbear@ukrpost.net>
parents:
12
diff
changeset
|
29 |
set(AALIB_LIBRARY_DIRS "/usr/lib" CACHE FILEPATH "Path, where AAlib is located") |
6ed6279de87f
Fix linker library search path
Myhailo Danylenko <isbear@ukrpost.net>
parents:
12
diff
changeset
|
30 |
set(AALIB_INCLUDE_DIRS "/usr/include" CACHE FILEPATH "Path to AAlib includes") |
6ed6279de87f
Fix linker library search path
Myhailo Danylenko <isbear@ukrpost.net>
parents:
12
diff
changeset
|
31 |
set(AALIB_LIBRARIES "-laa" CACHE TEXT "Libraries, necessary to link with AAlib") |
20
df9cedcdb3b2
Use pkg-config to find mcabber headers
Myhailo Danylenko <isbear@ukrpost.net>
parents:
17
diff
changeset
|
32 |
include(CheckIncludeFile) |
df9cedcdb3b2
Use pkg-config to find mcabber headers
Myhailo Danylenko <isbear@ukrpost.net>
parents:
17
diff
changeset
|
33 |
set(CMAKE_REQUIRED_INCLUDES ${MCABBER_INCLUDE_DIRS}) |
df9cedcdb3b2
Use pkg-config to find mcabber headers
Myhailo Danylenko <isbear@ukrpost.net>
parents:
17
diff
changeset
|
34 |
check_include_file(mcabber/pep.h HAVE_MCABBER_PEP_H) |
df9cedcdb3b2
Use pkg-config to find mcabber headers
Myhailo Danylenko <isbear@ukrpost.net>
parents:
17
diff
changeset
|
35 |
if(NOT HAVE_MCABBER_PEP_H) |
df9cedcdb3b2
Use pkg-config to find mcabber headers
Myhailo Danylenko <isbear@ukrpost.net>
parents:
17
diff
changeset
|
36 |
message(SEND_ERROR "Pep module header not found") |
14 | 37 |
endif() |
38 |
include(CheckSymbolExists) |
|
39 |
set(CMAKE_REQUIRED_INCLUDES ${LM_INCLUDE_DIRS}) |
|
40 |
set(CMAKE_REQUIRED_LIBRARIES ${LM_LIBRARIES}) |
|
41 |
set(CMAKE_REQUIRED_FLAGS ${LM_LDFLAGS} ${LM_CFLAGS}) |
|
42 |
check_symbol_exists(lm_connection_unregister_reply_handler loudmouth/loudmouth.h HAVE_LM_CONNECTION_UNREGISTER_REPLY_HANDLER) |
|
13
6ed6279de87f
Fix linker library search path
Myhailo Danylenko <isbear@ukrpost.net>
parents:
12
diff
changeset
|
43 |
link_directories(${GLIB_LIBRARY_DIRS} |
6ed6279de87f
Fix linker library search path
Myhailo Danylenko <isbear@ukrpost.net>
parents:
12
diff
changeset
|
44 |
${LM_LIBRARY_DIRS} |
6ed6279de87f
Fix linker library search path
Myhailo Danylenko <isbear@ukrpost.net>
parents:
12
diff
changeset
|
45 |
${PNG_LIBRARY_DIRS} |
20
df9cedcdb3b2
Use pkg-config to find mcabber headers
Myhailo Danylenko <isbear@ukrpost.net>
parents:
17
diff
changeset
|
46 |
${AALIB_LIBRARY_DIRS} |
df9cedcdb3b2
Use pkg-config to find mcabber headers
Myhailo Danylenko <isbear@ukrpost.net>
parents:
17
diff
changeset
|
47 |
${MCABBER_LIBRARY_DIRS}) |
13
6ed6279de87f
Fix linker library search path
Myhailo Danylenko <isbear@ukrpost.net>
parents:
12
diff
changeset
|
48 |
|
0 | 49 |
## Target definitions |
50 |
add_library(avatar MODULE avatar.c) |
|
51 |
||
13
6ed6279de87f
Fix linker library search path
Myhailo Danylenko <isbear@ukrpost.net>
parents:
12
diff
changeset
|
52 |
## Compiler setup |
14 | 53 |
configure_file(config.h.in config.h) |
13
6ed6279de87f
Fix linker library search path
Myhailo Danylenko <isbear@ukrpost.net>
parents:
12
diff
changeset
|
54 |
include_directories(SYSTEM ${GLIB_INCLUDE_DIRS} |
6ed6279de87f
Fix linker library search path
Myhailo Danylenko <isbear@ukrpost.net>
parents:
12
diff
changeset
|
55 |
${LM_INCLUDE_DIRS} |
6ed6279de87f
Fix linker library search path
Myhailo Danylenko <isbear@ukrpost.net>
parents:
12
diff
changeset
|
56 |
${PNG_INCLUDE_DIRS} |
6ed6279de87f
Fix linker library search path
Myhailo Danylenko <isbear@ukrpost.net>
parents:
12
diff
changeset
|
57 |
${AALIB_INCLUDE_DIRS} |
20
df9cedcdb3b2
Use pkg-config to find mcabber headers
Myhailo Danylenko <isbear@ukrpost.net>
parents:
17
diff
changeset
|
58 |
${MCABBER_INCLUDE_DIRS}) |
13
6ed6279de87f
Fix linker library search path
Myhailo Danylenko <isbear@ukrpost.net>
parents:
12
diff
changeset
|
59 |
target_link_libraries(avatar ${GLIB_LIBRARIES} |
6ed6279de87f
Fix linker library search path
Myhailo Danylenko <isbear@ukrpost.net>
parents:
12
diff
changeset
|
60 |
${LM_LIBRARIES} |
6ed6279de87f
Fix linker library search path
Myhailo Danylenko <isbear@ukrpost.net>
parents:
12
diff
changeset
|
61 |
${PNG_LIBRARIES} |
20
df9cedcdb3b2
Use pkg-config to find mcabber headers
Myhailo Danylenko <isbear@ukrpost.net>
parents:
17
diff
changeset
|
62 |
${AALIB_LIBRARIES} |
df9cedcdb3b2
Use pkg-config to find mcabber headers
Myhailo Danylenko <isbear@ukrpost.net>
parents:
17
diff
changeset
|
63 |
${MCABBER_LIBRARIES}) |
13
6ed6279de87f
Fix linker library search path
Myhailo Danylenko <isbear@ukrpost.net>
parents:
12
diff
changeset
|
64 |
include_directories(${avatar_SOURCE_DIR} |
6ed6279de87f
Fix linker library search path
Myhailo Danylenko <isbear@ukrpost.net>
parents:
12
diff
changeset
|
65 |
${avatar_BINARY_DIR}) |
27
c641ef370d18
Fix signedness warnings
Myhailo Danylenko <isbear@ukrpost.net>
parents:
24
diff
changeset
|
66 |
set_target_properties(avatar PROPERTIES COMPILE_FLAGS "-Wall") |
13
6ed6279de87f
Fix linker library search path
Myhailo Danylenko <isbear@ukrpost.net>
parents:
12
diff
changeset
|
67 |
|
0 | 68 |
## Packaging information |
69 |
set(CPACK_PACKAGE_NAME libmcabber-avatar) |
|
24
7aa499342e2b
Use new interface to obtain available screen space
Myhailo Danylenko <isbear@ukrpost.net>
parents:
23
diff
changeset
|
70 |
set(CPACK_PACKAGE_VERSION ${PROJECT_VERSION}) |
0 | 71 |
set(CPACK_PACKAGE_VENDOR "IsBear") |
72 |
set(CPACK_PACKAGE_CONTACT "Myhailo Danylenko <isbear@ukrpost.net>") |
|
11
2f9ffa1c24c5
Change mcabber headers naming scheme
Myhailo Danylenko <isbear@ukrpost.net>
parents:
8
diff
changeset
|
73 |
set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "Mcabber module for PEP avatar events handling") |
0 | 74 |
set(CPACK_RESOURCE_FILE_LICENSE ${avatar_SOURCE_DIR}/COPYING) |
75 |
set(CPACK_SOURCE_GENERATOR TBZ2) |
|
76 |
set(CPACK_GENERATOR DEB CACHE TEXT "Binary package generator, eg DEB, RPM, TGZ, NSIS...") |
|
77 |
set(CPACK_DEBIAN_PACKAGE_SECTION libs) |
|
78 |
find_program(DPKG_EXECUTABLE dpkg) |
|
79 |
if(DPKG_EXECUTABLE) |
|
80 |
execute_process(COMMAND ${DPKG_EXECUTABLE} --print-architecture OUTPUT_VARIABLE CPACK_DEBIAN_PACKAGE_ARCHITECTURE OUTPUT_STRIP_TRAILING_WHITESPACE) |
|
81 |
else() |
|
82 |
set(CPACK_DEBIAN_PACKAGE_ARCHITECTURE i386 CACHE TEXT "Architecture of package") |
|
83 |
endif() |
|
84 |
set(CPACK_PACKAGE_FILE_NAME "${CPACK_PACKAGE_NAME}_${CPACK_PACKAGE_VERSION}_${CPACK_DEBIAN_PACKAGE_ARCHITECTURE}") |
|
85 |
set(CPACK_SOURCE_IGNORE_FILES "/\\\\..*;\\\\.swp;~$;/build/;\\\\.tar\\\\.;\\\\.deb;\\\\.so") |
|
86 |
include(CPack) |
|
87 |
||
17
b72f48fb6463
Fix documentation installation path
Myhailo Danylenko <isbear@ukrpost.net>
parents:
14
diff
changeset
|
88 |
## Installation |
b72f48fb6463
Fix documentation installation path
Myhailo Danylenko <isbear@ukrpost.net>
parents:
14
diff
changeset
|
89 |
install(TARGETS avatar DESTINATION lib/mcabber) |
b72f48fb6463
Fix documentation installation path
Myhailo Danylenko <isbear@ukrpost.net>
parents:
14
diff
changeset
|
90 |
install(FILES avatar.rc COPYING TODO README DESTINATION share/doc/${CPACK_PACKAGE_NAME}) |
b72f48fb6463
Fix documentation installation path
Myhailo Danylenko <isbear@ukrpost.net>
parents:
14
diff
changeset
|
91 |
install(DIRECTORY help DESTINATION share/mcabber) |
b72f48fb6463
Fix documentation installation path
Myhailo Danylenko <isbear@ukrpost.net>
parents:
14
diff
changeset
|
92 |
|
20
df9cedcdb3b2
Use pkg-config to find mcabber headers
Myhailo Danylenko <isbear@ukrpost.net>
parents:
17
diff
changeset
|
93 |
## The End ## vim: se ts=4 sw=4: ## |