-
Notifications
You must be signed in to change notification settings - Fork 3
/
CMakeLists.txt
94 lines (79 loc) · 2.59 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
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
# This file is part of gpwsafe.
#
# Gpwsafe is 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 3 of the License, or
# (at your option) any later version.
#
# Gpwsafe 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 gpwsafe. If not, see <http://www.gnu.org/licenses/>
cmake_minimum_required(VERSION 3.0)
set(PACKAGE gpwsafe)
set(PACKAGE_VERSION "0.21.5")
project(${PACKAGE})
include(CTest)
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake/Modules")
# FIXME:
#find_package(CXXFeatures)
add_definitions(-std=c++14 -DPACKAGE=\"${PACKAGE}\")
add_definitions(-DVERSION="${PACKAGE_VERSION}")
find_package(PkgConfig REQUIRED)
find_package(LibGcrypt 1.2 REQUIRED)
add_definitions(-DBOOST_DISABLE_THREADS)
find_package(Boost 1.48 REQUIRED COMPONENTS program_options filesystem system)
pkg_check_modules(GTK3 gtk+-3.0)
if(GTK3_FOUND)
set(ENABLE_XCLIP True)
add_definitions(-DENABLE_GTK -DENABLE_XCLIP)
set(GTK_FOUND ${GTK3_FOUND})
set(GTK_INCLUDE_DIRS ${GTK3_INCLUDE_DIRS})
set(GTK_LIBRARY_DIRS ${GTK3_LIBRARY_DIRS})
set(GTK_DEFINITIONS ${GTK3_DEFINITIONS})
set(GTK_LIBRARIES ${GTK3_LIBRARIES})
else(GTK3_FOUND)
set(ENABLE_XCLIP True)
find_package(GTK2 COMPONENTS gtk)
if(GTK2_FOUND)
add_definitions(-DENABLE_GTK -DENABLE_XCLIP)
set(GTK_FOUND ${GTK2_FOUND})
set(GTK_INCLUDE_DIRS ${GTK2_INCLUDE_DIRS})
set(GTK_LIBRARY_DIRS ${GTK2_LIBRARY_DIRS})
set(GTK_DEFINITIONS ${GTK2_DEFINITIONS})
set(GTK_LIBRARIES ${GTK2_LIBRARIES})
endif()
endif(GTK3_FOUND)
find_package(Gettext)
message(STATUS "Found gettext version ${GETTEXT_VERSION_STRING}")
find_program(
ASCIIDOC
NAME a2x
PATHS ENV PATH
DOC "Asciidoc text processor"
)
if(${ASCIIDOC} STREQUAL "ASCIIDOC-NOTFOUND")
message(STATUS "Asciidoc not found. Skipping documentation.")
else()
message(STATUS "Found asciidoc: ${ASCIIDOC}")
add_subdirectory(doc)
endif()
find_program(
EXPECT
NAME expect
PATHS ENV PATH
DOC "Expect for automatic test"
)
if(${EXPECT} STREQUAL "EXPECT-NOTFOUND")
message(ERROR "Expect not found.")
else()
message(STATUS "Found expect: ${EXPECT}")
endif()
execute_process(COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/scripts/detect-clang-dirs.sh
OUTPUT_VARIABLE clang_include_dirs)
add_subdirectory(src)
add_subdirectory(po)
add_subdirectory(test)