author | Mikael Berthe <mikael@lilotux.net> |
Sat, 04 Aug 2012 16:00:25 +0200 | |
changeset 29 | 2464d2194e57 |
parent 19 | c7e7218be611 |
child 32 | bea3464128d0 |
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(marking C) |
|
11
f7c76b2c9900
Use new module struct with api version
Myhailo Danylenko <isbear@ukrpost.net>
parents:
10
diff
changeset
|
19 |
set(PROJECT_VERSION "0.0.1") |
0 | 20 |
|
6
2bc6bc009619
Fix linker library search path
Myhailo Danylenko <isbear@ukrpost.net>
parents:
5
diff
changeset
|
21 |
## User settable options |
2bc6bc009619
Fix linker library search path
Myhailo Danylenko <isbear@ukrpost.net>
parents:
5
diff
changeset
|
22 |
|
2bc6bc009619
Fix linker library search path
Myhailo Danylenko <isbear@ukrpost.net>
parents:
5
diff
changeset
|
23 |
## Check for build dependencies |
2bc6bc009619
Fix linker library search path
Myhailo Danylenko <isbear@ukrpost.net>
parents:
5
diff
changeset
|
24 |
find_package(PkgConfig REQUIRED) |
2bc6bc009619
Fix linker library search path
Myhailo Danylenko <isbear@ukrpost.net>
parents:
5
diff
changeset
|
25 |
pkg_check_modules(GLIB REQUIRED glib-2.0) |
9
97f340cae8e0
Use pkg-config to find mcabber headers
Myhailo Danylenko <isbear@ukrpost.net>
parents:
8
diff
changeset
|
26 |
pkg_check_modules(MCABBER REQUIRED mcabber) |
6
2bc6bc009619
Fix linker library search path
Myhailo Danylenko <isbear@ukrpost.net>
parents:
5
diff
changeset
|
27 |
link_directories(${GLIB_LIBRARY_DIRS} |
9
97f340cae8e0
Use pkg-config to find mcabber headers
Myhailo Danylenko <isbear@ukrpost.net>
parents:
8
diff
changeset
|
28 |
${MCABBER_LIBRARY_DIRS}) |
6
2bc6bc009619
Fix linker library search path
Myhailo Danylenko <isbear@ukrpost.net>
parents:
5
diff
changeset
|
29 |
|
0 | 30 |
## Target definitions |
31 |
add_library(marking MODULE marking.c) |
|
32 |
||
6
2bc6bc009619
Fix linker library search path
Myhailo Danylenko <isbear@ukrpost.net>
parents:
5
diff
changeset
|
33 |
## Compiler setup |
2bc6bc009619
Fix linker library search path
Myhailo Danylenko <isbear@ukrpost.net>
parents:
5
diff
changeset
|
34 |
include_directories(SYSTEM ${GLIB_INCLUDE_DIRS} |
9
97f340cae8e0
Use pkg-config to find mcabber headers
Myhailo Danylenko <isbear@ukrpost.net>
parents:
8
diff
changeset
|
35 |
${MCABBER_INCLUDE_DIRS}) |
6
2bc6bc009619
Fix linker library search path
Myhailo Danylenko <isbear@ukrpost.net>
parents:
5
diff
changeset
|
36 |
target_link_libraries(marking ${GLIB_LIBRARIES} |
9
97f340cae8e0
Use pkg-config to find mcabber headers
Myhailo Danylenko <isbear@ukrpost.net>
parents:
8
diff
changeset
|
37 |
${MCABBER_LIBRARIES}) |
6
2bc6bc009619
Fix linker library search path
Myhailo Danylenko <isbear@ukrpost.net>
parents:
5
diff
changeset
|
38 |
include_directories(${marking_SOURCE_DIR} |
2bc6bc009619
Fix linker library search path
Myhailo Danylenko <isbear@ukrpost.net>
parents:
5
diff
changeset
|
39 |
${marking_BINARY_DIR}) |
13
1fd61cc4e1ea
Enable compiler warnings
Myhailo Danylenko <isbear@ukrpost.net>
parents:
11
diff
changeset
|
40 |
set_target_properties(marking PROPERTIES COMPILE_FLAGS "-Wall") |
6
2bc6bc009619
Fix linker library search path
Myhailo Danylenko <isbear@ukrpost.net>
parents:
5
diff
changeset
|
41 |
|
0 | 42 |
## Packaging information |
11
f7c76b2c9900
Use new module struct with api version
Myhailo Danylenko <isbear@ukrpost.net>
parents:
10
diff
changeset
|
43 |
configure_file(config.h.in config.h) |
0 | 44 |
set(CPACK_PACKAGE_NAME libmcabber-marking) |
11
f7c76b2c9900
Use new module struct with api version
Myhailo Danylenko <isbear@ukrpost.net>
parents:
10
diff
changeset
|
45 |
set(CPACK_PACKAGE_VERSION ${PROJECT_VERSION}) |
0 | 46 |
set(CPACK_PACKAGE_VENDOR "IsBear") |
47 |
set(CPACK_PACKAGE_CONTACT "Myhailo Danylenko <isbear@ukrpost.net>") |
|
2
30b66610f86a
Change mcabber headers naming scheme
Myhailo Danylenko <isbear@ukrpost.net>
parents:
1
diff
changeset
|
48 |
set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "Mcabber module to do commands with multiple contacts") |
0 | 49 |
set(CPACK_RESOURCE_FILE_LICENSE ${marking_SOURCE_DIR}/COPYING) |
50 |
set(CPACK_SOURCE_GENERATOR TBZ2) |
|
51 |
set(CPACK_GENERATOR DEB CACHE TEXT "Binary package generator, eg DEB, RPM, TGZ, NSIS...") |
|
52 |
set(CPACK_DEBIAN_PACKAGE_SECTION libs) |
|
53 |
find_program(DPKG_EXECUTABLE dpkg) |
|
54 |
if(DPKG_EXECUTABLE) |
|
55 |
execute_process(COMMAND ${DPKG_EXECUTABLE} --print-architecture OUTPUT_VARIABLE CPACK_DEBIAN_PACKAGE_ARCHITECTURE OUTPUT_STRIP_TRAILING_WHITESPACE) |
|
56 |
else() |
|
57 |
set(CPACK_DEBIAN_PACKAGE_ARCHITECTURE i386 CACHE TEXT "Architecture of package") |
|
58 |
endif() |
|
59 |
set(CPACK_PACKAGE_FILE_NAME "${CPACK_PACKAGE_NAME}_${CPACK_PACKAGE_VERSION}_${CPACK_DEBIAN_PACKAGE_ARCHITECTURE}") |
|
60 |
set(CPACK_SOURCE_IGNORE_FILES "/\\\\..*;\\\\.swp;~$;/build/;\\\\.tar\\\\.;\\\\.deb;\\\\.so") |
|
61 |
include(CPack) |
|
62 |
||
19
c7e7218be611
Update versions and add AVV description
Myhailo Danylenko <isbear@ukrpost.net>
parents:
13
diff
changeset
|
63 |
configure_file(marking.avv.in marking.avv) |
c7e7218be611
Update versions and add AVV description
Myhailo Danylenko <isbear@ukrpost.net>
parents:
13
diff
changeset
|
64 |
|
8
5ae62686e59a
Fix documentation installation path
Myhailo Danylenko <isbear@ukrpost.net>
parents:
6
diff
changeset
|
65 |
## Installation |
5ae62686e59a
Fix documentation installation path
Myhailo Danylenko <isbear@ukrpost.net>
parents:
6
diff
changeset
|
66 |
install(TARGETS marking DESTINATION lib/mcabber) |
5ae62686e59a
Fix documentation installation path
Myhailo Danylenko <isbear@ukrpost.net>
parents:
6
diff
changeset
|
67 |
install(FILES marking.rc COPYING README TODO DESTINATION share/doc/${CPACK_PACKAGE_NAME}) |
5ae62686e59a
Fix documentation installation path
Myhailo Danylenko <isbear@ukrpost.net>
parents:
6
diff
changeset
|
68 |
install(DIRECTORY help DESTINATION share/mcabber) |
19
c7e7218be611
Update versions and add AVV description
Myhailo Danylenko <isbear@ukrpost.net>
parents:
13
diff
changeset
|
69 |
install(FILES ${PROJECT_BINARY_DIR}/marking.avv DESTINATION share/mcabber/avv/modules RENAME marking) |
8
5ae62686e59a
Fix documentation installation path
Myhailo Danylenko <isbear@ukrpost.net>
parents:
6
diff
changeset
|
70 |
|
0 | 71 |
## The End ## vim: se ts=4: ## |