--- a/CMakeLists.txt Thu Nov 13 22:39:40 2014 +0200
+++ b/CMakeLists.txt Thu Nov 13 23:29:42 2014 +0200
@@ -24,6 +24,18 @@
find_package(PkgConfig REQUIRED)
pkg_check_modules(GLIB REQUIRED glib-2.0)
pkg_check_modules(MCABBER REQUIRED mcabber)
+include(CheckSymbolExists)
+set(CMAKE_REQUIRED_INCLUDES ${MCABBER_INCLUDE_DIRS})
+set(CMAKE_REQUIRED_LIBRARIES ${MCABBER_LIBRARIES})
+set(CMAKE_REQUIRED_FLAGS ${MCABBER_LDFLAGS} ${MCABBER_CFLAGS})
+check_symbol_exists(MCABBER_API_HAVE_CMD_ID mcabber/api.h HAVE_MCABBER_CMD_ID)
+include(CheckCSourceCompiles)
+check_c_source_compiles("
+ #include <mcabber/commands.h>
+ int process_command(const char *line, guint iscmd);
+ int main (void) { }
+ " HAVE_MCABBER_PROCESS_COMMAND_RETVAL)
+
link_directories(${GLIB_LIBRARY_DIRS}
${MCABBER_LIBRARY_DIRS})
@@ -60,6 +72,14 @@
set(CPACK_SOURCE_IGNORE_FILES "/\\\\..*;\\\\.swp;~$;/build/;\\\\.tar\\\\.;\\\\.deb;\\\\.so")
include(CPack)
+## AVV build-time dependent requirements
+if(NOT HAVE_MCABBER_CMD_ID)
+ set(AVV_COMMANDS_VERSION "commands:2 | commands:1")
+elseif(HAVE_MCABBER_PROCESS_COMMAND_RETVAL)
+ set(AVV_COMMANDS_VERSION "commands:4 | commands:3")
+else()
+ set(AVV_COMMANDS_VERSION "commands:5")
+endif()
configure_file(marking.avv.in marking.avv)
## Installation
@@ -68,4 +88,4 @@
install(DIRECTORY help DESTINATION share/mcabber)
install(FILES ${PROJECT_BINARY_DIR}/marking.avv DESTINATION share/mcabber/avv/modules RENAME marking)
-## The End ## vim: se ts=4: ##
+## The End ## vim: se ts=4 sw=4: ##