16 |
16 |
17 cmake_minimum_required(VERSION 2.6) |
17 cmake_minimum_required(VERSION 2.6) |
18 project(cmd C) |
18 project(cmd C) |
19 |
19 |
20 ## User settable options |
20 ## User settable options |
21 set(MCABBER_INCLUDE_DIR "/usr/include" CACHE FILEPATH "Path to mcabber headers") |
|
22 |
21 |
23 ## Check for build dependencies |
22 ## Check for build dependencies |
24 find_package(PkgConfig REQUIRED) |
23 find_package(PkgConfig REQUIRED) |
25 pkg_check_modules(GLIB REQUIRED glib-2.0) |
24 pkg_check_modules(GLIB REQUIRED glib-2.0) |
26 pkg_check_modules(GMODULE REQUIRED gmodule-2.0) |
25 pkg_check_modules(GMODULE REQUIRED gmodule-2.0) |
27 pkg_check_modules(LM REQUIRED loudmouth-1.0) |
26 pkg_check_modules(MCABBER REQUIRED mcabber) |
28 find_program(GREP_EXECUTABLE grep DOC "Grep binary to find functions in headers") |
|
29 if(GREP_EXECUTABLE) |
|
30 execute_process(COMMAND ${GREP_EXECUTABLE} xmpp_is_online ${MCABBER_INCLUDE_DIR}/mcabber/xmpp.h OUTPUT_VARIABLE HAVE_XMPP_IS_ONLINE ERROR_QUIET) |
|
31 endif() |
|
32 link_directories(${GLIB_LIBRARY_DIRS} |
27 link_directories(${GLIB_LIBRARY_DIRS} |
33 ${GMODULE_LIBRARY_DIRS}) |
28 ${GMODULE_LIBRARY_DIRS} |
|
29 ${MCABBER_LIBRARY_DIRS}) |
34 |
30 |
35 ## Target definitions |
31 ## Target definitions |
36 add_library(cmd MODULE cmd.c) |
32 add_library(cmd MODULE cmd.c) |
37 |
33 |
38 ## Compiler setup |
34 ## Compiler setup |
39 configure_file(config.h.in config.h) |
|
40 include_directories(SYSTEM ${GLIB_INCLUDE_DIRS} |
35 include_directories(SYSTEM ${GLIB_INCLUDE_DIRS} |
41 ${GMODULE_INCLUDE_DIRS} |
36 ${GMODULE_INCLUDE_DIRS} |
42 ${LM_INCLUDE_DIRS} |
37 ${LM_INCLUDE_DIRS} |
43 ${MCABBER_INCLUDE_DIR}) |
38 ${MCABBER_INCLUDE_DIRS}) |
44 target_link_libraries(cmd ${GLIB_LIBRARIES} |
39 target_link_libraries(cmd ${GLIB_LIBRARIES} |
45 ${GMODULE_LIBRARIES}) |
40 ${GMODULE_LIBRARIES} |
|
41 ${MCABBER_LIBRARIES}) |
46 include_directories(${cmd_SOURCE_DIR} |
42 include_directories(${cmd_SOURCE_DIR} |
47 ${cmd_BINARY_DIR}) |
43 ${cmd_BINARY_DIR}) |
48 |
44 |
49 ## Packaging information |
45 ## Packaging information |
50 set(CPACK_PACKAGE_NAME libmcabber-cmd) |
46 set(CPACK_PACKAGE_NAME libmcabber-cmd) |