-
Notifications
You must be signed in to change notification settings - Fork 4
/
CMakeLists.txt
75 lines (61 loc) · 2.16 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
cmake_minimum_required(VERSION 3.7)
project(libime-jyutping VERSION 1.0.12)
find_package(ECM 1.0 REQUIRED)
set(CMAKE_MODULE_PATH ${ECM_MODULE_PATH} "${CMAKE_CURRENT_SOURCE_DIR}/cmake" ${CMAKE_MODULE_PATH})
#########################################
# Options
#########################################
option(ENABLE_ENGINE "Enable input method for fcitx" On)
option(ENABLE_TEST "Build Test" On)
option(ENABLE_DOC "Build doxygen" Off)
#########################################
# Dependency
#########################################
include(GNUInstallDirs)
include(FeatureSummary)
include(GenerateExportHeader)
include(CMakePackageConfigHelpers)
include(ECMSetupVersion)
include(ECMGenerateHeaders)
include(ECMGeneratePkgConfigFile)
include(ECMUninstallTarget)
find_package(PkgConfig REQUIRED)
pkg_check_modules(ZSTD REQUIRED IMPORTED_TARGET "libzstd")
find_package(Fcitx5Utils REQUIRED)
find_package(fmt REQUIRED)
if (TARGET fmt::fmt-header-only)
set(FMT_TARGET fmt::fmt-header-only)
else()
set(FMT_TARGET fmt::fmt)
endif ()
include("${FCITX_INSTALL_CMAKECONFIG_DIR}/Fcitx5Utils/Fcitx5CompilerSettings.cmake")
find_package(Boost 1.61 REQUIRED COMPONENTS iostreams)
set(LIBIME_JYUTPING_INSTALL_PKGDATADIR "${CMAKE_INSTALL_FULL_DATADIR}/libime")
set(LIBIME_JYUTPING_INSTALL_LIBDATADIR "${CMAKE_INSTALL_FULL_LIBDIR}/libime")
find_package(LibIMECore 1.0.16 REQUIRED)
if(ENABLE_ENGINE)
find_package(Gettext REQUIRED)
find_package(Fcitx5Module REQUIRED Spell Punctuation QuickPhrase)
add_subdirectory(po)
endif()
if(ENABLE_TEST)
enable_testing()
add_subdirectory(test)
endif()
add_subdirectory(src)
add_subdirectory(tools)
add_subdirectory(data)
if (ENABLE_DOC)
find_package(Doxygen REQUIRED)
file(READ "${CMAKE_CURRENT_SOURCE_DIR}/.codedocs" FCITX_DOXYGEN_CONFIGURATION)
configure_file(
${CMAKE_CURRENT_SOURCE_DIR}/Doxyfile.in
${CMAKE_CURRENT_BINARY_DIR}/Doxyfile
@ONLY)
add_custom_target(doc
COMMAND ${DOXYGEN_EXECUTABLE} ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
COMMENT "Generating API documentation with Doxygen"
VERBATIM)
endif()
feature_summary(WHAT ALL FATAL_ON_MISSING_REQUIRED_PACKAGES)