CMakeLists.txt
changeset 22 6d0d6bbf98d0
parent 20 035a59c47d69
child 24 220a7d7b8be0
equal deleted inserted replaced
21:299300f1dd31 22:6d0d6bbf98d0
    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(GMODULE REQUIRED gmodule-2.0) 
    26 pkg_check_modules(GMODULE REQUIRED gmodule-2.0) 
    27 pkg_check_modules(LM REQUIRED loudmouth-1.0) 
    27 pkg_check_modules(LM REQUIRED loudmouth-1.0)
       
    28 find_program(GREP_EXECUTABLE grep DOC "Grep binary to detect 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 include(CheckSymbolExists)
       
    33 set(CMAKE_REQUIRED_INCLUDES ${LM_INCLUDE_DIRS})
       
    34 set(CMAKE_REQUIRED_LIBRARIES ${LM_LIBRARIES})
       
    35 set(CMAKE_REQUIRED_FLAGS ${LM_LDFLAGS} ${LM_CFLAGS})
       
    36 check_symbol_exists(lm_connection_unregister_reply_handler loudmouth/loudmouth.h HAVE_LM_CONNECTION_UNREGISTER_REPLY_HANDLER)
    28 link_directories(${GLIB_LIBRARY_DIRS}
    37 link_directories(${GLIB_LIBRARY_DIRS}
    29 				 ${GMODULE_LIBRARY_DIRS}
    38 				 ${GMODULE_LIBRARY_DIRS}
    30 				 ${LM_LIBRARY_DIRS})
    39 				 ${LM_LIBRARY_DIRS})
    31 
    40 
    32 ## Target definitions
    41 ## Target definitions
    33 add_library(disco MODULE disco.c)
    42 add_library(disco MODULE disco.c)
    34 
    43 
    35 ## Compiler setup
    44 ## Compiler setup
       
    45 configure_file(config.h.in config.h)
    36 include_directories(SYSTEM ${GLIB_INCLUDE_DIRS} 
    46 include_directories(SYSTEM ${GLIB_INCLUDE_DIRS} 
    37                     ${GMODULE_INCLUDE_DIRS} 
    47                     ${GMODULE_INCLUDE_DIRS} 
    38                     ${LM_INCLUDE_DIRS}
    48                     ${LM_INCLUDE_DIRS}
    39 					${MCABBER_INCLUDE_DIR}) 
    49 					${MCABBER_INCLUDE_DIR}) 
    40 target_link_libraries(disco ${GLIB_LIBRARIES} 
    50 target_link_libraries(disco ${GLIB_LIBRARIES}