-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
49 lines (38 loc) · 1.57 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
cmake_minimum_required(VERSION 3.5.1)
set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake)
include(CMakeDependentOption)
if(POLICY CMP0074)
cmake_policy(SET CMP0074 NEW) # CMake 3.12
endif()
project(ibus-slimt-t8n CXX C)
set(CMAKE_CXX_STANDARD 20)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
include(GetVersionFromFile)
message(STATUS "Project name: ${PROJECT_NAME}")
message(STATUS "Project version: ${PROJECT_VERSION_STRING_FULL}")
set(AUTHOR "Jerin Philip <[email protected]>")
set(AUTHOR_XML_ESCAPED "Jerin Philip <[email protected]>")
set(PROJECT_SHORTNAME "ibus-slimt-t8n")
set(PROJECT_LONGNAME "slimt-t8n")
set(PROJECT_DESCRIPTION
"slimt-t8n provides client-side translation on the local *nix machine.")
set(PROJECT_VERSION ${PROJECT_VERSION_STRING})
set(PROJECT_HOMEPAGE "https://github.com/jerinphilip/ibus-slimt-t8n")
set(PROJECT_LICENSE "GPL")
find_package(yaml-cpp REQUIRED)
find_package(slimt REQUIRED)
find_package(PkgConfig)
pkg_check_modules(GLIB2 REQUIRED glib-2.0)
pkg_check_modules(IBUS REQUIRED ibus-1.0)
if(NOT TARGET yaml-cpp::yaml-cpp)
add_library(yaml-cpp::yaml-cpp ALIAS yaml-cpp)
endif()
set(SLIMT_T8N_PRIVATE_LIBS slimt::slimt-shared yaml-cpp::yaml-cpp
${GLIB2_LIBRARIES} ${IBUS_LIBRARIES})
include(GNUInstallDirs)
add_subdirectory(ibus-slimt-t8n)
install(TARGETS ibus-slimt-t8n RUNTIME DESTINATION ${CMAKE_INSTALL_LIBEXECDIR})
install(FILES ${CMAKE_BINARY_DIR}/slimt-t8n.xml
DESTINATION /usr/share/ibus/component)
install(FILES ${CMAKE_SOURCE_DIR}/assets/bergamot.png
DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/icons)