1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
|
# CMake build script for Libhello
# Copyright (c) 2010 Sergey Basalaev <sbasalaev@gmail.com>
#
# Redistribution and use is allowed according to the terms
# of the New BSD license.
# For details see the accompanying COPYING file.
cmake_minimum_required(VERSION 2.6)
#Project properties
project(
Libhello
C
)
set(Libhello_MAJOR 0)
set(Libhello_MINOR 2)
set(Libhello_PATCH 1)
set(Libhello_VERSION ${Libhello_MAJOR}.${Libhello_MINOR}.${Libhello_PATCH})
#Build targets
add_subdirectory(src build/lib)
add_subdirectory(bindings build)
#Target to fully clean source tree
add_custom_target(
distclean
COMMAND cmake -E remove_directory CMakeFiles
COMMAND cmake -E remove_directory build
COMMAND cmake -E remove -f src/hello.c
COMMAND cmake -E remove -f CMakeCache.txt
COMMAND cmake -E remove -f cmake_install.cmake
COMMAND cmake -E remove -f install_manifest.txt
COMMAND cmake -E remove -f Makefile
)
add_dependencies(distclean clean)
#Target to purge installation
add_custom_target(
uninstall
COMMAND cmake -P cmake_uninstall.cmake
)
#Configuring translations
if(NO_GETTEXT)
message(STATUS "Skipping Gettext translations configuration")
else(NO_GETTEXT)
message(STATUS "Checking for Gettext")
find_package(Gettext QUIET)
if (GETTEXT_FOUND)
message(STATUS "Checking for Gettext -- Gettext found")
message(STATUS "Gettext translations will be built")
add_subdirectory(po build/po)
else(GETTEXT_FOUND)
message(STATUS "Not configuring Gettext translations")
endif(GETTEXT_FOUND)
endif(NO_GETTEXT)
|