Skip to content

Commit be784f6

Browse files
committed
Merge frontend compilation on windows and UI update changes into develop
2 parents 4850869 + a72fb83 commit be784f6

24 files changed

+1227
-620
lines changed

CMakeLists.txt

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,10 @@ add_definitions(-DPROJECT_VERSION="${PROJECT_VERSION}")
1111
## Set Compiler Standard
1212
set(CMAKE_CXX_STANDARD 17)
1313

14-
enable_language(Rust)
15-
include(CMakeCargo)
14+
if(NOT WIN32)
15+
enable_language(Rust)
16+
include(CMakeCargo)
17+
endif()
1618

1719
find_package(Qt5 COMPONENTS Widgets Network REQUIRED)
1820

@@ -85,6 +87,15 @@ if(OS_LINUX)
8587
pkg_check_modules(ZSTD REQUIRED libzstd)
8688
endif()
8789

90+
# For Windows
91+
if(WIN32)
92+
find_package(zstd CONFIG REQUIRED)
93+
set(PROJECT_DATADIR "$ENV{LOCALAPPDATA}\\OpenBangla" CACHE PATH "Path to Data Directory")
94+
set(BIN_DIR "${PROJECT_DATADIR}/bin")
95+
add_definitions(-DPROJECT_DATADIR="${PROJECT_DATADIR}")
96+
add_definitions(-DBIN_DIR="${BIN_DIR}")
97+
endif()
98+
8899
add_subdirectory(src/engine)
89100
add_subdirectory(src/frontend)
90101
add_subdirectory(src/shared)

src/engine/CMakeLists.txt

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
1+
add_subdirectory(common)
2+
13
## Platform depended things
24
if (OS_LINUX)
35
## Platform is Linux
4-
add_subdirectory(common)
56

67
if (ENABLE_IBUS)
78
add_subdirectory(ibus)
@@ -10,7 +11,7 @@ if (OS_LINUX)
1011
if (ENABLE_FCITX)
1112
add_subdirectory(fcitx)
1213
endif()
13-
endif (OS_LINUX)
1414

15-
## Include subdirectories
16-
add_subdirectory(riti)
15+
## Include subdirectories
16+
add_subdirectory(riti)
17+
endif (OS_LINUX)

src/engine/common/CMakeLists.txt

Lines changed: 43 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -1,37 +1,46 @@
1-
configure_file(${CMAKE_SOURCE_DIR}/data/openbangla-keyboard.desktop.in ${CMAKE_BINARY_DIR}/data/openbangla-keyboard.desktop)
2-
3-
## Install things
4-
install(FILES ${CMAKE_SOURCE_DIR}/data/32.png
5-
DESTINATION ${PROJECT_DATADIR}/icons
6-
RENAME OpenBangla-Keyboard.png)
7-
8-
install(FILES ${CMAKE_SOURCE_DIR}/data/1024.png
9-
DESTINATION ${DATADIR}/pixmaps/
10-
RENAME openbangla-keyboard.png)
11-
12-
install(FILES ${CMAKE_SOURCE_DIR}/data/16.png
13-
DESTINATION ${DATADIR}/icons/hicolor/16x16/apps/
14-
RENAME openbangla-keyboard.png)
15-
16-
install(FILES ${CMAKE_SOURCE_DIR}/data/32.png
17-
DESTINATION ${DATADIR}/icons/hicolor/32x32/apps/
18-
RENAME openbangla-keyboard.png)
19-
20-
install(FILES ${CMAKE_SOURCE_DIR}/data/48.png
21-
DESTINATION ${DATADIR}/icons/hicolor/48x48/apps/
22-
RENAME openbangla-keyboard.png)
23-
24-
install(FILES ${CMAKE_SOURCE_DIR}/data/128.png
25-
DESTINATION ${DATADIR}/icons/hicolor/128x128/apps/
26-
RENAME openbangla-keyboard.png)
27-
28-
install(FILES ${CMAKE_SOURCE_DIR}/data/512.png
29-
DESTINATION ${DATADIR}/icons/hicolor/512x512/apps/
30-
RENAME openbangla-keyboard.png)
31-
32-
install(FILES ${CMAKE_SOURCE_DIR}/data/1024.png
33-
DESTINATION ${DATADIR}/icons/hicolor/1024x1024/apps/
34-
RENAME openbangla-keyboard.png)
1+
# This CMake module handles the installation of files
2+
3+
if(OS_LINUX)
4+
configure_file(${CMAKE_SOURCE_DIR}/data/openbangla-keyboard.desktop.in ${CMAKE_BINARY_DIR}/data/openbangla-keyboard.desktop)
5+
6+
install(FILES ${CMAKE_SOURCE_DIR}/data/32.png
7+
DESTINATION ${PROJECT_DATADIR}/icons
8+
RENAME OpenBangla-Keyboard.png)
9+
10+
install(FILES ${CMAKE_SOURCE_DIR}/data/1024.png
11+
DESTINATION ${DATADIR}/pixmaps/
12+
RENAME openbangla-keyboard.png)
13+
14+
install(FILES ${CMAKE_SOURCE_DIR}/data/16.png
15+
DESTINATION ${DATADIR}/icons/hicolor/16x16/apps/
16+
RENAME openbangla-keyboard.png)
17+
18+
install(FILES ${CMAKE_SOURCE_DIR}/data/32.png
19+
DESTINATION ${DATADIR}/icons/hicolor/32x32/apps/
20+
RENAME openbangla-keyboard.png)
21+
22+
install(FILES ${CMAKE_SOURCE_DIR}/data/48.png
23+
DESTINATION ${DATADIR}/icons/hicolor/48x48/apps/
24+
RENAME openbangla-keyboard.png)
25+
26+
install(FILES ${CMAKE_SOURCE_DIR}/data/128.png
27+
DESTINATION ${DATADIR}/icons/hicolor/128x128/apps/
28+
RENAME openbangla-keyboard.png)
29+
30+
install(FILES ${CMAKE_SOURCE_DIR}/data/512.png
31+
DESTINATION ${DATADIR}/icons/hicolor/512x512/apps/
32+
RENAME openbangla-keyboard.png)
33+
34+
install(FILES ${CMAKE_SOURCE_DIR}/data/1024.png
35+
DESTINATION ${DATADIR}/icons/hicolor/1024x1024/apps/
36+
RENAME openbangla-keyboard.png)
37+
38+
install(FILES ${CMAKE_BINARY_DIR}/data/openbangla-keyboard.desktop
39+
DESTINATION "${DATADIR}/applications")
40+
41+
install(FILES ${CMAKE_SOURCE_DIR}/data/io.github.openbangla.keyboard.metainfo.xml
42+
DESTINATION ${DATADIR}/metainfo)
43+
endif()
3544

3645
install(FILES ${CMAKE_SOURCE_DIR}/data/avrophonetic.json
3746
DESTINATION ${PROJECT_DATADIR}/layouts)
@@ -62,10 +71,3 @@ install(FILES ${CMAKE_SOURCE_DIR}/data/suffix.json
6271

6372
install(FILES ${CMAKE_SOURCE_DIR}/data/regex.json
6473
DESTINATION ${PROJECT_DATADIR}/data)
65-
66-
install(FILES ${CMAKE_BINARY_DIR}/data/openbangla-keyboard.desktop
67-
DESTINATION "${DATADIR}/applications")
68-
69-
install(FILES ${CMAKE_SOURCE_DIR}/data/io.github.openbangla.keyboard.metainfo.xml
70-
DESTINATION ${DATADIR}/metainfo)
71-

0 commit comments

Comments
 (0)