CMakeLists.txt
author Myhailo Danylenko <isbear@ukrpost.net>
Sun, 20 May 2012 22:15:51 +0300
changeset 29 23fa36d480fb
parent 26 1d5521131630
child 31 e404cd1c7077
permissions -rw-r--r--
Merge pep modules & use events * merge mood, tune, activity, geoloc, avatar * split them into functionality/ui * tune, geoloc: fix timeout bug * geoloc: fix guard unregistering * tune, mood: fix memleaking delayed info * mood: fix non-publish of offline-delayed data * activity: unregister reply handler on disconnect * fix silly copyright typo * update hgignore * v0.0.3

## Copyright 2009 Myhailo Danylenko
# This file is part of mcabber module writing howto examples.
#
# Examples are free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program.  If not, see <http://www.gnu.org/licenses/>.

cmake_minimum_required(VERSION 2.6) 
project(pep C) 
set(PROJECT_VERSION "0.0.3")

## User settable options
 
## Check for build dependencies
find_package(PkgConfig REQUIRED) 
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 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(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 ${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 "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...")
set(CPACK_DEBIAN_PACKAGE_SECTION libs)
find_program(DPKG_EXECUTABLE dpkg)
if(DPKG_EXECUTABLE)
	execute_process(COMMAND ${DPKG_EXECUTABLE} --print-architecture OUTPUT_VARIABLE CPACK_DEBIAN_PACKAGE_ARCHITECTURE OUTPUT_STRIP_TRAILING_WHITESPACE)
else()
	set(CPACK_DEBIAN_PACKAGE_ARCHITECTURE i386 CACHE TEXT "Architecture of package")
endif()
set(CPACK_PACKAGE_FILE_NAME "${CPACK_PACKAGE_NAME}_${CPACK_PACKAGE_VERSION}_${CPACK_DEBIAN_PACKAGE_ARCHITECTURE}")
set(CPACK_SOURCE_IGNORE_FILES "/\\\\..*;\\\\.swp;~$;/build/;\\\\.tar\\\\.;\\\\.deb;\\\\.so")
include(CPack)

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 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(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: ##