author | Myhailo Danylenko <isbear@ukrpost.net> |
Thu, 21 May 2009 00:13:26 +0300 | |
changeset 72 | d049c92d0809 |
parent 30 | 2cf24aced294 |
child 73 | b3ebfb8eb798 |
permissions | -rw-r--r-- |
72 | 1 |
|
2 |
## Copyright 2009 Myhailo Danylenko |
|
3 |
# This file is part of mcabber-lua. |
|
4 |
# |
|
5 |
# mcabber-lua is free software: you can redistribute it and/or modify |
|
6 |
# it under the terms of the GNU General Public License as published by |
|
7 |
# the Free Software Foundation, either version 2 of the License, or |
|
8 |
# (at your option) any later version. |
|
9 |
# |
|
10 |
# This program is distributed in the hope that it will be useful, |
|
11 |
# but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
12 |
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
13 |
# GNU General Public License for more details. |
|
14 |
# |
|
15 |
# You should have received a copy of the GNU General Public License |
|
16 |
# along with this program. If not, see <http://www.gnu.org/licenses/>. |
|
0 | 17 |
|
18 |
cmake_minimum_required(VERSION 2.6) |
|
19 |
project(mcabber-lua C) |
|
20 |
||
21 |
## User options |
|
22 |
option(DEBUG "Enable debugging output" ON) |
|
3
a5f864d4207f
Fixes for build system
Myhailo Danylenko <isbear@ukrpost.net>
parents:
1
diff
changeset
|
23 |
option(LLM_LOG_HANDLER "Enable registration of log messages handler for lua-loudmouth library's messages" ON) |
1 | 24 |
set(MCABBER_INCLUDE_DIR "/home/isbear/src/mcabber/hglm/mcabber/src" CACHE FILEPATH "Path to mcabber headers") |
30
2cf24aced294
Definitions moved to cmake options
Myhailo Danylenko <isbear@ukrpost.net>
parents:
6
diff
changeset
|
25 |
set(ML_SOURCE_PRIORITY G_PRIORITY_HIGH_IDLE CACHE STRING "Glib event source priority for timeout and bgread") |
2cf24aced294
Definitions moved to cmake options
Myhailo Danylenko <isbear@ukrpost.net>
parents:
6
diff
changeset
|
26 |
set(ML_BGREAD_BUFFER 4096 CACHE STRING "Background pipe reading buffer size") |
0 | 27 |
|
28 |
## Define targets |
|
29 |
add_library(mcabber-lua MODULE main.c util.c) |
|
30 |
get_target_property(mcabber-lua_SOURCES mcabber-lua SOURCES) |
|
31 |
||
32 |
## Packaging information |
|
33 |
set(CPACK_PACKAGE_VERSION_MAJOR 0) |
|
34 |
set(CPACK_PACKAGE_VERSION_MINOR 0) |
|
35 |
set(CPACK_PACKAGE_VERSION_PATCH 0) |
|
36 |
set(CPACK_PACKAGE_VENDOR "IsBear") |
|
37 |
set(CPACK_PACKAGE_CONTACT "Myhailo Danylenko <isbear@ukrpost.net>") |
|
38 |
set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "Mcabber lua module") |
|
39 |
set(CPACK_PACKAGE_DESCRIPTION_FILE ${mcabber-lua_SOURCE_DIR}/README) |
|
40 |
set(CPACK_RESOURCE_FILE_LICENSE ${mcabber-lua_SOURCE_DIR}/COPYING) |
|
41 |
set(CPACK_RESOURCE_FILE_README ${mcabber-lua_SOURCE_DIR}/README) |
|
42 |
set(CPACK_RESOURCE_FILE_WELCOME ${mcabber-lua_SOURCE_DIR}/README) |
|
43 |
set(CPACK_DEBIAN_PACKAGE_SECTION libs) |
|
44 |
set(CPACK_SOURCE_GENERATOR TBZ2) |
|
45 |
set(CPACK_GENERATOR DEB) |
|
46 |
# FIXME: Detect architecture. How? Though, it anyway produces nonconformant deb names... |
|
47 |
set(CPACK_SYSTEM_NAME i386) |
|
48 |
# XXX: Set package name directly to get rid of -Sources? |
|
49 |
set(CPACK_SOURCE_IGNORE_FILES "/\\\\..*;\\\\.swp;~$;/build/;\\\\.tar\\\\.;\\\\.deb;\\\\.so") |
|
50 |
include(CPack) |
|
51 |
||
52 |
## Gather information about system |
|
53 |
find_package(Lua51 REQUIRED) |
|
54 |
find_package(PkgConfig REQUIRED) |
|
55 |
pkg_check_modules(GLIB REQUIRED glib-2.0) |
|
56 |
pkg_check_modules(GMODULE REQUIRED gmodule-2.0) |
|
3
a5f864d4207f
Fixes for build system
Myhailo Danylenko <isbear@ukrpost.net>
parents:
1
diff
changeset
|
57 |
# XXX: we need only headers |
1 | 58 |
pkg_check_modules(LM REQUIRED loudmouth-1.0) |
59 |
find_package(Perl) |
|
0 | 60 |
|
61 |
## Set up compiler |
|
3
a5f864d4207f
Fixes for build system
Myhailo Danylenko <isbear@ukrpost.net>
parents:
1
diff
changeset
|
62 |
configure_file(config.h.in config.h ESCAPE_QUOTES) |
1 | 63 |
include_directories(SYSTEM ${LUA_INCLUDE_DIR} ${GLIB_INCLUDE_DIRS} ${GMODULE_INCLUDE_DIRS} ${LM_INCLUDE_DIRS}) |
0 | 64 |
target_link_libraries(mcabber-lua ${LUA_LIBRARIES} ${GLIB_LIBRARIES} ${GMODULE_LIBRARIES}) |
65 |
include_directories(${mcabber-lua_SOURCE_DIR} ${mcabber-lua_BINARY_DIR} ${MCABBER_INCLUDE_DIR}) |
|
66 |
||
67 |
## Extra targets |
|
1 | 68 |
if(PERL_FOUND) |
69 |
add_custom_command(OUTPUT ${mcabber-lua_BINARY_DIR}/mcabber-lua.html COMMAND ${PERL_EXECUTABLE} ${mcabber-lua_SOURCE_DIR}/docgen.pl ${mcabber-lua_SOURCES} > ${mcabber-lua_BINARY_DIR}/mcabber-lua.html DEPENDS ${mcabber-lua_SOURCE_DIR}/docgen.pl ${mcabber-lua_SOURCES} WORKING_DIRECTORY ${mcabber-lua_SOURCE_DIR}) |
|
70 |
add_custom_target(doc ALL DEPENDS ${mcabber-lua_BINARY_DIR}/mcabber-lua.html) |
|
71 |
endif() |
|
0 | 72 |
|
73 |
## Set up installer |
|
74 |
install(TARGETS mcabber-lua DESTINATION lib/mcabber) |
|
1 | 75 |
if(PERL_FOUND) |
76 |
install(FILES ${mcabber-lua_BINARY_DIR}/mcabber-lua.html DESTINATION share/doc/${CPACK_PACKAGE_NAME}) |
|
77 |
endif() |
|
5
cba039bd6f13
Included sample configuration into package
Myhailo Danylenko <isbear@ukrpost.net>
parents:
3
diff
changeset
|
78 |
install(DIRECTORY examples DESTINATION share/doc/${CPACK_PACKAGE_NAME}) |
0 | 79 |
install(FILES README DESTINATION share/doc/${CPACK_PACKAGE_NAME}) |
80 |
install(FILES TODO DESTINATION share/doc/${CPACK_PACKAGE_NAME}) |
|
81 |
install(FILES COPYING DESTINATION share/doc/${CPACK_PACKAGE_NAME}) |
|
82 |
||
83 |
## The End ## vim: se ts=4: ## |