author | Myhailo Danylenko <isbear@ukrpost.net> |
Mon, 20 Aug 2012 18:22:40 +0300 | |
changeset 20 | f5318a5fd95f |
parent 19 | ff5884d8bbf5 |
permissions | -rw-r--r-- |
19 | 1 |
## Copyright 2009-2012 Myhailo Danylenko |
2 |
# This file is part of mcabber-templatecmd |
|
0 | 3 |
# |
19 | 4 |
# mcabber-templatecmd is a free software: you can redistribute it |
5 |
# and/or modify it under the terms of the GNU General Public |
|
6 |
# License as published by the Free Software Foundation, either version |
|
7 |
# 2 of the 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(templatecmd C) |
|
6
2cc481d6b686
Use new module struct with api version
Myhailo Danylenko <isbear@ukrpost.net>
parents:
5
diff
changeset
|
19 |
set(PROJECT_VERSION "0.0.1") |
0 | 20 |
|
2
7eb2b2d83cfc
Fix linker library search path
Myhailo Danylenko <isbear@ukrpost.net>
parents:
1
diff
changeset
|
21 |
## User settable options |
7eb2b2d83cfc
Fix linker library search path
Myhailo Danylenko <isbear@ukrpost.net>
parents:
1
diff
changeset
|
22 |
|
7eb2b2d83cfc
Fix linker library search path
Myhailo Danylenko <isbear@ukrpost.net>
parents:
1
diff
changeset
|
23 |
## Check for build dependencies |
7eb2b2d83cfc
Fix linker library search path
Myhailo Danylenko <isbear@ukrpost.net>
parents:
1
diff
changeset
|
24 |
find_package(PkgConfig REQUIRED) |
7eb2b2d83cfc
Fix linker library search path
Myhailo Danylenko <isbear@ukrpost.net>
parents:
1
diff
changeset
|
25 |
pkg_check_modules(GLIB REQUIRED glib-2.0) |
4
b4b586665a8f
Use pkg-config to find mcabber headers
Myhailo Danylenko <isbear@ukrpost.net>
parents:
3
diff
changeset
|
26 |
pkg_check_modules(MCABBER REQUIRED mcabber) |
2
7eb2b2d83cfc
Fix linker library search path
Myhailo Danylenko <isbear@ukrpost.net>
parents:
1
diff
changeset
|
27 |
link_directories(${GLIB_LIBRARY_DIRS} |
4
b4b586665a8f
Use pkg-config to find mcabber headers
Myhailo Danylenko <isbear@ukrpost.net>
parents:
3
diff
changeset
|
28 |
${MCABBER_LIBRARY_DIRS}) |
2
7eb2b2d83cfc
Fix linker library search path
Myhailo Danylenko <isbear@ukrpost.net>
parents:
1
diff
changeset
|
29 |
|
0 | 30 |
## Target definitions |
31 |
add_library(templatecmd MODULE templatecmd.c) |
|
32 |
||
2
7eb2b2d83cfc
Fix linker library search path
Myhailo Danylenko <isbear@ukrpost.net>
parents:
1
diff
changeset
|
33 |
## Compiler setup |
6
2cc481d6b686
Use new module struct with api version
Myhailo Danylenko <isbear@ukrpost.net>
parents:
5
diff
changeset
|
34 |
configure_file(config.h.in config.h) |
2
7eb2b2d83cfc
Fix linker library search path
Myhailo Danylenko <isbear@ukrpost.net>
parents:
1
diff
changeset
|
35 |
include_directories(SYSTEM ${GLIB_INCLUDE_DIRS} |
4
b4b586665a8f
Use pkg-config to find mcabber headers
Myhailo Danylenko <isbear@ukrpost.net>
parents:
3
diff
changeset
|
36 |
${MCABBER_INCLUDE_DIRS}) |
2
7eb2b2d83cfc
Fix linker library search path
Myhailo Danylenko <isbear@ukrpost.net>
parents:
1
diff
changeset
|
37 |
target_link_libraries(templatecmd ${GLIB_LIBRARIES} |
4
b4b586665a8f
Use pkg-config to find mcabber headers
Myhailo Danylenko <isbear@ukrpost.net>
parents:
3
diff
changeset
|
38 |
${MCABBER_LIBRARIES}) |
2
7eb2b2d83cfc
Fix linker library search path
Myhailo Danylenko <isbear@ukrpost.net>
parents:
1
diff
changeset
|
39 |
include_directories(${templatecmd_SOURCE_DIR} |
7eb2b2d83cfc
Fix linker library search path
Myhailo Danylenko <isbear@ukrpost.net>
parents:
1
diff
changeset
|
40 |
${templatecmd_BINARY_DIR}) |
8
56c82958c730
Enable compiler warnings
Myhailo Danylenko <isbear@ukrpost.net>
parents:
6
diff
changeset
|
41 |
set_target_properties(templatecmd PROPERTIES COMPILE_FLAGS "-Wall") |
2
7eb2b2d83cfc
Fix linker library search path
Myhailo Danylenko <isbear@ukrpost.net>
parents:
1
diff
changeset
|
42 |
|
0 | 43 |
## Packaging information |
44 |
set(CPACK_PACKAGE_NAME libmcabber-templatecmd) |
|
6
2cc481d6b686
Use new module struct with api version
Myhailo Danylenko <isbear@ukrpost.net>
parents:
5
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>") |
|
48 |
set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "Temlate commands for mcabber") |
|
49 |
set(CPACK_RESOURCE_FILE_LICENSE ${templatecmd_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 |
||
14
5d8f38cc86ac
Update versions, add AVV description
Myhailo Danylenko <isbear@ukrpost.net>
parents:
8
diff
changeset
|
63 |
configure_file(templatecmd.avv.in templatecmd.avv) |
5d8f38cc86ac
Update versions, add AVV description
Myhailo Danylenko <isbear@ukrpost.net>
parents:
8
diff
changeset
|
64 |
|
3
707809a378e0
Fix documentation installation path
Myhailo Danylenko <isbear@ukrpost.net>
parents:
2
diff
changeset
|
65 |
## Installation |
707809a378e0
Fix documentation installation path
Myhailo Danylenko <isbear@ukrpost.net>
parents:
2
diff
changeset
|
66 |
install(TARGETS templatecmd DESTINATION lib/mcabber) |
19 | 67 |
install(FILES docs/templatecmd.rc TODO docs/readme.mdwn COPYING DESTINATION share/doc/${CPACK_PACKAGE_NAME}) |
3
707809a378e0
Fix documentation installation path
Myhailo Danylenko <isbear@ukrpost.net>
parents:
2
diff
changeset
|
68 |
install(DIRECTORY help DESTINATION share/mcabber) |
14
5d8f38cc86ac
Update versions, add AVV description
Myhailo Danylenko <isbear@ukrpost.net>
parents:
8
diff
changeset
|
69 |
install(FILES ${PROJECT_BINARY_DIR}/templatecmd.avv DESTINATION share/mcabber/avv/modules RENAME templatecmd) |
3
707809a378e0
Fix documentation installation path
Myhailo Danylenko <isbear@ukrpost.net>
parents:
2
diff
changeset
|
70 |
|
0 | 71 |
## The End ## vim: se ts=4: ## |