author | Myhailo Danylenko <isbear@ukrpost.net> |
Wed, 20 Jan 2010 21:43:23 +0200 | |
changeset 9 | 14cb2e74d8ed |
parent 7 | 6dc767773704 |
child 10 | ee45895bc62a |
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(env C) |
|
19 |
||
7
6dc767773704
Fix linker library search path
Myhailo Danylenko <isbear@ukrpost.net>
parents:
6
diff
changeset
|
20 |
## User settable options |
6dc767773704
Fix linker library search path
Myhailo Danylenko <isbear@ukrpost.net>
parents:
6
diff
changeset
|
21 |
set(MCABBER_INCLUDE_DIR "/usr/include" CACHE FILEPATH "Path to mcabber headers") |
6dc767773704
Fix linker library search path
Myhailo Danylenko <isbear@ukrpost.net>
parents:
6
diff
changeset
|
22 |
|
6dc767773704
Fix linker library search path
Myhailo Danylenko <isbear@ukrpost.net>
parents:
6
diff
changeset
|
23 |
## Check for build dependencies |
6dc767773704
Fix linker library search path
Myhailo Danylenko <isbear@ukrpost.net>
parents:
6
diff
changeset
|
24 |
find_package(PkgConfig REQUIRED) |
6dc767773704
Fix linker library search path
Myhailo Danylenko <isbear@ukrpost.net>
parents:
6
diff
changeset
|
25 |
pkg_check_modules(GLIB REQUIRED glib-2.0) |
6dc767773704
Fix linker library search path
Myhailo Danylenko <isbear@ukrpost.net>
parents:
6
diff
changeset
|
26 |
pkg_check_modules(GMODULE REQUIRED gmodule-2.0) |
6dc767773704
Fix linker library search path
Myhailo Danylenko <isbear@ukrpost.net>
parents:
6
diff
changeset
|
27 |
link_directories(${GLIB_LIBRARY_DIRS} |
6dc767773704
Fix linker library search path
Myhailo Danylenko <isbear@ukrpost.net>
parents:
6
diff
changeset
|
28 |
${GMODULE_LIBRARY_DIRS}) |
6dc767773704
Fix linker library search path
Myhailo Danylenko <isbear@ukrpost.net>
parents:
6
diff
changeset
|
29 |
|
0 | 30 |
## Target definitions |
31 |
add_library(env MODULE env.c) |
|
32 |
||
7
6dc767773704
Fix linker library search path
Myhailo Danylenko <isbear@ukrpost.net>
parents:
6
diff
changeset
|
33 |
## Compiler setup |
6dc767773704
Fix linker library search path
Myhailo Danylenko <isbear@ukrpost.net>
parents:
6
diff
changeset
|
34 |
include_directories(SYSTEM ${GLIB_INCLUDE_DIRS} |
6dc767773704
Fix linker library search path
Myhailo Danylenko <isbear@ukrpost.net>
parents:
6
diff
changeset
|
35 |
${GMODULE_INCLUDE_DIRS} |
6dc767773704
Fix linker library search path
Myhailo Danylenko <isbear@ukrpost.net>
parents:
6
diff
changeset
|
36 |
${MCABBER_INCLUDE_DIR}) |
6dc767773704
Fix linker library search path
Myhailo Danylenko <isbear@ukrpost.net>
parents:
6
diff
changeset
|
37 |
target_link_libraries(env ${GLIB_LIBRARIES} |
6dc767773704
Fix linker library search path
Myhailo Danylenko <isbear@ukrpost.net>
parents:
6
diff
changeset
|
38 |
${GMODULE_LIBRARIES}) |
6dc767773704
Fix linker library search path
Myhailo Danylenko <isbear@ukrpost.net>
parents:
6
diff
changeset
|
39 |
include_directories(${env_SOURCE_DIR} |
6dc767773704
Fix linker library search path
Myhailo Danylenko <isbear@ukrpost.net>
parents:
6
diff
changeset
|
40 |
${env_BINARY_DIR}) |
6dc767773704
Fix linker library search path
Myhailo Danylenko <isbear@ukrpost.net>
parents:
6
diff
changeset
|
41 |
|
0 | 42 |
## Packaging information |
43 |
set(CPACK_PACKAGE_NAME libmcabber-env) |
|
44 |
set(CPACK_PACKAGE_VERSION "0.0.1") |
|
45 |
set(CPACK_PACKAGE_VENDOR "IsBear") |
|
46 |
set(CPACK_PACKAGE_CONTACT "Myhailo Danylenko <isbear@ukrpost.net>") |
|
5
da2fdd072650
Change mcabber headers naming scheme
Myhailo Danylenko <isbear@ukrpost.net>
parents:
2
diff
changeset
|
47 |
set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "Debug module to access mcabber environment") |
0 | 48 |
set(CPACK_RESOURCE_FILE_LICENSE ${env_SOURCE_DIR}/COPYING) |
49 |
set(CPACK_SOURCE_GENERATOR TBZ2) |
|
50 |
set(CPACK_GENERATOR DEB CACHE TEXT "Binary package generator, eg DEB, RPM, TGZ, NSIS...") |
|
51 |
set(CPACK_DEBIAN_PACKAGE_SECTION libs) |
|
52 |
find_program(DPKG_EXECUTABLE dpkg) |
|
53 |
if(DPKG_EXECUTABLE) |
|
54 |
execute_process(COMMAND ${DPKG_EXECUTABLE} --print-architecture OUTPUT_VARIABLE CPACK_DEBIAN_PACKAGE_ARCHITECTURE OUTPUT_STRIP_TRAILING_WHITESPACE) |
|
55 |
else() |
|
56 |
set(CPACK_DEBIAN_PACKAGE_ARCHITECTURE i386 CACHE TEXT "Architecture of package") |
|
57 |
endif() |
|
58 |
set(CPACK_PACKAGE_FILE_NAME "${CPACK_PACKAGE_NAME}_${CPACK_PACKAGE_VERSION}_${CPACK_DEBIAN_PACKAGE_ARCHITECTURE}") |
|
59 |
set(CPACK_SOURCE_IGNORE_FILES "/\\\\..*;\\\\.swp;~$;/build/;\\\\.tar\\\\.;\\\\.deb;\\\\.so") |
|
60 |
include(CPack) |
|
61 |
||
9
14cb2e74d8ed
Fix documentation installation path
Myhailo Danylenko <isbear@ukrpost.net>
parents:
7
diff
changeset
|
62 |
## Installation |
14cb2e74d8ed
Fix documentation installation path
Myhailo Danylenko <isbear@ukrpost.net>
parents:
7
diff
changeset
|
63 |
install(TARGETS env DESTINATION lib/mcabber) |
14cb2e74d8ed
Fix documentation installation path
Myhailo Danylenko <isbear@ukrpost.net>
parents:
7
diff
changeset
|
64 |
install(FILES env.rc COPYING README TODO DESTINATION share/doc/${CPACK_PACKAGE_NAME}) |
14cb2e74d8ed
Fix documentation installation path
Myhailo Danylenko <isbear@ukrpost.net>
parents:
7
diff
changeset
|
65 |
install(DIRECTORY help DESTINATION share/mcabber) |
14cb2e74d8ed
Fix documentation installation path
Myhailo Danylenko <isbear@ukrpost.net>
parents:
7
diff
changeset
|
66 |
|
0 | 67 |
## The End ## vim: se ts=4: ## |