14 # You should have received a copy of the GNU General Public License |
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/>. |
15 # along with this program. If not, see <http://www.gnu.org/licenses/>. |
16 |
16 |
17 cmake_minimum_required(VERSION 2.6) |
17 cmake_minimum_required(VERSION 2.6) |
18 project(pep C) |
18 project(pep C) |
19 set(PROJECT_VERSION "0.0.1") |
19 set(PROJECT_VERSION "0.0.3") |
20 |
20 |
21 ## User settable options |
21 ## User settable options |
22 |
22 |
23 ## Check for build dependencies |
23 ## Check for build dependencies |
24 find_package(PkgConfig REQUIRED) |
24 find_package(PkgConfig REQUIRED) |
25 pkg_check_modules(GLIB REQUIRED glib-2.0) |
25 pkg_check_modules(GLIB REQUIRED glib-2.0) |
26 pkg_check_modules(LM REQUIRED loudmouth-1.0) |
26 pkg_check_modules(LM REQUIRED loudmouth-1.0) |
27 pkg_check_modules(MCABBER REQUIRED mcabber) |
27 pkg_check_modules(MCABBER REQUIRED mcabber) |
|
28 include(CheckSymbolExists) |
|
29 set(CMAKE_REQUIRED_INCLUDES ${LM_INCLUDE_DIRS}) |
|
30 set(CMAKE_REQUIRED_LIBRARIES ${LM_LIBRARIES}) |
|
31 set(CMAKE_REQUIRED_FLAGS ${LM_LDFLAGS} ${LM_CFLAGS}) |
|
32 check_symbol_exists(lm_connection_unregister_reply_handler loudmouth/loudmouth.h HAVE_LM_CONNECTION_UNREGISTER_REPLY_HANDLER) |
28 link_directories(${GLIB_LIBRARY_DIRS} |
33 link_directories(${GLIB_LIBRARY_DIRS} |
29 ${LM_LIBRARY_DIRS} |
34 ${LM_LIBRARY_DIRS} |
30 ${MCABBER_LIBRARY_DIRS}) |
35 ${MCABBER_LIBRARY_DIRS}) |
31 |
36 |
32 ## Target definitions |
37 ## Target definitions |
33 add_library(pep MODULE pep.c) |
38 add_library(pep MODULE pep.c pep.h) |
|
39 add_library(mood MODULE mood.c mood.h) |
|
40 add_library(pep_mood MODULE pep_mood.c mood.h pep.h) |
|
41 add_library(tune MODULE tune.c tune.h) |
|
42 add_library(pep_tune MODULE pep_tune.c tune.h pep.h) |
|
43 add_library(geoloc MODULE geoloc.c geoloc.h) |
|
44 add_library(pep_geoloc MODULE pep_geoloc.c geoloc.h pep.h) |
|
45 add_library(activity MODULE activity.c activity.h) |
|
46 add_library(pep_activity MODULE pep_activity.c activity.h pep.h) |
34 |
47 |
35 ## Compiler setup |
48 ## Compiler setup |
|
49 if(DEBUG) |
|
50 set(DEBUG_COMPILE_FLAGS "-g") |
|
51 endif() |
36 configure_file(config.h.in config.h) |
52 configure_file(config.h.in config.h) |
37 include_directories(SYSTEM ${GLIB_INCLUDE_DIRS} |
53 include_directories(SYSTEM ${GLIB_INCLUDE_DIRS} |
38 ${LM_INCLUDE_DIRS} |
54 ${LM_INCLUDE_DIRS} |
39 ${MCABBER_INCLUDE_DIRS}) |
55 ${MCABBER_INCLUDE_DIRS}) |
40 target_link_libraries(pep ${GLIB_LIBRARIES} |
56 target_link_libraries(pep ${GLIB_LIBRARIES} ${LM_LIBRARIES} ${MCABBER_LIBRARIES}) |
41 ${LM_LIBRARIES} |
57 target_link_libraries(mood ${GLIB_LIBRARIES} ${MCABBER_LIBRARIES}) |
42 ${MCABBER_LIBRARIES}) |
58 target_link_libraries(pep_mood ${GLIB_LIBRARIES} ${LM_LIBRARIES} ${MCABBER_LIBRARIES}) |
|
59 target_link_libraries(tune ${GLIB_LIBRARIES} ${MCABBER_LIBRARIES}) |
|
60 target_link_libraries(pep_tune ${GLIB_LIBRARIES} ${LM_LIBRARIES} ${MCABBER_LIBRARIES}) |
|
61 target_link_libraries(geoloc ${GLIB_LIBRARIES} ${MCABBER_LIBRARIES}) |
|
62 target_link_libraries(pep_geoloc ${GLIB_LIBRARIES} ${LM_LIBRARIES} ${MCABBER_LIBRARIES}) |
|
63 target_link_libraries(activity ${GLIB_LIBRARIES} ${MCABBER_LIBRARIES}) |
|
64 target_link_libraries(pep_activity ${GLIB_LIBRARIES} ${LM_LIBRARIES} ${MCABBER_LIBRARIES}) |
43 include_directories(${pep_SOURCE_DIR} |
65 include_directories(${pep_SOURCE_DIR} |
44 ${pep_BINARY_DIR}) |
66 ${pep_BINARY_DIR}) |
45 set_target_properties(pep PROPERTIES COMPILE_FLAGS "-Wall") |
67 set_target_properties(pep PROPERTIES COMPILE_FLAGS "-Wall ${DEBUG_COMPILE_FLAGS}") |
|
68 set_target_properties(mood PROPERTIES COMPILE_FLAGS "-Wall ${DEBUG_COMPILE_FLAGS}") |
|
69 set_target_properties(pep_mood PROPERTIES COMPILE_FLAGS "-Wall ${DEBUG_COMPILE_FLAGS}") |
|
70 set_target_properties(tune PROPERTIES COMPILE_FLAGS "-Wall ${DEBUG_COMPILE_FLAGS}") |
|
71 set_target_properties(pep_tune PROPERTIES COMPILE_FLAGS "-Wall ${DEBUG_COMPILE_FLAGS}") |
|
72 set_target_properties(geoloc PROPERTIES COMPILE_FLAGS "-Wall ${DEBUG_COMPILE_FLAGS}") |
|
73 set_target_properties(pep_geoloc PROPERTIES COMPILE_FLAGS "-Wall ${DEBUG_COMPILE_FLAGS}") |
|
74 set_target_properties(activity PROPERTIES COMPILE_FLAGS "-Wall ${DEBUG_COMPILE_FLAGS}") |
|
75 set_target_properties(pep_activity PROPERTIES COMPILE_FLAGS "-Wall ${DEBUG_COMPILE_FLAGS}") |
46 |
76 |
47 ## Packaging information |
77 ## Packaging information |
48 set(CPACK_PACKAGE_NAME libmcabber-pep) |
78 set(CPACK_PACKAGE_NAME libmcabber-pep) |
49 set(CPACK_PACKAGE_VERSION ${PROJECT_VERSION}) |
79 set(CPACK_PACKAGE_VERSION ${PROJECT_VERSION}) |
50 set(CPACK_PACKAGE_VENDOR "IsBear") |
80 set(CPACK_PACKAGE_VENDOR "IsBear") |
51 set(CPACK_PACKAGE_CONTACT "Myhailo Danylenko <isbear@ukrpost.net>") |
81 set(CPACK_PACKAGE_CONTACT "Myhailo Danylenko <isbear@ukrpost.net>") |
52 set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "Common PEP listener module") |
82 set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "PEP modules") |
53 set(CPACK_RESOURCE_FILE_LICENSE ${pep_SOURCE_DIR}/COPYING) |
83 set(CPACK_RESOURCE_FILE_LICENSE ${pep_SOURCE_DIR}/COPYING) |
54 set(CPACK_SOURCE_GENERATOR TBZ2) |
84 set(CPACK_SOURCE_GENERATOR TBZ2) |
55 set(CPACK_GENERATOR DEB CACHE TEXT "Binary package generator, eg DEB, RPM, TGZ, NSIS...") |
85 set(CPACK_GENERATOR DEB CACHE TEXT "Binary package generator, eg DEB, RPM, TGZ, NSIS...") |
56 set(CPACK_DEBIAN_PACKAGE_SECTION libs) |
86 set(CPACK_DEBIAN_PACKAGE_SECTION libs) |
57 find_program(DPKG_EXECUTABLE dpkg) |
87 find_program(DPKG_EXECUTABLE dpkg) |
62 endif() |
92 endif() |
63 set(CPACK_PACKAGE_FILE_NAME "${CPACK_PACKAGE_NAME}_${CPACK_PACKAGE_VERSION}_${CPACK_DEBIAN_PACKAGE_ARCHITECTURE}") |
93 set(CPACK_PACKAGE_FILE_NAME "${CPACK_PACKAGE_NAME}_${CPACK_PACKAGE_VERSION}_${CPACK_DEBIAN_PACKAGE_ARCHITECTURE}") |
64 set(CPACK_SOURCE_IGNORE_FILES "/\\\\..*;\\\\.swp;~$;/build/;\\\\.tar\\\\.;\\\\.deb;\\\\.so") |
94 set(CPACK_SOURCE_IGNORE_FILES "/\\\\..*;\\\\.swp;~$;/build/;\\\\.tar\\\\.;\\\\.deb;\\\\.so") |
65 include(CPack) |
95 include(CPack) |
66 |
96 |
67 configure_file(pep.avv.in pep.avv) |
97 configure_file(avv/pep.in avv/pep) |
|
98 configure_file(avv/mood.in avv/mood) |
|
99 configure_file(avv/pep_mood.in avv/pep_mood) |
|
100 configure_file(avv/tune.in avv/tune) |
|
101 configure_file(avv/pep_tune.in avv/pep_tune) |
|
102 configure_file(avv/geoloc.in avv/geoloc) |
|
103 configure_file(avv/pep_geoloc.in avv/pep_geoloc) |
|
104 configure_file(avv/activity.in avv/activity) |
|
105 configure_file(avv/pep_activity.in avv/pep_activity) |
68 |
106 |
69 ## Installation |
107 ## Installation |
70 install(TARGETS pep DESTINATION lib/mcabber) |
108 install(TARGETS pep mood pep_mood tune pep_tune geoloc pep_geoloc activity pep_activity DESTINATION lib/mcabber) |
71 install(FILES pep.rc COPYING TODO README DESTINATION share/doc/${CPACK_PACKAGE_NAME}) |
109 install(FILES pep.rc COPYING TODO README DESTINATION share/doc/${CPACK_PACKAGE_NAME}) |
72 install(FILES pep.h DESTINATION include/mcabber) |
110 install(DIRECTORY doc/ DESTINATION share/doc/${CPACK_PACKAGE_NAME}) |
73 install(FILES ${PROJECT_BINARY_DIR}/pep.avv DESTINATION share/mcabber/avv/modules RENAME pep) |
111 install(FILES pep.h mood.h tune.h geoloc.h activity.h DESTINATION include/mcabber) |
|
112 install(DIRECTORY help DESTINATION share/mcabber) |
|
113 install(DIRECTORY ${PROJECT_BINARY_DIR}/avv/ DESTINATION share/mcabber/avv/modules) |
74 |
114 |
75 ## The End ## vim: se ts=4: ## |
115 ## The End ## vim: se ts=4: ## |