-
Notifications
You must be signed in to change notification settings - Fork 71
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
12 changed files
with
880 additions
and
72 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
# - find where dlopen and friends are located. | ||
# DL_FOUND - system has dynamic linking interface available | ||
# DL_INCLUDE_DIR - where dlfcn.h is located. | ||
# DL_LIBRARY - libraries needed to use dlopen | ||
|
||
include(CheckFunctionExists) | ||
include(CheckSymbolExists) | ||
|
||
find_path(DL_INCLUDE_DIR NAMES dlfcn.h) | ||
find_library(DL_LIBRARY NAMES dl) | ||
if(DL_LIBRARY) | ||
set(DL_FOUND TRUE) | ||
else(DL_LIBRARY) | ||
check_function_exists(dlopen DL_FOUND) | ||
# If dlopen can be found without linking in dl then dlopen is part | ||
# of libc, so don't need to link extra libs. | ||
set(DL_LIBRARY "") | ||
endif(DL_LIBRARY) | ||
|
||
if (DL_FOUND) | ||
set(CMAKE_REQUIRED_DEFINITIONS -D_GNU_SOURCE) | ||
set(CMAKE_REQUIRED_LIBRARIES ${DL_LIBRARY}) | ||
set(CMAKE_REQUIRED_INCLUDES ${DL_INCLUDE_DIR}) | ||
check_symbol_exists(dlmopen "dlfcn.h" HAS_DLMOPEN) | ||
unset(CMAKE_REQUIRED_DEFINITIONS) | ||
unset(CMAKE_REQUIRED_LIBRARIES) | ||
unset(CMAKE_REQUIRED_INCLUDES) | ||
endif() | ||
|
||
include(FindPackageHandleStandardArgs) | ||
find_package_handle_standard_args(DL | ||
FOUND_VAR | ||
DL_FOUND | ||
REQUIRED_VARS | ||
DL_INCLUDE_DIR | ||
) | ||
|
||
mark_as_advanced(DL_INCLUDE_DIR DL_LIBRARY) | ||
|
||
if(DL_FOUND AND NOT TARGET DL::DL) | ||
if (DL_LIBRARY) | ||
add_library(DL::DL UNKNOWN IMPORTED) | ||
set_target_properties(DL::DL PROPERTIES | ||
IMPORTED_LOCATION "${DL_LIBRARY}") | ||
else() | ||
add_library(DL::DL INTERFACE IMPORTED ) | ||
endif() | ||
set_target_properties(DL::DL PROPERTIES | ||
INTERFACE_INCLUDE_DIRECTORIES "${DL_INCLUDE_DIR}" | ||
) | ||
endif() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
# Try to find Pthread functionality | ||
# Once done this will define | ||
# | ||
# PTHREAD_FOUND - system has Pthread | ||
# PTHREAD_INCLUDE_DIR - Pthread include directory | ||
# PTHREAD_LIBRARIES - Libraries needed to use Pthread | ||
# | ||
# TODO: This will enable translations only if Gettext functionality is | ||
# present in libc. Must have more robust system for release, where Gettext | ||
# functionality can also reside in standalone Gettext library, or the one | ||
# embedded within kdelibs (cf. gettext.m4 from Gettext source). | ||
# | ||
# Copyright (c) 2006, Chusslove Illich, <caslav.ilic@gmx.net> | ||
# Copyright (c) 2007, Alexander Neundorf, <neundorf@kde.org> | ||
# Copyright (c) 2016, Xuetian Weng <wengxt@gmail.com> | ||
# | ||
# Redistribution and use is allowed according to the terms of the BSD license. | ||
# For details see the accompanying COPYING-CMAKE-SCRIPTS file. | ||
|
||
find_path(PTHREAD_INCLUDE_DIR NAMES pthread.h) | ||
|
||
if(PTHREAD_INCLUDE_DIR) | ||
include(CheckFunctionExists) | ||
check_function_exists(pthread_create PTHREAD_LIBC_HAS_PTHREAD_CREATE) | ||
|
||
if (PTHREAD_LIBC_HAS_PTHREAD_CREATE) | ||
set(PTHREAD_LIBRARIES) | ||
set(PTHREAD_LIB_FOUND TRUE) | ||
else (PTHREAD_LIBC_HAS_PTHREAD_CREATE) | ||
find_library(PTHREAD_LIBRARIES NAMES pthread libpthread ) | ||
if(PTHREAD_LIBRARIES) | ||
set(PTHREAD_LIB_FOUND TRUE) | ||
endif(PTHREAD_LIBRARIES) | ||
endif (PTHREAD_LIBC_HAS_PTHREAD_CREATE) | ||
|
||
endif(PTHREAD_INCLUDE_DIR) | ||
|
||
include(FindPackageHandleStandardArgs) | ||
find_package_handle_standard_args(Pthread | ||
FOUND_VAR | ||
PTHREAD_FOUND | ||
REQUIRED_VARS | ||
PTHREAD_INCLUDE_DIR PTHREAD_LIB_FOUND | ||
) | ||
|
||
if(PTHREAD_FOUND AND NOT TARGET Pthread::Pthread) | ||
if (PTHREAD_LIBRARIES) | ||
add_library(Pthread::Pthread UNKNOWN IMPORTED) | ||
set_target_properties(Pthread::Pthread PROPERTIES | ||
IMPORTED_LOCATION "${PTHREAD_LIBRARIES}") | ||
else() | ||
add_library(Pthread::Pthread INTERFACE IMPORTED ) | ||
endif() | ||
set_target_properties(Pthread::Pthread PROPERTIES | ||
INTERFACE_INCLUDE_DIRECTORIES "${PTHREAD_INCLUDE_DIR}" | ||
) | ||
endif() | ||
|
||
mark_as_advanced(PTHREAD_INCLUDE_DIR PTHREAD_LIBRARIES PTHREAD_LIBC_HAS_PTHREAD_CREATE PTHREAD_LIB_FOUND) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
## Install things | ||
install(FILES ${CMAKE_SOURCE_DIR}/data/32.png | ||
DESTINATION ${PROJECT_DATADIR}/icons | ||
RENAME OpenBangla-Keyboard.png) | ||
|
||
install(FILES ${CMAKE_SOURCE_DIR}/data/1024.png | ||
DESTINATION ${DATADIR}/pixmaps/ | ||
RENAME openbangla-keyboard.png) | ||
|
||
install(FILES ${CMAKE_SOURCE_DIR}/data/16.png | ||
DESTINATION ${DATADIR}/icons/hicolor/16x16/apps/ | ||
RENAME openbangla-keyboard.png) | ||
|
||
install(FILES ${CMAKE_SOURCE_DIR}/data/32.png | ||
DESTINATION ${DATADIR}/icons/hicolor/32x32/apps/ | ||
RENAME openbangla-keyboard.png) | ||
|
||
install(FILES ${CMAKE_SOURCE_DIR}/data/48.png | ||
DESTINATION ${DATADIR}/icons/hicolor/48x48/apps/ | ||
RENAME openbangla-keyboard.png) | ||
|
||
install(FILES ${CMAKE_SOURCE_DIR}/data/128.png | ||
DESTINATION ${DATADIR}/icons/hicolor/128x128/apps/ | ||
RENAME openbangla-keyboard.png) | ||
|
||
install(FILES ${CMAKE_SOURCE_DIR}/data/512.png | ||
DESTINATION ${DATADIR}/icons/hicolor/512x512/apps/ | ||
RENAME openbangla-keyboard.png) | ||
|
||
install(FILES ${CMAKE_SOURCE_DIR}/data/1024.png | ||
DESTINATION ${DATADIR}/icons/hicolor/1024x1024/apps/ | ||
RENAME openbangla-keyboard.png) | ||
|
||
install(FILES ${CMAKE_SOURCE_DIR}/data/avrophonetic.json | ||
DESTINATION ${PROJECT_DATADIR}/layouts) | ||
|
||
install(FILES ${CMAKE_SOURCE_DIR}/data/Borno.json | ||
DESTINATION ${PROJECT_DATADIR}/layouts) | ||
|
||
install(FILES ${CMAKE_SOURCE_DIR}/data/Avro_Easy.json | ||
DESTINATION ${PROJECT_DATADIR}/layouts) | ||
|
||
install(FILES ${CMAKE_SOURCE_DIR}/data/Munir_Optima.json | ||
DESTINATION ${PROJECT_DATADIR}/layouts) | ||
|
||
install(FILES ${CMAKE_SOURCE_DIR}/data/National_Jatiya.json | ||
DESTINATION ${PROJECT_DATADIR}/layouts) | ||
|
||
install(FILES ${CMAKE_SOURCE_DIR}/data/Probhat.json | ||
DESTINATION ${PROJECT_DATADIR}/layouts) | ||
|
||
install(FILES ${CMAKE_SOURCE_DIR}/data/autocorrect.json | ||
DESTINATION ${PROJECT_DATADIR}/data) | ||
|
||
install(FILES ${CMAKE_SOURCE_DIR}/data/dictionary.json | ||
DESTINATION ${PROJECT_DATADIR}/data) | ||
|
||
install(FILES ${CMAKE_SOURCE_DIR}/data/suffix.json | ||
DESTINATION ${PROJECT_DATADIR}/data) | ||
|
||
install(FILES ${CMAKE_SOURCE_DIR}/data/regex.json | ||
DESTINATION ${PROJECT_DATADIR}/data) | ||
|
||
install(FILES ${CMAKE_BINARY_DIR}/data/openbangla-keyboard.desktop | ||
DESTINATION "${DATADIR}/applications") | ||
|
||
install(FILES ${CMAKE_SOURCE_DIR}/data/io.github.openbangla.keyboard.metainfo.xml | ||
DESTINATION ${DATADIR}/metainfo) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
include("${FCITX_INSTALL_CMAKECONFIG_DIR}/Fcitx5Utils/Fcitx5CompilerSettings.cmake") | ||
|
||
find_package(Pthread REQUIRED) | ||
find_package(DL REQUIRED) | ||
|
||
add_library(openbangla MODULE openbangla.cpp) | ||
target_link_libraries(openbangla Fcitx5::Core riti Pthread::Pthread DL::DL) | ||
target_include_directories(openbangla PRIVATE ../riti/include) | ||
set_target_properties(openbangla PROPERTIES PREFIX "") | ||
install(TARGETS openbangla DESTINATION "${FCITX_INSTALL_LIBDIR}/fcitx5") | ||
install(FILES "${CMAKE_CURRENT_SOURCE_DIR}/openbangla.conf" DESTINATION "${FCITX_INSTALL_PKGDATADIR}/inputmethod") | ||
install(FILES "${CMAKE_CURRENT_SOURCE_DIR}/openbangla-addon.conf" RENAME openbangla.conf DESTINATION "${FCITX_INSTALL_PKGDATADIR}/addon") |
Oops, something went wrong.