forked from nicklan/pnmixer
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
73 lines (55 loc) · 1.9 KB
/
CMakeLists.txt
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
61
62
63
64
65
66
67
68
69
70
71
72
cmake_minimum_required(VERSION 3.0)
project(PNMixer)
## cmake modules
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake/Modules/")
include(FindPkgConfig)
include(GNUInstallDirs)
include(PNMixer_macros)
## version and global project vars
set(PNMixer_VERSION_MAJOR 0)
set(PNMixer_VERSION_MINOR 7)
set(PNMixer_VERSION_MICRO 2)
set(PACKAGE_VERSION "${PNMixer_VERSION_MAJOR}.${PNMixer_VERSION_MINOR}.${PNMixer_VERSION_MICRO}")
set(PACKAGE "pnmixer")
## options
option(WITH_GTK3 "Use Gtk3 as toolkit" ON)
option(WITH_LIBNOTIFY "Enable sending of notifications" ON)
option(ENABLE_NLS "Enable building of translations" ON)
option(BUILD_DOCUMENTATION "Use Doxygen to create the HTML based API documentation" OFF)
# https://github.com/nicklan/pnmixer/issues/178
if (CMAKE_BUILD_TYPE STREQUAL Release)
set(DATA_IN_CWD_default OFF)
else()
set(DATA_IN_CWD_default ON)
endif()
option(DATA_IN_CWD "Whether to also look for data files in the current directory" ${DATA_IN_CWD_default})
## packages required across multiple subdirectories
if(ENABLE_NLS)
# find gettext programs
find_package(Gettext)
FIND_PROGRAM(XGETTEXT_EXECUTABLE xgettext)
IF(XGETTEXT_EXECUTABLE)
MESSAGE(STATUS "Found xgettext: ${XGETTEXT_EXECUTABLE}")
ELSE(XGETTEXT_EXECUTABLE)
MESSAGE(FATAL_ERROR "xgettext not found")
ENDIF(XGETTEXT_EXECUTABLE)
endif(ENABLE_NLS)
## subdirectories
add_subdirectory(data)
if(ENABLE_NLS)
add_subdirectory(po)
endif(ENABLE_NLS)
add_subdirectory(src)
## additional global targets
# indent-code
add_custom_target(indent-code
COMMAND "${CMAKE_SOURCE_DIR}/cmake/scripts/astyle.sh"
WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}")
# indent-xml
add_custom_target(indent-xml
COMMAND "${CMAKE_SOURCE_DIR}/cmake/scripts/xmllint.sh"
WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}")
## install git hook
execute_process(
COMMAND "${CMAKE_SOURCE_DIR}/cmake/scripts/install-git-hook.sh"
WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}")