forked from emcrisostomo/fswatch
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
71 lines (59 loc) · 2.34 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
#
# Copyright (c) 2014-2022 Enrico M. Crisostomo
#
# This program 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, or (at your option) any later version.
#
# This program 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
# this program. If not, see <http://www.gnu.org/licenses/>.
#
cmake_minimum_required(VERSION 3.8)
project(fswatch VERSION 1.17.1 LANGUAGES C CXX)
#@formatter:off
set(PACKAGE "${PROJECT_NAME}")
set(PACKAGE_NAME "${PACKAGE}")
set(PACKAGE_VERSION "${PROJECT_VERSION}-develop")
set(PACKAGE_STRING "${PACKAGE_NAME} ${PACKAGE_VERSION}")
set(PACKAGE_AUTHOR "enrico.m.crisostomo@gmail.com")
set(PACKAGE_BUGREPORT "${PACKAGE_AUTHOR}")
set(PACKAGE_TARNAME "${PACKAGE}")
set(PACKAGE_URL "https://github.com/emcrisostomo/${PACKAGE}")
set(LOCALEDIR "${CMAKE_INSTALL_PREFIX}/share/locale" CACHE FILEPATH "locale dir")
#@formatter:on
set(CMAKE_CXX_STANDARD 11)
# Add option to choose between shared and static libraries
option(BUILD_SHARED_LIBS "Build shared libraries" OFF)
# include modules
include(FindGettext)
include(FindIntl)
include(CheckIncludeFileCXX)
include(CheckStructHasMember)
include(CheckCXXSymbolExists)
# check for gettext and libintl
check_include_file_cxx(getopt.h HAVE_GETOPT_H)
if (HAVE_GETOPT_H)
check_cxx_symbol_exists(getopt_long getopt.h HAVE_GETOPT_LONG)
endif (HAVE_GETOPT_H)
# If both gettext and libintl are found, define the USE_NLS variable to
# optionally disable them
if (Intl_FOUND AND GETTEXT_FOUND)
option(USE_NLS "Use NLS" ON)
endif ()
if (USE_NLS)
set(ENABLE_NLS 1)
# gettext configuration
set(LINGUAS en en@quot en@boldquot it es)
foreach (language ${LINGUAS})
configure_file(${PROJECT_SOURCE_DIR}/po/${language}.po ${PROJECT_BINARY_DIR}/${language}.po COPYONLY)
endforeach ()
gettext_process_pot_file(po/${PACKAGE}.pot ALL INSTALL_DESTINATION share/locale LANGUAGES ${LINGUAS})
endif ()
add_subdirectory(libfswatch)
add_subdirectory(fswatch/src)
add_subdirectory(test/src)