28 include(CheckSymbolExists) |
28 include(CheckSymbolExists) |
29 set(CMAKE_REQUIRED_INCLUDES ${LM_INCLUDE_DIRS}) |
29 set(CMAKE_REQUIRED_INCLUDES ${LM_INCLUDE_DIRS}) |
30 set(CMAKE_REQUIRED_LIBRARIES ${LM_LIBRARIES}) |
30 set(CMAKE_REQUIRED_LIBRARIES ${LM_LIBRARIES}) |
31 set(CMAKE_REQUIRED_FLAGS ${LM_LDFLAGS} ${LM_CFLAGS}) |
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) |
32 check_symbol_exists(lm_connection_unregister_reply_handler loudmouth/loudmouth.h HAVE_LM_CONNECTION_UNREGISTER_REPLY_HANDLER) |
33 include(CheckCSourceCompiles) |
|
34 set(CMAKE_REQUIRED_INCLUDES ${MCABBER_INCLUDE_DIRS}) |
33 set(CMAKE_REQUIRED_INCLUDES ${MCABBER_INCLUDE_DIRS}) |
35 set(CMAKE_REQUIRED_LIBRARIES ${MCABBER_LIBRARIES}) |
34 set(CMAKE_REQUIRED_LIBRARIES ${MCABBER_LIBRARIES}) |
36 set(CMAKE_REQUIRED_FLAGS ${MCABBER_LDFLAGS} ${MCABBER_CFLAGS}) |
35 set(CMAKE_REQUIRED_FLAGS ${MCABBER_LDFLAGS} ${MCABBER_CFLAGS}) |
37 check_c_source_compiles(" |
36 check_symbol_exists(MCABBER_API_HAVE_COMPL_FLAGS mcabber/api.h HAVE_MCABBER_COMPLETION_FLAGS) |
38 #include <glib.h> |
37 check_symbol_exists(MCABBER_API_HAVE_CMD_ID mcabber/api.h HAVE_MCABBER_CMD_ID) |
39 #include <mcabber/api.h> |
|
40 #ifdef MCABBER_API_HAVE_COMPL_FLAGS |
|
41 int main (void) { return 0; } |
|
42 #endif |
|
43 " HAVE_MCABBER_COMPLETION_FLAGS) |
|
44 link_directories(${GLIB_LIBRARY_DIRS} |
38 link_directories(${GLIB_LIBRARY_DIRS} |
45 ${LM_LIBRARY_DIRS} |
39 ${LM_LIBRARY_DIRS} |
46 ${MCABBER_LIBRARY_DIRS}) |
40 ${MCABBER_LIBRARY_DIRS}) |
47 |
41 |
48 ## Target definitions |
42 ## Target definitions |
78 endif() |
72 endif() |
79 set(CPACK_PACKAGE_FILE_NAME "${CPACK_PACKAGE_NAME}_${CPACK_PACKAGE_VERSION}_${CPACK_DEBIAN_PACKAGE_ARCHITECTURE}") |
73 set(CPACK_PACKAGE_FILE_NAME "${CPACK_PACKAGE_NAME}_${CPACK_PACKAGE_VERSION}_${CPACK_DEBIAN_PACKAGE_ARCHITECTURE}") |
80 set(CPACK_SOURCE_IGNORE_FILES "/\\\\..*;\\\\.swp;~$;/build/;\\\\.tar\\\\.;\\\\.deb;\\\\.so") |
74 set(CPACK_SOURCE_IGNORE_FILES "/\\\\..*;\\\\.swp;~$;/build/;\\\\.tar\\\\.;\\\\.deb;\\\\.so") |
81 include(CPack) |
75 include(CPack) |
82 |
76 |
|
77 ## AVV build-time dependent requirements |
83 if(HAVE_MCABBER_COMPLETION_FLAGS) |
78 if(HAVE_MCABBER_COMPLETION_FLAGS) |
84 set(AVV_COMPL_VERSION "compl:4") |
79 set(AVV_COMPL_VERSION "compl:6 | compl:5 | compl:4") |
85 else() |
80 else() |
86 set(AVV_COMPL_VERSION "compl:2 | compl:3") |
81 set(AVV_COMPL_VERSION "compl:3 | compl:2") |
|
82 endif() |
|
83 if(HAVE_MCABBER_CMD_ID) |
|
84 set(AVV_COMMANDS_VERSION "commands:5 | commands:4 | commands:3") |
|
85 else() |
|
86 set(AVV_COMMANDS_VERSION "commands:2 | commands:1") |
87 endif() |
87 endif() |
88 configure_file(disco.avv.in disco.avv) |
88 configure_file(disco.avv.in disco.avv) |
89 |
89 |
90 ## Installation |
90 ## Installation |
91 install(TARGETS disco DESTINATION lib/mcabber) |
91 install(TARGETS disco DESTINATION lib/mcabber) |
92 install(FILES docs/disco.rc COPYING docs/todo.mdwn docs/readme.mdwn DESTINATION share/doc/${CPACK_PACKAGE_NAME}) |
92 install(FILES docs/disco.rc COPYING docs/todo.mdwn docs/readme.mdwn DESTINATION share/doc/${CPACK_PACKAGE_NAME}) |
93 install(FILES disco.h DESTINATION include/mcabber) |
93 install(FILES disco.h DESTINATION include/mcabber) |
94 install(DIRECTORY help DESTINATION share/mcabber) |
94 install(DIRECTORY help DESTINATION share/mcabber) |
95 install(FILES ${PROJECT_BINARY_DIR}/disco.avv DESTINATION share/mcabber/avv/modules RENAME disco) |
95 install(FILES ${PROJECT_BINARY_DIR}/disco.avv DESTINATION share/mcabber/avv/modules RENAME disco) |
96 |
96 |
97 ## The End ## vim: se ts=4: ## |
97 ## The End ## vim: se ts=4 sw=4: ## |