author | Myhailo Danylenko <isbear@ukrpost.net> |
Sat, 01 Aug 2009 23:05:11 +0300 | |
changeset 79 | 05328c643696 |
parent 78 | 1253cacc0f21 |
child 83 | 794e54ea1022 |
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) |
|
78 | 23 |
option(LLM_CONNECTION_ENABLE "Enable exposing of mcabber loudmouth connection to lua" ON) |
3
a5f864d4207f
Fixes for build system
Myhailo Danylenko <isbear@ukrpost.net>
parents:
1
diff
changeset
|
24 |
option(LLM_LOG_HANDLER "Enable registration of log messages handler for lua-loudmouth library's messages" ON) |
79
05328c643696
Mcabber-lm includes moved into a project tree
Myhailo Danylenko <isbear@ukrpost.net>
parents:
78
diff
changeset
|
25 |
set(MCABBER_INCLUDE_DIR "${mcabber-lua_SOURCE_DIR}/include" CACHE FILEPATH "Path to mcabber headers") |
30
2cf24aced294
Definitions moved to cmake options
Myhailo Danylenko <isbear@ukrpost.net>
parents:
6
diff
changeset
|
26 |
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
|
27 |
set(ML_BGREAD_BUFFER 4096 CACHE STRING "Background pipe reading buffer size") |
0 | 28 |
|
29 |
## Define targets |
|
30 |
add_library(mcabber-lua MODULE main.c util.c) |
|
31 |
get_target_property(mcabber-lua_SOURCES mcabber-lua SOURCES) |
|
32 |
||
33 |
## Packaging information |
|
78 | 34 |
set(CPACK_PACKAGE_NAME mcabber-lua) |
35 |
set(CPACK_PACKAGE_VERSION "0.0.0") |
|
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) |
|
78 | 43 |
set(CPACK_SOURCE_GENERATOR TBZ2) |
44 |
set(CPACK_GENERATOR DEB CACHE STRING "Binary package generator, eg DEB, RPM, TGZ, NSIS...") |
|
45 |
# XXX |
|
46 |
set(CPACK_DEBIAN_PACKAGE_DEPENDS "libc6, liblua5.1-0, libglib2.0-0") |
|
47 |
set(CPACK_DEBIAN_PACKAGE_RECOMMENDS "mcabber-lm | mcabber") |
|
48 |
set(CPACK_DEBIAN_PACKAGE_SUGGESTS "liblua5.1-posix1, liblua5.1-base64-0, liblua5.1-sha1-0") |
|
0 | 49 |
set(CPACK_DEBIAN_PACKAGE_SECTION libs) |
78 | 50 |
find_program(DPKG_EXECUTABLE dpkg) |
51 |
if(DPKG_EXECUTABLE) |
|
52 |
execute_process(COMMAND ${DPKG_EXECUTABLE} --print-architecture OUTPUT_VARIABLE CPACK_DEBIAN_PACKAGE_ARCHITECTURE OUTPUT_STRIP_TRAILING_WHITESPACE) |
|
53 |
else() |
|
54 |
set(CPACK_DEBIAN_PACKAGE_ARCHITECTURE i386 CACHE STRING "Architecture of package") |
|
55 |
endif() |
|
56 |
set(CPACK_PACKAGE_FILE_NAME "${CPACK_PACKAGE_NAME}_${CPACK_PACKAGE_VERSION}_${CPACK_DEBIAN_PACKAGE_ARCHITECTURE}") |
|
0 | 57 |
# XXX: Set package name directly to get rid of -Sources? |
58 |
set(CPACK_SOURCE_IGNORE_FILES "/\\\\..*;\\\\.swp;~$;/build/;\\\\.tar\\\\.;\\\\.deb;\\\\.so") |
|
59 |
include(CPack) |
|
60 |
||
61 |
## Gather information about system |
|
62 |
find_package(Lua51 REQUIRED) |
|
63 |
find_package(PkgConfig REQUIRED) |
|
64 |
pkg_check_modules(GLIB REQUIRED glib-2.0) |
|
65 |
pkg_check_modules(GMODULE REQUIRED gmodule-2.0) |
|
3
a5f864d4207f
Fixes for build system
Myhailo Danylenko <isbear@ukrpost.net>
parents:
1
diff
changeset
|
66 |
# XXX: we need only headers |
78 | 67 |
if(LLM_CONNECTION_ENABLE) |
68 |
pkg_check_modules(LM REQUIRED loudmouth-1.0) |
|
69 |
endif() |
|
1 | 70 |
find_package(Perl) |
0 | 71 |
|
72 |
## Set up compiler |
|
3
a5f864d4207f
Fixes for build system
Myhailo Danylenko <isbear@ukrpost.net>
parents:
1
diff
changeset
|
73 |
configure_file(config.h.in config.h ESCAPE_QUOTES) |
1 | 74 |
include_directories(SYSTEM ${LUA_INCLUDE_DIR} ${GLIB_INCLUDE_DIRS} ${GMODULE_INCLUDE_DIRS} ${LM_INCLUDE_DIRS}) |
0 | 75 |
target_link_libraries(mcabber-lua ${LUA_LIBRARIES} ${GLIB_LIBRARIES} ${GMODULE_LIBRARIES}) |
76 |
include_directories(${mcabber-lua_SOURCE_DIR} ${mcabber-lua_BINARY_DIR} ${MCABBER_INCLUDE_DIR}) |
|
77 |
||
78 |
## Extra targets |
|
1 | 79 |
if(PERL_FOUND) |
80 |
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}) |
|
81 |
add_custom_target(doc ALL DEPENDS ${mcabber-lua_BINARY_DIR}/mcabber-lua.html) |
|
82 |
endif() |
|
0 | 83 |
|
84 |
## Set up installer |
|
85 |
install(TARGETS mcabber-lua DESTINATION lib/mcabber) |
|
1 | 86 |
if(PERL_FOUND) |
87 |
install(FILES ${mcabber-lua_BINARY_DIR}/mcabber-lua.html DESTINATION share/doc/${CPACK_PACKAGE_NAME}) |
|
88 |
endif() |
|
79
05328c643696
Mcabber-lm includes moved into a project tree
Myhailo Danylenko <isbear@ukrpost.net>
parents:
78
diff
changeset
|
89 |
install(DIRECTORY examples DESTINATION share/doc/${CPACK_PACKAGE_NAME} PATTERN "*~" EXCLUDE) |
0 | 90 |
install(FILES README DESTINATION share/doc/${CPACK_PACKAGE_NAME}) |
91 |
install(FILES TODO DESTINATION share/doc/${CPACK_PACKAGE_NAME}) |
|
92 |
install(FILES COPYING DESTINATION share/doc/${CPACK_PACKAGE_NAME}) |
|
93 |
||
94 |
## The End ## vim: se ts=4: ## |