CMakeLists.txt
author Myhailo Danylenko <isbear@ukrpost.net>
Thu, 30 Jun 2011 16:09:04 +0300
changeset 36 32424a111e97
parent 33 1cc77413e85d
child 40 fbdae6975352
permissions -rw-r--r--
remove api.h, offending 0.10.0
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
0
29423ceb6adf Initial commit
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
     1
## Copyright 2009 Myhailo Danylenko
29423ceb6adf Initial commit
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
     2
# This file is part of mcabber module writing howto examples.
29423ceb6adf Initial commit
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
     3
#
29423ceb6adf Initial commit
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
     4
# Examples are free software: you can redistribute it and/or modify
29423ceb6adf Initial commit
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
     5
# it under the terms of the GNU General Public License as published by
29423ceb6adf Initial commit
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
     6
# the Free Software Foundation, either version 2 of the License, or
29423ceb6adf Initial commit
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
     7
# (at your option) any later version.
29423ceb6adf Initial commit
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
     8
#
29423ceb6adf Initial commit
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
     9
# This program is distributed in the hope that it will be useful,
29423ceb6adf Initial commit
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
    10
# but WITHOUT ANY WARRANTY; without even the implied warranty of
29423ceb6adf Initial commit
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
    11
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
29423ceb6adf Initial commit
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
    12
# GNU General Public License for more details.
29423ceb6adf Initial commit
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
    13
#
29423ceb6adf Initial commit
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
    14
# You should have received a copy of the GNU General Public License
29423ceb6adf Initial commit
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
    15
# along with this program.  If not, see <http://www.gnu.org/licenses/>.
29423ceb6adf Initial commit
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
    16
29423ceb6adf Initial commit
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
    17
cmake_minimum_required(VERSION 2.6) 
29423ceb6adf Initial commit
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
    18
project(avatar C) 
24
7aa499342e2b Use new interface to obtain available screen space
Myhailo Danylenko <isbear@ukrpost.net>
parents: 23
diff changeset
    19
set(PROJECT_VERSION "0.0.1")
0
29423ceb6adf Initial commit
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
    20
13
6ed6279de87f Fix linker library search path
Myhailo Danylenko <isbear@ukrpost.net>
parents: 12
diff changeset
    21
## User settable options
6ed6279de87f Fix linker library search path
Myhailo Danylenko <isbear@ukrpost.net>
parents: 12
diff changeset
    22
 
6ed6279de87f Fix linker library search path
Myhailo Danylenko <isbear@ukrpost.net>
parents: 12
diff changeset
    23
## Check for build dependencies
6ed6279de87f Fix linker library search path
Myhailo Danylenko <isbear@ukrpost.net>
parents: 12
diff changeset
    24
find_package(PkgConfig REQUIRED) 
6ed6279de87f Fix linker library search path
Myhailo Danylenko <isbear@ukrpost.net>
parents: 12
diff changeset
    25
pkg_check_modules(GLIB REQUIRED glib-2.0) 
6ed6279de87f Fix linker library search path
Myhailo Danylenko <isbear@ukrpost.net>
parents: 12
diff changeset
    26
pkg_check_modules(LM REQUIRED loudmouth-1.0)
22
4f45c246856c Remove dependency on libpng version
Myhailo Danylenko <isbear@ukrpost.net>
parents: 21
diff changeset
    27
pkg_check_modules(PNG REQUIRED libpng)
20
df9cedcdb3b2 Use pkg-config to find mcabber headers
Myhailo Danylenko <isbear@ukrpost.net>
parents: 17
diff changeset
    28
pkg_check_modules(MCABBER REQUIRED mcabber)
13
6ed6279de87f Fix linker library search path
Myhailo Danylenko <isbear@ukrpost.net>
parents: 12
diff changeset
    29
set(AALIB_LIBRARY_DIRS "/usr/lib" CACHE FILEPATH "Path, where AAlib is located")
6ed6279de87f Fix linker library search path
Myhailo Danylenko <isbear@ukrpost.net>
parents: 12
diff changeset
    30
set(AALIB_INCLUDE_DIRS "/usr/include" CACHE FILEPATH "Path to AAlib includes")
6ed6279de87f Fix linker library search path
Myhailo Danylenko <isbear@ukrpost.net>
parents: 12
diff changeset
    31
set(AALIB_LIBRARIES "-laa" CACHE TEXT "Libraries, necessary to link with AAlib")
20
df9cedcdb3b2 Use pkg-config to find mcabber headers
Myhailo Danylenko <isbear@ukrpost.net>
parents: 17
diff changeset
    32
include(CheckIncludeFile)
df9cedcdb3b2 Use pkg-config to find mcabber headers
Myhailo Danylenko <isbear@ukrpost.net>
parents: 17
diff changeset
    33
set(CMAKE_REQUIRED_INCLUDES ${MCABBER_INCLUDE_DIRS})
df9cedcdb3b2 Use pkg-config to find mcabber headers
Myhailo Danylenko <isbear@ukrpost.net>
parents: 17
diff changeset
    34
check_include_file(mcabber/pep.h HAVE_MCABBER_PEP_H)
df9cedcdb3b2 Use pkg-config to find mcabber headers
Myhailo Danylenko <isbear@ukrpost.net>
parents: 17
diff changeset
    35
if(NOT HAVE_MCABBER_PEP_H)
df9cedcdb3b2 Use pkg-config to find mcabber headers
Myhailo Danylenko <isbear@ukrpost.net>
parents: 17
diff changeset
    36
	message(SEND_ERROR "Pep module header not found")
14
9a4d0f04c7d3 Check online status
Myhailo Danylenko <isbear@ukrpost.net>
parents: 13
diff changeset
    37
endif()
9a4d0f04c7d3 Check online status
Myhailo Danylenko <isbear@ukrpost.net>
parents: 13
diff changeset
    38
include(CheckSymbolExists)
9a4d0f04c7d3 Check online status
Myhailo Danylenko <isbear@ukrpost.net>
parents: 13
diff changeset
    39
set(CMAKE_REQUIRED_INCLUDES ${LM_INCLUDE_DIRS})
9a4d0f04c7d3 Check online status
Myhailo Danylenko <isbear@ukrpost.net>
parents: 13
diff changeset
    40
set(CMAKE_REQUIRED_LIBRARIES ${LM_LIBRARIES})
9a4d0f04c7d3 Check online status
Myhailo Danylenko <isbear@ukrpost.net>
parents: 13
diff changeset
    41
set(CMAKE_REQUIRED_FLAGS ${LM_LDFLAGS} ${LM_CFLAGS})
9a4d0f04c7d3 Check online status
Myhailo Danylenko <isbear@ukrpost.net>
parents: 13
diff changeset
    42
check_symbol_exists(lm_connection_unregister_reply_handler loudmouth/loudmouth.h HAVE_LM_CONNECTION_UNREGISTER_REPLY_HANDLER)
13
6ed6279de87f Fix linker library search path
Myhailo Danylenko <isbear@ukrpost.net>
parents: 12
diff changeset
    43
link_directories(${GLIB_LIBRARY_DIRS}
6ed6279de87f Fix linker library search path
Myhailo Danylenko <isbear@ukrpost.net>
parents: 12
diff changeset
    44
				 ${LM_LIBRARY_DIRS}
6ed6279de87f Fix linker library search path
Myhailo Danylenko <isbear@ukrpost.net>
parents: 12
diff changeset
    45
				 ${PNG_LIBRARY_DIRS}
20
df9cedcdb3b2 Use pkg-config to find mcabber headers
Myhailo Danylenko <isbear@ukrpost.net>
parents: 17
diff changeset
    46
				 ${AALIB_LIBRARY_DIRS}
df9cedcdb3b2 Use pkg-config to find mcabber headers
Myhailo Danylenko <isbear@ukrpost.net>
parents: 17
diff changeset
    47
				 ${MCABBER_LIBRARY_DIRS})
13
6ed6279de87f Fix linker library search path
Myhailo Danylenko <isbear@ukrpost.net>
parents: 12
diff changeset
    48
0
29423ceb6adf Initial commit
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
    49
## Target definitions
29423ceb6adf Initial commit
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
    50
add_library(avatar MODULE avatar.c) 
29423ceb6adf Initial commit
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
    51
13
6ed6279de87f Fix linker library search path
Myhailo Danylenko <isbear@ukrpost.net>
parents: 12
diff changeset
    52
## Compiler setup
14
9a4d0f04c7d3 Check online status
Myhailo Danylenko <isbear@ukrpost.net>
parents: 13
diff changeset
    53
configure_file(config.h.in config.h)
13
6ed6279de87f Fix linker library search path
Myhailo Danylenko <isbear@ukrpost.net>
parents: 12
diff changeset
    54
include_directories(SYSTEM ${GLIB_INCLUDE_DIRS} 
6ed6279de87f Fix linker library search path
Myhailo Danylenko <isbear@ukrpost.net>
parents: 12
diff changeset
    55
                    ${LM_INCLUDE_DIRS}
6ed6279de87f Fix linker library search path
Myhailo Danylenko <isbear@ukrpost.net>
parents: 12
diff changeset
    56
					${PNG_INCLUDE_DIRS}
6ed6279de87f Fix linker library search path
Myhailo Danylenko <isbear@ukrpost.net>
parents: 12
diff changeset
    57
					${AALIB_INCLUDE_DIRS}
20
df9cedcdb3b2 Use pkg-config to find mcabber headers
Myhailo Danylenko <isbear@ukrpost.net>
parents: 17
diff changeset
    58
                    ${MCABBER_INCLUDE_DIRS})
13
6ed6279de87f Fix linker library search path
Myhailo Danylenko <isbear@ukrpost.net>
parents: 12
diff changeset
    59
target_link_libraries(avatar ${GLIB_LIBRARIES}
6ed6279de87f Fix linker library search path
Myhailo Danylenko <isbear@ukrpost.net>
parents: 12
diff changeset
    60
					  ${LM_LIBRARIES}
6ed6279de87f Fix linker library search path
Myhailo Danylenko <isbear@ukrpost.net>
parents: 12
diff changeset
    61
					  ${PNG_LIBRARIES}
20
df9cedcdb3b2 Use pkg-config to find mcabber headers
Myhailo Danylenko <isbear@ukrpost.net>
parents: 17
diff changeset
    62
					  ${AALIB_LIBRARIES}
df9cedcdb3b2 Use pkg-config to find mcabber headers
Myhailo Danylenko <isbear@ukrpost.net>
parents: 17
diff changeset
    63
					  ${MCABBER_LIBRARIES})
13
6ed6279de87f Fix linker library search path
Myhailo Danylenko <isbear@ukrpost.net>
parents: 12
diff changeset
    64
include_directories(${avatar_SOURCE_DIR} 
6ed6279de87f Fix linker library search path
Myhailo Danylenko <isbear@ukrpost.net>
parents: 12
diff changeset
    65
                    ${avatar_BINARY_DIR})
27
c641ef370d18 Fix signedness warnings
Myhailo Danylenko <isbear@ukrpost.net>
parents: 24
diff changeset
    66
set_target_properties(avatar PROPERTIES COMPILE_FLAGS "-Wall")
13
6ed6279de87f Fix linker library search path
Myhailo Danylenko <isbear@ukrpost.net>
parents: 12
diff changeset
    67
0
29423ceb6adf Initial commit
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
    68
## Packaging information
29423ceb6adf Initial commit
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
    69
set(CPACK_PACKAGE_NAME libmcabber-avatar)
24
7aa499342e2b Use new interface to obtain available screen space
Myhailo Danylenko <isbear@ukrpost.net>
parents: 23
diff changeset
    70
set(CPACK_PACKAGE_VERSION ${PROJECT_VERSION})
0
29423ceb6adf Initial commit
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
    71
set(CPACK_PACKAGE_VENDOR "IsBear")
29423ceb6adf Initial commit
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
    72
set(CPACK_PACKAGE_CONTACT "Myhailo Danylenko <isbear@ukrpost.net>")
11
2f9ffa1c24c5 Change mcabber headers naming scheme
Myhailo Danylenko <isbear@ukrpost.net>
parents: 8
diff changeset
    73
set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "Mcabber module for PEP avatar events handling")
0
29423ceb6adf Initial commit
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
    74
set(CPACK_RESOURCE_FILE_LICENSE ${avatar_SOURCE_DIR}/COPYING)
29423ceb6adf Initial commit
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
    75
set(CPACK_SOURCE_GENERATOR TBZ2)
29423ceb6adf Initial commit
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
    76
set(CPACK_GENERATOR DEB CACHE TEXT "Binary package generator, eg DEB, RPM, TGZ, NSIS...")
29423ceb6adf Initial commit
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
    77
set(CPACK_DEBIAN_PACKAGE_SECTION libs)
29423ceb6adf Initial commit
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
    78
find_program(DPKG_EXECUTABLE dpkg)
29423ceb6adf Initial commit
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
    79
if(DPKG_EXECUTABLE)
29423ceb6adf Initial commit
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
    80
	execute_process(COMMAND ${DPKG_EXECUTABLE} --print-architecture OUTPUT_VARIABLE CPACK_DEBIAN_PACKAGE_ARCHITECTURE OUTPUT_STRIP_TRAILING_WHITESPACE)
29423ceb6adf Initial commit
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
    81
else()
29423ceb6adf Initial commit
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
    82
	set(CPACK_DEBIAN_PACKAGE_ARCHITECTURE i386 CACHE TEXT "Architecture of package")
29423ceb6adf Initial commit
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
    83
endif()
29423ceb6adf Initial commit
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
    84
set(CPACK_PACKAGE_FILE_NAME "${CPACK_PACKAGE_NAME}_${CPACK_PACKAGE_VERSION}_${CPACK_DEBIAN_PACKAGE_ARCHITECTURE}")
29423ceb6adf Initial commit
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
    85
set(CPACK_SOURCE_IGNORE_FILES "/\\\\..*;\\\\.swp;~$;/build/;\\\\.tar\\\\.;\\\\.deb;\\\\.so")
29423ceb6adf Initial commit
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
    86
include(CPack)
29423ceb6adf Initial commit
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
    87
33
1cc77413e85d Add AVV module description
Myhailo Danylenko <isbear@ukrpost.net>
parents: 27
diff changeset
    88
configure_file(avatar.avv.in avatar.avv)
1cc77413e85d Add AVV module description
Myhailo Danylenko <isbear@ukrpost.net>
parents: 27
diff changeset
    89
17
b72f48fb6463 Fix documentation installation path
Myhailo Danylenko <isbear@ukrpost.net>
parents: 14
diff changeset
    90
## Installation
b72f48fb6463 Fix documentation installation path
Myhailo Danylenko <isbear@ukrpost.net>
parents: 14
diff changeset
    91
install(TARGETS avatar DESTINATION lib/mcabber) 
b72f48fb6463 Fix documentation installation path
Myhailo Danylenko <isbear@ukrpost.net>
parents: 14
diff changeset
    92
install(FILES avatar.rc COPYING TODO README DESTINATION share/doc/${CPACK_PACKAGE_NAME})
b72f48fb6463 Fix documentation installation path
Myhailo Danylenko <isbear@ukrpost.net>
parents: 14
diff changeset
    93
install(DIRECTORY help DESTINATION share/mcabber)
33
1cc77413e85d Add AVV module description
Myhailo Danylenko <isbear@ukrpost.net>
parents: 27
diff changeset
    94
install(FILES ${PROJECT_BINARY_DIR}/avatar.avv DESTINATION share/mcabber/avv/modules RENAME avatar)
17
b72f48fb6463 Fix documentation installation path
Myhailo Danylenko <isbear@ukrpost.net>
parents: 14
diff changeset
    95
20
df9cedcdb3b2 Use pkg-config to find mcabber headers
Myhailo Danylenko <isbear@ukrpost.net>
parents: 17
diff changeset
    96
## The End ## vim: se ts=4 sw=4: ##