CMakeLists.txt
author Mikael Berthe <mikael@lilotux.net>
Sun, 27 Mar 2011 20:12:37 +0200
changeset 11 431de0cc8126
parent 2 88890ebee9e3
child 12 b88ea7f650f1
permissions -rw-r--r--
Sync with dev API
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
0
3f69962cbbf4 Initial commit
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
     1
## Copyright 2009 Myhailo Danylenko
3f69962cbbf4 Initial commit
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
     2
# This file is part of mcabber module writing howto examples.
3f69962cbbf4 Initial commit
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
     3
#
3f69962cbbf4 Initial commit
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
     4
# Examples are free software: you can redistribute it and/or modify
3f69962cbbf4 Initial commit
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
     5
# it under the terms of the GNU General Public License as published by
3f69962cbbf4 Initial commit
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
     6
# the Free Software Foundation, either version 2 of the License, or
3f69962cbbf4 Initial commit
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
     7
# (at your option) any later version.
3f69962cbbf4 Initial commit
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
     8
#
3f69962cbbf4 Initial commit
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
     9
# This program is distributed in the hope that it will be useful,
3f69962cbbf4 Initial commit
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
    10
# but WITHOUT ANY WARRANTY; without even the implied warranty of
3f69962cbbf4 Initial commit
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
    11
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
3f69962cbbf4 Initial commit
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
    12
# GNU General Public License for more details.
3f69962cbbf4 Initial commit
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
    13
#
3f69962cbbf4 Initial commit
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
    14
# You should have received a copy of the GNU General Public License
3f69962cbbf4 Initial commit
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
    15
# along with this program.  If not, see <http://www.gnu.org/licenses/>.
3f69962cbbf4 Initial commit
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
    16
3f69962cbbf4 Initial commit
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
    17
cmake_minimum_required(VERSION 2.6) 
3f69962cbbf4 Initial commit
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
    18
project(uptime C) 
3f69962cbbf4 Initial commit
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
    19
set(PROJECT_VERSION "0.0.1")
3f69962cbbf4 Initial commit
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
    20
3f69962cbbf4 Initial commit
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
    21
## User settable options
3f69962cbbf4 Initial commit
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
    22
 
3f69962cbbf4 Initial commit
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
    23
## Check for build dependencies
3f69962cbbf4 Initial commit
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
    24
find_package(PkgConfig REQUIRED) 
3f69962cbbf4 Initial commit
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
    25
pkg_check_modules(GLIB REQUIRED glib-2.0) 
3f69962cbbf4 Initial commit
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
    26
pkg_check_modules(MCABBER REQUIRED mcabber)
3f69962cbbf4 Initial commit
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
    27
link_directories(${GLIB_LIBRARY_DIRS}
3f69962cbbf4 Initial commit
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
    28
				 ${MCABBER_LIBRARY_DIRS})
3f69962cbbf4 Initial commit
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
    29
3f69962cbbf4 Initial commit
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
    30
## Target definitions
3f69962cbbf4 Initial commit
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
    31
add_library(uptime MODULE uptime.c) 
3f69962cbbf4 Initial commit
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
    32
3f69962cbbf4 Initial commit
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
    33
## Compiler setup
3f69962cbbf4 Initial commit
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
    34
configure_file(config.h.in config.h)
3f69962cbbf4 Initial commit
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
    35
include_directories(SYSTEM ${GLIB_INCLUDE_DIRS} 
3f69962cbbf4 Initial commit
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
    36
                    ${MCABBER_INCLUDE_DIRS})
3f69962cbbf4 Initial commit
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
    37
target_link_libraries(uptime ${GLIB_LIBRARIES} 
3f69962cbbf4 Initial commit
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
    38
					  ${MCABBER_LIBRARIES})
3f69962cbbf4 Initial commit
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
    39
include_directories(${uptime_SOURCE_DIR} 
3f69962cbbf4 Initial commit
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
    40
                    ${uptime_BINARY_DIR})
3f69962cbbf4 Initial commit
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
    41
set_target_properties(uptime PROPERTIES COMPILE_FLAGS "-Wall")
3f69962cbbf4 Initial commit
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
    42
3f69962cbbf4 Initial commit
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
    43
## Packaging information
3f69962cbbf4 Initial commit
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
    44
set(CPACK_PACKAGE_NAME libmcabber-uptime)
3f69962cbbf4 Initial commit
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
    45
set(CPACK_PACKAGE_VERSION ${PROJECT_VERSION})
3f69962cbbf4 Initial commit
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
    46
set(CPACK_PACKAGE_VENDOR "IsBear")
3f69962cbbf4 Initial commit
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
    47
set(CPACK_PACKAGE_CONTACT "Myhailo Danylenko <isbear@ukrpost.net>")
2
88890ebee9e3 Update package description
Myhailo Danylenko <isbear@ukrpost.net>
parents: 0
diff changeset
    48
set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "Mcabber module to show program uptime")
0
3f69962cbbf4 Initial commit
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
    49
set(CPACK_RESOURCE_FILE_LICENSE ${uptime_SOURCE_DIR}/COPYING)
3f69962cbbf4 Initial commit
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
    50
set(CPACK_SOURCE_GENERATOR TBZ2)
3f69962cbbf4 Initial commit
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
    51
set(CPACK_GENERATOR DEB CACHE TEXT "Binary package generator, eg DEB, RPM, TGZ, NSIS...")
3f69962cbbf4 Initial commit
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
    52
set(CPACK_DEBIAN_PACKAGE_SECTION libs)
3f69962cbbf4 Initial commit
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
    53
find_program(DPKG_EXECUTABLE dpkg)
3f69962cbbf4 Initial commit
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
    54
if(DPKG_EXECUTABLE)
3f69962cbbf4 Initial commit
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
    55
	execute_process(COMMAND ${DPKG_EXECUTABLE} --print-architecture OUTPUT_VARIABLE CPACK_DEBIAN_PACKAGE_ARCHITECTURE OUTPUT_STRIP_TRAILING_WHITESPACE)
3f69962cbbf4 Initial commit
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
    56
else()
3f69962cbbf4 Initial commit
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
    57
	set(CPACK_DEBIAN_PACKAGE_ARCHITECTURE i386 CACHE TEXT "Architecture of package")
3f69962cbbf4 Initial commit
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
    58
endif()
3f69962cbbf4 Initial commit
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
    59
set(CPACK_PACKAGE_FILE_NAME "${CPACK_PACKAGE_NAME}_${CPACK_PACKAGE_VERSION}_${CPACK_DEBIAN_PACKAGE_ARCHITECTURE}")
3f69962cbbf4 Initial commit
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
    60
set(CPACK_SOURCE_IGNORE_FILES "/\\\\..*;\\\\.swp;~$;/build/;\\\\.tar\\\\.;\\\\.deb;\\\\.so")
3f69962cbbf4 Initial commit
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
    61
include(CPack)
3f69962cbbf4 Initial commit
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
    62
3f69962cbbf4 Initial commit
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
    63
## Installation
3f69962cbbf4 Initial commit
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
    64
install(TARGETS uptime DESTINATION lib/mcabber) 
3f69962cbbf4 Initial commit
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
    65
install(FILES uptime.rc COPYING README DESTINATION share/doc/${CPACK_PACKAGE_NAME})
3f69962cbbf4 Initial commit
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
    66
install(DIRECTORY help DESTINATION share/mcabber)
3f69962cbbf4 Initial commit
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
    67
3f69962cbbf4 Initial commit
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
    68
## The End ## vim: se ts=4: ##