Skip to content

Commit

Permalink
fix(CMakeLists.txt): static build requires boost_locale and icuuc
Browse files Browse the repository at this point in the history
  • Loading branch information
lotem committed Apr 22, 2018
1 parent 3cee9a4 commit 570a27b
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 8 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 1,5 @@
build
build-static
data
lib
package
Expand Down
7 changes: 6 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 32,14 @@ add_definitions(-DRIME_DATA_DIR="${RIME_DATA_DIR}")
set(RIME_DEPS "dl")

if(BUILD_STATIC)
find_package(ICU REQUIRED uc)
if(ICU_FOUND)
set(RIME_DEPS ${RIME_DEPS} ${ICU_LIBRARIES})
endif()

link_directories(${PROJECT_SOURCE_DIR}/lib)
set(RIME_DEPS ${RIME_DEPS} m stdc pthread
libboost_filesystem.a libboost_regex.a libboost_signals.a libboost_system.a libboost_thread.a
libboost_filesystem.a libboost_locale.a libboost_regex.a libboost_signals.a libboost_system.a libboost_thread.a
libglog.a libleveldb.a libmarisa.a libopencc.a libyaml-cpp.a)
endif(BUILD_STATIC)

Expand Down
16 changes: 10 additions & 6 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,23 4,27 @@ endif
sharedir = $(DESTDIR)$(PREFIX)/share
libexecdir = $(DESTDIR)$(PREFIX)/lib

ifeq (${builddir},)
builddir=build
endif

all: ibus-engine-rime

ibus-engine-rime:
mkdir -p build
(cd build; cmake -DCMAKE_BUILD_TYPE=Release .. && make)
mkdir -p $(builddir)
(cd $(builddir); cmake -DCMAKE_BUILD_TYPE=Release .. && make)
@echo ':)'

ibus-engine-rime-static:
mkdir -p build
(cd build; cmake -DCMAKE_BUILD_TYPE=Release -DBUILD_STATIC=ON .. && make)
mkdir -p $(builddir)
(cd $(builddir); cmake -DCMAKE_BUILD_TYPE=Release -DBUILD_STATIC=ON .. && make)
@echo ':)'

install:
install -m 755 -d $(sharedir)/ibus/component
install -m 644 -t $(sharedir)/ibus/component/ rime.xml
install -m 755 -d $(libexecdir)/ibus-rime
install -m 755 -t $(libexecdir)/ibus-rime/ build/ibus-engine-rime
install -m 755 -t $(libexecdir)/ibus-rime/ $(builddir)/ibus-engine-rime
install -m 755 -d $(sharedir)/ibus-rime
install -m 755 -d $(sharedir)/ibus-rime/icons
install -m 644 -t $(sharedir)/ibus-rime/icons/ icons/*.png
Expand All @@ -31,4 35,4 @@ uninstall:
rm -R $(libexecdir)/ibus-rime

clean:
if [ -e build ]; then rm -R build; fi
if [ -e $(builddir) ]; then rm -R $(builddir); fi
6 changes: 5 additions & 1 deletion install-static.sh
Original file line number Diff line number Diff line change
@@ -1,13 1,17 @@
#!/bin/bash

git submodule update --init

if [ ! -e lib ]; then ln -s librime/thirdparty/lib; fi
(cd librime; make thirdparty) || exit 1

(cd librime; make librime-static && sudo make -C build-static install) || exit 1

(cd plum; make && sudo make install) || exit 1

make clean && make ibus-engine-rime-static && sudo make install || exit 1
make builddir=build-static clean && \
make builddir=build-static ibus-engine-rime-static && \
sudo make builddir=build-static install || exit 1

if [ "$1" == '--restart' ]; then
ibus-daemon -drx
Expand Down
2 changes: 2 additions & 0 deletions install.sh
Original file line number Diff line number Diff line change
@@ -1,5 1,7 @@
#!/bin/bash

git submodule update --init

(cd librime; make && sudo make install) || exit 1
(cd plum; make && sudo make install) || exit 1

Expand Down

0 comments on commit 570a27b

Please sign in to comment.