author | Myhailo Danylenko <isbear@ukrpost.net> |
Sun, 20 May 2012 22:15:51 +0300 | |
changeset 29 | 23fa36d480fb |
parent 26 | 1d5521131630 |
child 31 | e404cd1c7077 |
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(pep C) |
|
29
23fa36d480fb
Merge pep modules & use events
Myhailo Danylenko <isbear@ukrpost.net>
parents:
26
diff
changeset
|
19 |
set(PROJECT_VERSION "0.0.3") |
0 | 20 |
|
12
7d4c5337267c
Fix linker library search path
Myhailo Danylenko <isbear@ukrpost.net>
parents:
11
diff
changeset
|
21 |
## User settable options |
7d4c5337267c
Fix linker library search path
Myhailo Danylenko <isbear@ukrpost.net>
parents:
11
diff
changeset
|
22 |
|
7d4c5337267c
Fix linker library search path
Myhailo Danylenko <isbear@ukrpost.net>
parents:
11
diff
changeset
|
23 |
## Check for build dependencies |
7d4c5337267c
Fix linker library search path
Myhailo Danylenko <isbear@ukrpost.net>
parents:
11
diff
changeset
|
24 |
find_package(PkgConfig REQUIRED) |
7d4c5337267c
Fix linker library search path
Myhailo Danylenko <isbear@ukrpost.net>
parents:
11
diff
changeset
|
25 |
pkg_check_modules(GLIB REQUIRED glib-2.0) |
7d4c5337267c
Fix linker library search path
Myhailo Danylenko <isbear@ukrpost.net>
parents:
11
diff
changeset
|
26 |
pkg_check_modules(LM REQUIRED loudmouth-1.0) |
17
4a7cf0f5e85c
Use pkg-config to find mcabber headers
Myhailo Danylenko <isbear@ukrpost.net>
parents:
15
diff
changeset
|
27 |
pkg_check_modules(MCABBER REQUIRED mcabber) |
29
23fa36d480fb
Merge pep modules & use events
Myhailo Danylenko <isbear@ukrpost.net>
parents:
26
diff
changeset
|
28 |
include(CheckSymbolExists) |
23fa36d480fb
Merge pep modules & use events
Myhailo Danylenko <isbear@ukrpost.net>
parents:
26
diff
changeset
|
29 |
set(CMAKE_REQUIRED_INCLUDES ${LM_INCLUDE_DIRS}) |
23fa36d480fb
Merge pep modules & use events
Myhailo Danylenko <isbear@ukrpost.net>
parents:
26
diff
changeset
|
30 |
set(CMAKE_REQUIRED_LIBRARIES ${LM_LIBRARIES}) |
23fa36d480fb
Merge pep modules & use events
Myhailo Danylenko <isbear@ukrpost.net>
parents:
26
diff
changeset
|
31 |
set(CMAKE_REQUIRED_FLAGS ${LM_LDFLAGS} ${LM_CFLAGS}) |
23fa36d480fb
Merge pep modules & use events
Myhailo Danylenko <isbear@ukrpost.net>
parents:
26
diff
changeset
|
32 |
check_symbol_exists(lm_connection_unregister_reply_handler loudmouth/loudmouth.h HAVE_LM_CONNECTION_UNREGISTER_REPLY_HANDLER) |
12
7d4c5337267c
Fix linker library search path
Myhailo Danylenko <isbear@ukrpost.net>
parents:
11
diff
changeset
|
33 |
link_directories(${GLIB_LIBRARY_DIRS} |
17
4a7cf0f5e85c
Use pkg-config to find mcabber headers
Myhailo Danylenko <isbear@ukrpost.net>
parents:
15
diff
changeset
|
34 |
${LM_LIBRARY_DIRS} |
4a7cf0f5e85c
Use pkg-config to find mcabber headers
Myhailo Danylenko <isbear@ukrpost.net>
parents:
15
diff
changeset
|
35 |
${MCABBER_LIBRARY_DIRS}) |
12
7d4c5337267c
Fix linker library search path
Myhailo Danylenko <isbear@ukrpost.net>
parents:
11
diff
changeset
|
36 |
|
0 | 37 |
## Target definitions |
29
23fa36d480fb
Merge pep modules & use events
Myhailo Danylenko <isbear@ukrpost.net>
parents:
26
diff
changeset
|
38 |
add_library(pep MODULE pep.c pep.h) |
23fa36d480fb
Merge pep modules & use events
Myhailo Danylenko <isbear@ukrpost.net>
parents:
26
diff
changeset
|
39 |
add_library(mood MODULE mood.c mood.h) |
23fa36d480fb
Merge pep modules & use events
Myhailo Danylenko <isbear@ukrpost.net>
parents:
26
diff
changeset
|
40 |
add_library(pep_mood MODULE pep_mood.c mood.h pep.h) |
23fa36d480fb
Merge pep modules & use events
Myhailo Danylenko <isbear@ukrpost.net>
parents:
26
diff
changeset
|
41 |
add_library(tune MODULE tune.c tune.h) |
23fa36d480fb
Merge pep modules & use events
Myhailo Danylenko <isbear@ukrpost.net>
parents:
26
diff
changeset
|
42 |
add_library(pep_tune MODULE pep_tune.c tune.h pep.h) |
23fa36d480fb
Merge pep modules & use events
Myhailo Danylenko <isbear@ukrpost.net>
parents:
26
diff
changeset
|
43 |
add_library(geoloc MODULE geoloc.c geoloc.h) |
23fa36d480fb
Merge pep modules & use events
Myhailo Danylenko <isbear@ukrpost.net>
parents:
26
diff
changeset
|
44 |
add_library(pep_geoloc MODULE pep_geoloc.c geoloc.h pep.h) |
23fa36d480fb
Merge pep modules & use events
Myhailo Danylenko <isbear@ukrpost.net>
parents:
26
diff
changeset
|
45 |
add_library(activity MODULE activity.c activity.h) |
23fa36d480fb
Merge pep modules & use events
Myhailo Danylenko <isbear@ukrpost.net>
parents:
26
diff
changeset
|
46 |
add_library(pep_activity MODULE pep_activity.c activity.h pep.h) |
0 | 47 |
|
12
7d4c5337267c
Fix linker library search path
Myhailo Danylenko <isbear@ukrpost.net>
parents:
11
diff
changeset
|
48 |
## Compiler setup |
29
23fa36d480fb
Merge pep modules & use events
Myhailo Danylenko <isbear@ukrpost.net>
parents:
26
diff
changeset
|
49 |
if(DEBUG) |
23fa36d480fb
Merge pep modules & use events
Myhailo Danylenko <isbear@ukrpost.net>
parents:
26
diff
changeset
|
50 |
set(DEBUG_COMPILE_FLAGS "-g") |
23fa36d480fb
Merge pep modules & use events
Myhailo Danylenko <isbear@ukrpost.net>
parents:
26
diff
changeset
|
51 |
endif() |
19
9ce7690c4dab
Update module struct to use api
Myhailo Danylenko <isbear@ukrpost.net>
parents:
18
diff
changeset
|
52 |
configure_file(config.h.in config.h) |
12
7d4c5337267c
Fix linker library search path
Myhailo Danylenko <isbear@ukrpost.net>
parents:
11
diff
changeset
|
53 |
include_directories(SYSTEM ${GLIB_INCLUDE_DIRS} |
7d4c5337267c
Fix linker library search path
Myhailo Danylenko <isbear@ukrpost.net>
parents:
11
diff
changeset
|
54 |
${LM_INCLUDE_DIRS} |
17
4a7cf0f5e85c
Use pkg-config to find mcabber headers
Myhailo Danylenko <isbear@ukrpost.net>
parents:
15
diff
changeset
|
55 |
${MCABBER_INCLUDE_DIRS}) |
29
23fa36d480fb
Merge pep modules & use events
Myhailo Danylenko <isbear@ukrpost.net>
parents:
26
diff
changeset
|
56 |
target_link_libraries(pep ${GLIB_LIBRARIES} ${LM_LIBRARIES} ${MCABBER_LIBRARIES}) |
23fa36d480fb
Merge pep modules & use events
Myhailo Danylenko <isbear@ukrpost.net>
parents:
26
diff
changeset
|
57 |
target_link_libraries(mood ${GLIB_LIBRARIES} ${MCABBER_LIBRARIES}) |
23fa36d480fb
Merge pep modules & use events
Myhailo Danylenko <isbear@ukrpost.net>
parents:
26
diff
changeset
|
58 |
target_link_libraries(pep_mood ${GLIB_LIBRARIES} ${LM_LIBRARIES} ${MCABBER_LIBRARIES}) |
23fa36d480fb
Merge pep modules & use events
Myhailo Danylenko <isbear@ukrpost.net>
parents:
26
diff
changeset
|
59 |
target_link_libraries(tune ${GLIB_LIBRARIES} ${MCABBER_LIBRARIES}) |
23fa36d480fb
Merge pep modules & use events
Myhailo Danylenko <isbear@ukrpost.net>
parents:
26
diff
changeset
|
60 |
target_link_libraries(pep_tune ${GLIB_LIBRARIES} ${LM_LIBRARIES} ${MCABBER_LIBRARIES}) |
23fa36d480fb
Merge pep modules & use events
Myhailo Danylenko <isbear@ukrpost.net>
parents:
26
diff
changeset
|
61 |
target_link_libraries(geoloc ${GLIB_LIBRARIES} ${MCABBER_LIBRARIES}) |
23fa36d480fb
Merge pep modules & use events
Myhailo Danylenko <isbear@ukrpost.net>
parents:
26
diff
changeset
|
62 |
target_link_libraries(pep_geoloc ${GLIB_LIBRARIES} ${LM_LIBRARIES} ${MCABBER_LIBRARIES}) |
23fa36d480fb
Merge pep modules & use events
Myhailo Danylenko <isbear@ukrpost.net>
parents:
26
diff
changeset
|
63 |
target_link_libraries(activity ${GLIB_LIBRARIES} ${MCABBER_LIBRARIES}) |
23fa36d480fb
Merge pep modules & use events
Myhailo Danylenko <isbear@ukrpost.net>
parents:
26
diff
changeset
|
64 |
target_link_libraries(pep_activity ${GLIB_LIBRARIES} ${LM_LIBRARIES} ${MCABBER_LIBRARIES}) |
12
7d4c5337267c
Fix linker library search path
Myhailo Danylenko <isbear@ukrpost.net>
parents:
11
diff
changeset
|
65 |
include_directories(${pep_SOURCE_DIR} |
7d4c5337267c
Fix linker library search path
Myhailo Danylenko <isbear@ukrpost.net>
parents:
11
diff
changeset
|
66 |
${pep_BINARY_DIR}) |
29
23fa36d480fb
Merge pep modules & use events
Myhailo Danylenko <isbear@ukrpost.net>
parents:
26
diff
changeset
|
67 |
set_target_properties(pep PROPERTIES COMPILE_FLAGS "-Wall ${DEBUG_COMPILE_FLAGS}") |
23fa36d480fb
Merge pep modules & use events
Myhailo Danylenko <isbear@ukrpost.net>
parents:
26
diff
changeset
|
68 |
set_target_properties(mood PROPERTIES COMPILE_FLAGS "-Wall ${DEBUG_COMPILE_FLAGS}") |
23fa36d480fb
Merge pep modules & use events
Myhailo Danylenko <isbear@ukrpost.net>
parents:
26
diff
changeset
|
69 |
set_target_properties(pep_mood PROPERTIES COMPILE_FLAGS "-Wall ${DEBUG_COMPILE_FLAGS}") |
23fa36d480fb
Merge pep modules & use events
Myhailo Danylenko <isbear@ukrpost.net>
parents:
26
diff
changeset
|
70 |
set_target_properties(tune PROPERTIES COMPILE_FLAGS "-Wall ${DEBUG_COMPILE_FLAGS}") |
23fa36d480fb
Merge pep modules & use events
Myhailo Danylenko <isbear@ukrpost.net>
parents:
26
diff
changeset
|
71 |
set_target_properties(pep_tune PROPERTIES COMPILE_FLAGS "-Wall ${DEBUG_COMPILE_FLAGS}") |
23fa36d480fb
Merge pep modules & use events
Myhailo Danylenko <isbear@ukrpost.net>
parents:
26
diff
changeset
|
72 |
set_target_properties(geoloc PROPERTIES COMPILE_FLAGS "-Wall ${DEBUG_COMPILE_FLAGS}") |
23fa36d480fb
Merge pep modules & use events
Myhailo Danylenko <isbear@ukrpost.net>
parents:
26
diff
changeset
|
73 |
set_target_properties(pep_geoloc PROPERTIES COMPILE_FLAGS "-Wall ${DEBUG_COMPILE_FLAGS}") |
23fa36d480fb
Merge pep modules & use events
Myhailo Danylenko <isbear@ukrpost.net>
parents:
26
diff
changeset
|
74 |
set_target_properties(activity PROPERTIES COMPILE_FLAGS "-Wall ${DEBUG_COMPILE_FLAGS}") |
23fa36d480fb
Merge pep modules & use events
Myhailo Danylenko <isbear@ukrpost.net>
parents:
26
diff
changeset
|
75 |
set_target_properties(pep_activity PROPERTIES COMPILE_FLAGS "-Wall ${DEBUG_COMPILE_FLAGS}") |
12
7d4c5337267c
Fix linker library search path
Myhailo Danylenko <isbear@ukrpost.net>
parents:
11
diff
changeset
|
76 |
|
0 | 77 |
## Packaging information |
78 |
set(CPACK_PACKAGE_NAME libmcabber-pep) |
|
19
9ce7690c4dab
Update module struct to use api
Myhailo Danylenko <isbear@ukrpost.net>
parents:
18
diff
changeset
|
79 |
set(CPACK_PACKAGE_VERSION ${PROJECT_VERSION}) |
0 | 80 |
set(CPACK_PACKAGE_VENDOR "IsBear") |
81 |
set(CPACK_PACKAGE_CONTACT "Myhailo Danylenko <isbear@ukrpost.net>") |
|
29
23fa36d480fb
Merge pep modules & use events
Myhailo Danylenko <isbear@ukrpost.net>
parents:
26
diff
changeset
|
82 |
set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "PEP modules") |
0 | 83 |
set(CPACK_RESOURCE_FILE_LICENSE ${pep_SOURCE_DIR}/COPYING) |
84 |
set(CPACK_SOURCE_GENERATOR TBZ2) |
|
85 |
set(CPACK_GENERATOR DEB CACHE TEXT "Binary package generator, eg DEB, RPM, TGZ, NSIS...") |
|
86 |
set(CPACK_DEBIAN_PACKAGE_SECTION libs) |
|
87 |
find_program(DPKG_EXECUTABLE dpkg) |
|
88 |
if(DPKG_EXECUTABLE) |
|
89 |
execute_process(COMMAND ${DPKG_EXECUTABLE} --print-architecture OUTPUT_VARIABLE CPACK_DEBIAN_PACKAGE_ARCHITECTURE OUTPUT_STRIP_TRAILING_WHITESPACE) |
|
90 |
else() |
|
91 |
set(CPACK_DEBIAN_PACKAGE_ARCHITECTURE i386 CACHE TEXT "Architecture of package") |
|
92 |
endif() |
|
93 |
set(CPACK_PACKAGE_FILE_NAME "${CPACK_PACKAGE_NAME}_${CPACK_PACKAGE_VERSION}_${CPACK_DEBIAN_PACKAGE_ARCHITECTURE}") |
|
94 |
set(CPACK_SOURCE_IGNORE_FILES "/\\\\..*;\\\\.swp;~$;/build/;\\\\.tar\\\\.;\\\\.deb;\\\\.so") |
|
95 |
include(CPack) |
|
96 |
||
29
23fa36d480fb
Merge pep modules & use events
Myhailo Danylenko <isbear@ukrpost.net>
parents:
26
diff
changeset
|
97 |
configure_file(avv/pep.in avv/pep) |
23fa36d480fb
Merge pep modules & use events
Myhailo Danylenko <isbear@ukrpost.net>
parents:
26
diff
changeset
|
98 |
configure_file(avv/mood.in avv/mood) |
23fa36d480fb
Merge pep modules & use events
Myhailo Danylenko <isbear@ukrpost.net>
parents:
26
diff
changeset
|
99 |
configure_file(avv/pep_mood.in avv/pep_mood) |
23fa36d480fb
Merge pep modules & use events
Myhailo Danylenko <isbear@ukrpost.net>
parents:
26
diff
changeset
|
100 |
configure_file(avv/tune.in avv/tune) |
23fa36d480fb
Merge pep modules & use events
Myhailo Danylenko <isbear@ukrpost.net>
parents:
26
diff
changeset
|
101 |
configure_file(avv/pep_tune.in avv/pep_tune) |
23fa36d480fb
Merge pep modules & use events
Myhailo Danylenko <isbear@ukrpost.net>
parents:
26
diff
changeset
|
102 |
configure_file(avv/geoloc.in avv/geoloc) |
23fa36d480fb
Merge pep modules & use events
Myhailo Danylenko <isbear@ukrpost.net>
parents:
26
diff
changeset
|
103 |
configure_file(avv/pep_geoloc.in avv/pep_geoloc) |
23fa36d480fb
Merge pep modules & use events
Myhailo Danylenko <isbear@ukrpost.net>
parents:
26
diff
changeset
|
104 |
configure_file(avv/activity.in avv/activity) |
23fa36d480fb
Merge pep modules & use events
Myhailo Danylenko <isbear@ukrpost.net>
parents:
26
diff
changeset
|
105 |
configure_file(avv/pep_activity.in avv/pep_activity) |
26
1d5521131630
Add AVV module description
Myhailo Danylenko <isbear@ukrpost.net>
parents:
21
diff
changeset
|
106 |
|
15
c28824abec86
Fix documentation installation path
Myhailo Danylenko <isbear@ukrpost.net>
parents:
12
diff
changeset
|
107 |
## Installation |
29
23fa36d480fb
Merge pep modules & use events
Myhailo Danylenko <isbear@ukrpost.net>
parents:
26
diff
changeset
|
108 |
install(TARGETS pep mood pep_mood tune pep_tune geoloc pep_geoloc activity pep_activity DESTINATION lib/mcabber) |
15
c28824abec86
Fix documentation installation path
Myhailo Danylenko <isbear@ukrpost.net>
parents:
12
diff
changeset
|
109 |
install(FILES pep.rc COPYING TODO README DESTINATION share/doc/${CPACK_PACKAGE_NAME}) |
29
23fa36d480fb
Merge pep modules & use events
Myhailo Danylenko <isbear@ukrpost.net>
parents:
26
diff
changeset
|
110 |
install(DIRECTORY doc/ DESTINATION share/doc/${CPACK_PACKAGE_NAME}) |
23fa36d480fb
Merge pep modules & use events
Myhailo Danylenko <isbear@ukrpost.net>
parents:
26
diff
changeset
|
111 |
install(FILES pep.h mood.h tune.h geoloc.h activity.h DESTINATION include/mcabber) |
23fa36d480fb
Merge pep modules & use events
Myhailo Danylenko <isbear@ukrpost.net>
parents:
26
diff
changeset
|
112 |
install(DIRECTORY help DESTINATION share/mcabber) |
23fa36d480fb
Merge pep modules & use events
Myhailo Danylenko <isbear@ukrpost.net>
parents:
26
diff
changeset
|
113 |
install(DIRECTORY ${PROJECT_BINARY_DIR}/avv/ DESTINATION share/mcabber/avv/modules) |
15
c28824abec86
Fix documentation installation path
Myhailo Danylenko <isbear@ukrpost.net>
parents:
12
diff
changeset
|
114 |
|
0 | 115 |
## The End ## vim: se ts=4: ## |