author | Myhailo Danylenko <isbear@ukrpost.net> |
Wed, 20 Jan 2010 21:43:21 +0200 | |
changeset 12 | bc6d4169afdb |
parent 11 | fafc922963f5 |
child 13 | 88315b883803 |
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(cmd C) |
|
19 |
||
10
aaaa2b1a8de0
Fix linker library search path
Myhailo Danylenko <isbear@ukrpost.net>
parents:
9
diff
changeset
|
20 |
## User settable options |
aaaa2b1a8de0
Fix linker library search path
Myhailo Danylenko <isbear@ukrpost.net>
parents:
9
diff
changeset
|
21 |
set(MCABBER_INCLUDE_DIR "/usr/include" CACHE FILEPATH "Path to mcabber headers") |
aaaa2b1a8de0
Fix linker library search path
Myhailo Danylenko <isbear@ukrpost.net>
parents:
9
diff
changeset
|
22 |
|
aaaa2b1a8de0
Fix linker library search path
Myhailo Danylenko <isbear@ukrpost.net>
parents:
9
diff
changeset
|
23 |
## Check for build dependencies |
aaaa2b1a8de0
Fix linker library search path
Myhailo Danylenko <isbear@ukrpost.net>
parents:
9
diff
changeset
|
24 |
find_package(PkgConfig REQUIRED) |
aaaa2b1a8de0
Fix linker library search path
Myhailo Danylenko <isbear@ukrpost.net>
parents:
9
diff
changeset
|
25 |
pkg_check_modules(GLIB REQUIRED glib-2.0) |
aaaa2b1a8de0
Fix linker library search path
Myhailo Danylenko <isbear@ukrpost.net>
parents:
9
diff
changeset
|
26 |
pkg_check_modules(GMODULE REQUIRED gmodule-2.0) |
aaaa2b1a8de0
Fix linker library search path
Myhailo Danylenko <isbear@ukrpost.net>
parents:
9
diff
changeset
|
27 |
pkg_check_modules(LM REQUIRED loudmouth-1.0) |
11
fafc922963f5
Use xmpp_is_online if available
Myhailo Danylenko <isbear@ukrpost.net>
parents:
10
diff
changeset
|
28 |
find_program(GREP_EXECUTABLE grep DOC "Grep binary to find functions in headers") |
fafc922963f5
Use xmpp_is_online if available
Myhailo Danylenko <isbear@ukrpost.net>
parents:
10
diff
changeset
|
29 |
if(GREP_EXECUTABLE) |
fafc922963f5
Use xmpp_is_online if available
Myhailo Danylenko <isbear@ukrpost.net>
parents:
10
diff
changeset
|
30 |
execute_process(COMMAND ${GREP_EXECUTABLE} xmpp_is_online ${MCABBER_INCLUDE_DIR}/mcabber/xmpp.h OUTPUT_VARIABLE HAVE_XMPP_IS_ONLINE ERROR_QUIET) |
fafc922963f5
Use xmpp_is_online if available
Myhailo Danylenko <isbear@ukrpost.net>
parents:
10
diff
changeset
|
31 |
endif() |
10
aaaa2b1a8de0
Fix linker library search path
Myhailo Danylenko <isbear@ukrpost.net>
parents:
9
diff
changeset
|
32 |
link_directories(${GLIB_LIBRARY_DIRS} |
aaaa2b1a8de0
Fix linker library search path
Myhailo Danylenko <isbear@ukrpost.net>
parents:
9
diff
changeset
|
33 |
${GMODULE_LIBRARY_DIRS}) |
aaaa2b1a8de0
Fix linker library search path
Myhailo Danylenko <isbear@ukrpost.net>
parents:
9
diff
changeset
|
34 |
|
0 | 35 |
## Target definitions |
36 |
add_library(cmd MODULE cmd.c) |
|
37 |
||
10
aaaa2b1a8de0
Fix linker library search path
Myhailo Danylenko <isbear@ukrpost.net>
parents:
9
diff
changeset
|
38 |
## Compiler setup |
11
fafc922963f5
Use xmpp_is_online if available
Myhailo Danylenko <isbear@ukrpost.net>
parents:
10
diff
changeset
|
39 |
configure_file(config.h.in config.h) |
10
aaaa2b1a8de0
Fix linker library search path
Myhailo Danylenko <isbear@ukrpost.net>
parents:
9
diff
changeset
|
40 |
include_directories(SYSTEM ${GLIB_INCLUDE_DIRS} |
aaaa2b1a8de0
Fix linker library search path
Myhailo Danylenko <isbear@ukrpost.net>
parents:
9
diff
changeset
|
41 |
${GMODULE_INCLUDE_DIRS} |
aaaa2b1a8de0
Fix linker library search path
Myhailo Danylenko <isbear@ukrpost.net>
parents:
9
diff
changeset
|
42 |
${LM_INCLUDE_DIRS} |
aaaa2b1a8de0
Fix linker library search path
Myhailo Danylenko <isbear@ukrpost.net>
parents:
9
diff
changeset
|
43 |
${MCABBER_INCLUDE_DIR}) |
aaaa2b1a8de0
Fix linker library search path
Myhailo Danylenko <isbear@ukrpost.net>
parents:
9
diff
changeset
|
44 |
target_link_libraries(cmd ${GLIB_LIBRARIES} |
aaaa2b1a8de0
Fix linker library search path
Myhailo Danylenko <isbear@ukrpost.net>
parents:
9
diff
changeset
|
45 |
${GMODULE_LIBRARIES}) |
aaaa2b1a8de0
Fix linker library search path
Myhailo Danylenko <isbear@ukrpost.net>
parents:
9
diff
changeset
|
46 |
include_directories(${cmd_SOURCE_DIR} |
aaaa2b1a8de0
Fix linker library search path
Myhailo Danylenko <isbear@ukrpost.net>
parents:
9
diff
changeset
|
47 |
${cmd_BINARY_DIR}) |
aaaa2b1a8de0
Fix linker library search path
Myhailo Danylenko <isbear@ukrpost.net>
parents:
9
diff
changeset
|
48 |
|
0 | 49 |
## Packaging information |
50 |
set(CPACK_PACKAGE_NAME libmcabber-cmd) |
|
51 |
set(CPACK_PACKAGE_VERSION "0.0.1") |
|
52 |
set(CPACK_PACKAGE_VENDOR "IsBear") |
|
53 |
set(CPACK_PACKAGE_CONTACT "Myhailo Danylenko <isbear@ukrpost.net>") |
|
8
5771827a4976
Change mcabber headers naming convention
Myhailo Danylenko <isbear@ukrpost.net>
parents:
2
diff
changeset
|
54 |
set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "Mcabber module for sending shell commands output to others") |
0 | 55 |
set(CPACK_RESOURCE_FILE_LICENSE ${cmd_SOURCE_DIR}/COPYING) |
56 |
set(CPACK_SOURCE_GENERATOR TBZ2) |
|
57 |
set(CPACK_GENERATOR DEB CACHE TEXT "Binary package generator, eg DEB, RPM, TGZ, NSIS...") |
|
58 |
set(CPACK_DEBIAN_PACKAGE_SECTION libs) |
|
59 |
find_program(DPKG_EXECUTABLE dpkg) |
|
60 |
if(DPKG_EXECUTABLE) |
|
61 |
execute_process(COMMAND ${DPKG_EXECUTABLE} --print-architecture OUTPUT_VARIABLE CPACK_DEBIAN_PACKAGE_ARCHITECTURE OUTPUT_STRIP_TRAILING_WHITESPACE) |
|
62 |
else() |
|
63 |
set(CPACK_DEBIAN_PACKAGE_ARCHITECTURE i386 CACHE TEXT "Architecture of package") |
|
64 |
endif() |
|
65 |
set(CPACK_PACKAGE_FILE_NAME "${CPACK_PACKAGE_NAME}_${CPACK_PACKAGE_VERSION}_${CPACK_DEBIAN_PACKAGE_ARCHITECTURE}") |
|
66 |
set(CPACK_SOURCE_IGNORE_FILES "/\\\\..*;\\\\.swp;~$;/build/;\\\\.tar\\\\.;\\\\.deb;\\\\.so") |
|
67 |
include(CPack) |
|
68 |
||
12
bc6d4169afdb
Fix documentation installation path
Myhailo Danylenko <isbear@ukrpost.net>
parents:
11
diff
changeset
|
69 |
## Installation |
bc6d4169afdb
Fix documentation installation path
Myhailo Danylenko <isbear@ukrpost.net>
parents:
11
diff
changeset
|
70 |
install(TARGETS cmd DESTINATION lib/mcabber) |
bc6d4169afdb
Fix documentation installation path
Myhailo Danylenko <isbear@ukrpost.net>
parents:
11
diff
changeset
|
71 |
install(FILES cmd.rc COPYING README DESTINATION share/doc/${CPACK_PACKAGE_NAME}) |
bc6d4169afdb
Fix documentation installation path
Myhailo Danylenko <isbear@ukrpost.net>
parents:
11
diff
changeset
|
72 |
install(DIRECTORY help DESTINATION share/mcabber) |
bc6d4169afdb
Fix documentation installation path
Myhailo Danylenko <isbear@ukrpost.net>
parents:
11
diff
changeset
|
73 |
|
0 | 74 |
## The End ## vim: se ts=4: ## |