CMakeLists.txt
author Myhailo Danylenko <isbear@ukrpost.net>
Sun, 17 Jan 2010 12:04:48 +0200
changeset 13 6ed6279de87f
parent 12 7781b3b05e75
child 14 9a4d0f04c7d3
permissions -rw-r--r--
Fix linker library search path

## 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(avatar 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)
pkg_check_modules(PNG REQUIRED libpng12)
set(AALIB_LIBRARY_DIRS "/usr/lib" CACHE FILEPATH "Path, where AAlib is located")
set(AALIB_INCLUDE_DIRS "/usr/include" CACHE FILEPATH "Path to AAlib includes")
set(AALIB_LIBRARIES "-laa" CACHE TEXT "Libraries, necessary to link with AAlib")
link_directories(${GLIB_LIBRARY_DIRS}
				 ${GMODULE_LIBRARY_DIRS}
				 ${LM_LIBRARY_DIRS}
				 ${PNG_LIBRARY_DIRS}
				 ${AALIB_LIBRARY_DIRS})

## Target definitions
add_library(avatar MODULE avatar.c) 

## Compiler setup
include_directories(SYSTEM ${GLIB_INCLUDE_DIRS} 
                    ${GMODULE_INCLUDE_DIRS} 
                    ${LM_INCLUDE_DIRS}
					${PNG_INCLUDE_DIRS}
					${AALIB_INCLUDE_DIRS}
                    ${MCABBER_INCLUDE_DIR})
target_link_libraries(avatar ${GLIB_LIBRARIES}
                      ${GMODULE_LIBRARIES}
					  ${LM_LIBRARIES}
					  ${PNG_LIBRARIES}
					  ${AALIB_LIBRARIES})
include_directories(${avatar_SOURCE_DIR} 
                    ${avatar_BINARY_DIR})

## Installation
install(TARGETS avatar DESTINATION lib/mcabber) 
install(FILES avatar.rc COPYING TODO README DESTINATION share/doc/${CPACK_PACKAGE_NAME})
install(DIRECTORY help DESTINATION share/mcabber)

## Packaging information
set(CPACK_PACKAGE_NAME libmcabber-avatar)
set(CPACK_PACKAGE_VERSION "0.0.1")
set(CPACK_PACKAGE_VENDOR "IsBear")
set(CPACK_PACKAGE_CONTACT "Myhailo Danylenko <isbear@ukrpost.net>")
set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "Mcabber module for PEP avatar events handling")
set(CPACK_RESOURCE_FILE_LICENSE ${avatar_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)

## The End ## vim: se ts=4: ##