File: CMakeLists.txt

package info (click to toggle)
fcitx5-lua 5.0.3-1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, sid
  • size: 372 kB
  • sloc: cpp: 1,164; sh: 21; makefile: 4
file content (49 lines) | stat: -rw-r--r-- 1,739 bytes parent folder | download
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.10)
project(fcitx5-lua VERSION 5.0.3)

find_package(ECM REQUIRED 1.0.0)
set(CMAKE_MODULE_PATH ${ECM_MODULE_PATH} "${CMAKE_CURRENT_SOURCE_DIR}/cmake" ${CMAKE_MODULE_PATH})

include(FeatureSummary)
include(GNUInstallDirs)
include(ECMSetupVersion)
include(ECMUninstallTarget)

find_package(Lua 5.3 REQUIRED)
find_package(Fcitx5Core REQUIRED)
find_package(Gettext REQUIRED)
find_package(Pthread REQUIRED)
find_package(Fcitx5Module REQUIRED COMPONENTS TestFrontend TestIM QuickPhrase)

option(USE_DLOPEN "Use dlopen to load lua library." On)

include("${FCITX_INSTALL_CMAKECONFIG_DIR}/Fcitx5Utils/Fcitx5CompilerSettings.cmake")
include(Helper)

if (NOT TARGET Lua::_LuaLibrary)
    if (USE_DLOPEN)
        add_library(Lua::_LuaLibrary IMPORTED INTERFACE)
        set_target_properties(Lua::_LuaLibrary PROPERTIES
            INTERFACE_INCLUDE_DIRECTORIES ${LUA_INCLUDE_DIR})
    else()
        add_library(Lua::_LuaLibrary UNKNOWN IMPORTED ${LUA_LIBRARY})
        set_target_properties(Lua::_LuaLibrary PROPERTIES
            INTERFACE_INCLUDE_DIRECTORIES ${LUA_INCLUDE_DIR}
            IMPORTED_LOCATION ${LUA_LIBRARY})
    endif()
endif()

configure_file(config.h.in config.h)
include_directories(${CMAKE_CURRENT_BINARY_DIR})
add_definitions(-DFCITX_GETTEXT_DOMAIN=\"fcitx5-lua\")
fcitx5_add_i18n_definition()

enable_testing()
add_subdirectory(src)
add_subdirectory(test)
add_subdirectory(po)

fcitx5_translate_desktop_file(org.fcitx.Fcitx5.Addon.Lua.metainfo.xml.in
    org.fcitx.Fcitx5.Addon.Lua.metainfo.xml XML)
install(FILES "${CMAKE_CURRENT_BINARY_DIR}/org.fcitx.Fcitx5.Addon.Lua.metainfo.xml" DESTINATION ${CMAKE_INSTALL_DATADIR}/metainfo)
feature_summary(WHAT ALL FATAL_ON_MISSING_REQUIRED_PACKAGES)