CMakeLists.txt
changeset 29 23fa36d480fb
parent 26 1d5521131630
child 31 e404cd1c7077
--- a/CMakeLists.txt	Wed Jun 29 19:25:16 2011 +0300
+++ b/CMakeLists.txt	Sun May 20 22:15:51 2012 +0300
@@ -16,7 +16,7 @@
 
 cmake_minimum_required(VERSION 2.6) 
 project(pep C) 
-set(PROJECT_VERSION "0.0.1")
+set(PROJECT_VERSION "0.0.3")
 
 ## User settable options
  
@@ -25,31 +25,61 @@
 pkg_check_modules(GLIB REQUIRED glib-2.0) 
 pkg_check_modules(LM REQUIRED loudmouth-1.0) 
 pkg_check_modules(MCABBER REQUIRED mcabber)
+include(CheckSymbolExists)
+set(CMAKE_REQUIRED_INCLUDES ${LM_INCLUDE_DIRS})
+set(CMAKE_REQUIRED_LIBRARIES ${LM_LIBRARIES})
+set(CMAKE_REQUIRED_FLAGS ${LM_LDFLAGS} ${LM_CFLAGS})
+check_symbol_exists(lm_connection_unregister_reply_handler loudmouth/loudmouth.h HAVE_LM_CONNECTION_UNREGISTER_REPLY_HANDLER)
 link_directories(${GLIB_LIBRARY_DIRS}
 				 ${LM_LIBRARY_DIRS}
 				 ${MCABBER_LIBRARY_DIRS})
 
 ## Target definitions
-add_library(pep MODULE pep.c) 
+add_library(pep          MODULE pep.c pep.h) 
+add_library(mood         MODULE mood.c mood.h) 
+add_library(pep_mood     MODULE pep_mood.c mood.h pep.h) 
+add_library(tune         MODULE tune.c tune.h) 
+add_library(pep_tune     MODULE pep_tune.c tune.h pep.h) 
+add_library(geoloc       MODULE geoloc.c geoloc.h) 
+add_library(pep_geoloc   MODULE pep_geoloc.c geoloc.h pep.h) 
+add_library(activity     MODULE activity.c activity.h) 
+add_library(pep_activity MODULE pep_activity.c activity.h pep.h) 
 
 ## Compiler setup
+if(DEBUG)
+		set(DEBUG_COMPILE_FLAGS "-g")
+endif()
 configure_file(config.h.in config.h)
 include_directories(SYSTEM ${GLIB_INCLUDE_DIRS} 
                     ${LM_INCLUDE_DIRS}
 					${MCABBER_INCLUDE_DIRS})
-target_link_libraries(pep ${GLIB_LIBRARIES} 
-					  ${LM_LIBRARIES}
-					  ${MCABBER_LIBRARIES})
+target_link_libraries(pep          ${GLIB_LIBRARIES} ${LM_LIBRARIES} ${MCABBER_LIBRARIES})
+target_link_libraries(mood         ${GLIB_LIBRARIES}                 ${MCABBER_LIBRARIES})
+target_link_libraries(pep_mood     ${GLIB_LIBRARIES} ${LM_LIBRARIES} ${MCABBER_LIBRARIES})
+target_link_libraries(tune         ${GLIB_LIBRARIES}                 ${MCABBER_LIBRARIES})
+target_link_libraries(pep_tune     ${GLIB_LIBRARIES} ${LM_LIBRARIES} ${MCABBER_LIBRARIES})
+target_link_libraries(geoloc       ${GLIB_LIBRARIES}                 ${MCABBER_LIBRARIES})
+target_link_libraries(pep_geoloc   ${GLIB_LIBRARIES} ${LM_LIBRARIES} ${MCABBER_LIBRARIES})
+target_link_libraries(activity     ${GLIB_LIBRARIES}                 ${MCABBER_LIBRARIES})
+target_link_libraries(pep_activity ${GLIB_LIBRARIES} ${LM_LIBRARIES} ${MCABBER_LIBRARIES})
 include_directories(${pep_SOURCE_DIR} 
                     ${pep_BINARY_DIR})
-set_target_properties(pep PROPERTIES COMPILE_FLAGS "-Wall")
+set_target_properties(pep          PROPERTIES COMPILE_FLAGS "-Wall ${DEBUG_COMPILE_FLAGS}")
+set_target_properties(mood         PROPERTIES COMPILE_FLAGS "-Wall ${DEBUG_COMPILE_FLAGS}")
+set_target_properties(pep_mood     PROPERTIES COMPILE_FLAGS "-Wall ${DEBUG_COMPILE_FLAGS}")
+set_target_properties(tune         PROPERTIES COMPILE_FLAGS "-Wall ${DEBUG_COMPILE_FLAGS}")
+set_target_properties(pep_tune     PROPERTIES COMPILE_FLAGS "-Wall ${DEBUG_COMPILE_FLAGS}")
+set_target_properties(geoloc       PROPERTIES COMPILE_FLAGS "-Wall ${DEBUG_COMPILE_FLAGS}")
+set_target_properties(pep_geoloc   PROPERTIES COMPILE_FLAGS "-Wall ${DEBUG_COMPILE_FLAGS}")
+set_target_properties(activity     PROPERTIES COMPILE_FLAGS "-Wall ${DEBUG_COMPILE_FLAGS}")
+set_target_properties(pep_activity PROPERTIES COMPILE_FLAGS "-Wall ${DEBUG_COMPILE_FLAGS}")
 
 ## Packaging information
 set(CPACK_PACKAGE_NAME libmcabber-pep)
 set(CPACK_PACKAGE_VERSION ${PROJECT_VERSION})
 set(CPACK_PACKAGE_VENDOR "IsBear")
 set(CPACK_PACKAGE_CONTACT "Myhailo Danylenko <isbear@ukrpost.net>")
-set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "Common PEP listener module")
+set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "PEP modules")
 set(CPACK_RESOURCE_FILE_LICENSE ${pep_SOURCE_DIR}/COPYING)
 set(CPACK_SOURCE_GENERATOR TBZ2)
 set(CPACK_GENERATOR DEB CACHE TEXT "Binary package generator, eg DEB, RPM, TGZ, NSIS...")
@@ -64,12 +94,22 @@
 set(CPACK_SOURCE_IGNORE_FILES "/\\\\..*;\\\\.swp;~$;/build/;\\\\.tar\\\\.;\\\\.deb;\\\\.so")
 include(CPack)
 
-configure_file(pep.avv.in pep.avv)
+configure_file(avv/pep.in          avv/pep)
+configure_file(avv/mood.in         avv/mood)
+configure_file(avv/pep_mood.in     avv/pep_mood)
+configure_file(avv/tune.in         avv/tune)
+configure_file(avv/pep_tune.in     avv/pep_tune)
+configure_file(avv/geoloc.in       avv/geoloc)
+configure_file(avv/pep_geoloc.in   avv/pep_geoloc)
+configure_file(avv/activity.in     avv/activity)
+configure_file(avv/pep_activity.in avv/pep_activity)
 
 ## Installation
-install(TARGETS pep DESTINATION lib/mcabber) 
+install(TARGETS pep mood pep_mood tune pep_tune geoloc pep_geoloc activity pep_activity DESTINATION lib/mcabber) 
 install(FILES pep.rc COPYING TODO README DESTINATION share/doc/${CPACK_PACKAGE_NAME})
-install(FILES pep.h DESTINATION include/mcabber)
-install(FILES ${PROJECT_BINARY_DIR}/pep.avv DESTINATION share/mcabber/avv/modules RENAME pep)
+install(DIRECTORY doc/ DESTINATION share/doc/${CPACK_PACKAGE_NAME})
+install(FILES pep.h mood.h tune.h geoloc.h activity.h DESTINATION include/mcabber)
+install(DIRECTORY help DESTINATION share/mcabber)
+install(DIRECTORY ${PROJECT_BINARY_DIR}/avv/ DESTINATION share/mcabber/avv/modules)
 
 ## The End ## vim: se ts=4: ##