CMakeLists.txt
changeset 26 91987ea19f24
parent 24 220a7d7b8be0
child 27 0539bca09f11
--- a/CMakeLists.txt	Sun Jan 31 20:44:05 2010 +0200
+++ b/CMakeLists.txt	Mon Feb 15 17:51:21 2010 +0200
@@ -18,17 +18,13 @@
 project(disco C) 
 
 ## User settable options
-set(MCABBER_INCLUDE_DIR "/usr/include" CACHE FILEPATH "Path to mcabber headers") 
  
 ## Check for build dependencies
 find_package(PkgConfig REQUIRED) 
 pkg_check_modules(GLIB REQUIRED glib-2.0) 
 pkg_check_modules(GMODULE REQUIRED gmodule-2.0) 
 pkg_check_modules(LM REQUIRED loudmouth-1.0)
-find_program(GREP_EXECUTABLE grep DOC "Grep binary to detect functions in headers")
-if(GREP_EXECUTABLE)
-	execute_process(COMMAND ${GREP_EXECUTABLE} xmpp_is_online ${MCABBER_INCLUDE_DIR}/mcabber/xmpp.h OUTPUT_VARIABLE HAVE_XMPP_IS_ONLINE ERROR_QUIET)
-endif()
+pkg_check_modules(MCABBER REQUIRED mcabber)
 include(CheckSymbolExists)
 set(CMAKE_REQUIRED_INCLUDES ${LM_INCLUDE_DIRS})
 set(CMAKE_REQUIRED_LIBRARIES ${LM_LIBRARIES})
@@ -36,7 +32,8 @@
 check_symbol_exists(lm_connection_unregister_reply_handler loudmouth/loudmouth.h HAVE_LM_CONNECTION_UNREGISTER_REPLY_HANDLER)
 link_directories(${GLIB_LIBRARY_DIRS}
 				 ${GMODULE_LIBRARY_DIRS}
-				 ${LM_LIBRARY_DIRS})
+				 ${LM_LIBRARY_DIRS}
+				 ${MCABBER_LIBRARY_DIRS})
 
 ## Target definitions
 add_library(disco MODULE disco.c)
@@ -46,10 +43,11 @@
 include_directories(SYSTEM ${GLIB_INCLUDE_DIRS} 
                     ${GMODULE_INCLUDE_DIRS} 
                     ${LM_INCLUDE_DIRS}
-					${MCABBER_INCLUDE_DIR}) 
+					${MCABBER_INCLUDE_DIRS}) 
 target_link_libraries(disco ${GLIB_LIBRARIES} 
                       ${GMODULE_LIBRARIES}
-					  ${LM_LIBRARIES})
+					  ${LM_LIBRARIES}
+					  ${MCABBER_LIBRARIES})
 include_directories(${disco_SOURCE_DIR} 
                     ${disco_BINARY_DIR})