Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow to specify supported languages in an environment variable during build #20

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,10 @@ Installing iBus engine:

```shell
git clone https://github.com/varnamproject/libvarnam-ibus.git && cd libvarnam-ibus
cmake . && make && sudo make install
cmake . -DVARNAM_LANGUAGES="ml;ml-inscript;hi" && make && sudo make install
ibus restart
```
where the variable `VARNAM_LANGUAGES` is a semicolon-separated list of languages varnam was compiled with.

Usage
-----
Expand Down
52 changes: 46 additions & 6 deletions engine/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,53 @@ list (APPEND varnam_engine_sources
main.c
)

# Format of the below list should be
# Format of the list of component languages should be
# iBusLangCode,varnamLangCode,engineName,description
list (APPEND component_xml_files
"ml,ml,Varnam,Varnam input method"
"ml,ml-inscript,Varnam Inscript,Varnam input method for inscript"
"hi,hi,Varnam,Varnam input method"
)

foreach(varnam_languages ${VARNAM_LANGUAGES})
if(varnam_languages STREQUAL "as")
list (APPEND component_xml_files "as,as,Varnam,Varnam input method")
endif(varnam_languages STREQUAL "as")
if(varnam_languages STREQUAL "bn")
list (APPEND component_xml_files "bn,bn,Varnam,Varnam input method")
endif(varnam_languages STREQUAL "bn")
if(varnam_languages STREQUAL "gu")
list (APPEND component_xml_files "gu,gu,Varnam,Varnam input method")
endif(varnam_languages STREQUAL "gu")
if(varnam_languages STREQUAL "hi")
list (APPEND component_xml_files "hi,hi,Varnam,Varnam input method")
endif(varnam_languages STREQUAL "hi")
if(varnam_languages STREQUAL "kn")
list (APPEND component_xml_files "kn,kn,Varnam,Varnam input method")
endif(varnam_languages STREQUAL "kn")
if(varnam_languages STREQUAL "ml")
list (APPEND component_xml_files "ml,ml,Varnam,Varnam input method")
endif(varnam_languages STREQUAL "ml")
if(varnam_languages STREQUAL "ml-inscript")
list (APPEND component_xml_files "ml,ml-inscript,Varnam,Varnam input method for inscript")
endif(varnam_languages STREQUAL "ml-inscript")
if(varnam_languages STREQUAL "mr")
list (APPEND component_xml_files "mr,mr,Varnam,Varnam input method")
endif(varnam_languages STREQUAL "mr")
if(varnam_languages STREQUAL "ne")
list (APPEND component_xml_files "ne,ne,Varnam,Varnam input method")
endif(varnam_languages STREQUAL "ne")
if(varnam_languages STREQUAL "or")
list (APPEND component_xml_files "or,or,Varnam,Varnam input method")
endif(varnam_languages STREQUAL "or")
if(varnam_languages STREQUAL "pa")
list (APPEND component_xml_files "pa,pa,Varnam,Varnam input method")
endif(varnam_languages STREQUAL "pa")
if(varnam_languages STREQUAL "sa")
list (APPEND component_xml_files "sa,sa,Varnam,Varnam input method")
endif(varnam_languages STREQUAL "sa")
if(varnam_languages STREQUAL "ta")
list (APPEND component_xml_files "ta,ta,Varnam,Varnam input method")
endif(varnam_languages STREQUAL "ta")
if(varnam_languages STREQUAL "te")
list (APPEND component_xml_files "te,te,Varnam,Varnam input method")
endif(varnam_languages STREQUAL "te")
endforeach(varnam_languages)

foreach(componentXmlFile ${component_xml_files})
# replaces , with ;. CMake uses ; for list
Expand Down