Skip to content

Commit

Permalink
build(cmake): cmake variable RIME_DATA_DIR set to path to rime data
Browse files Browse the repository at this point in the history
  • Loading branch information
lotem committed Jan 16, 2021
1 parent 8301ee6 commit db72474
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
7 changes: 3 additions & 4 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ option(BOOST_USE_CXX11 "Boost has been built with C++11 support" OFF)
option(BOOST_USE_SIGNALS2 "Boost use signals2 instead of signals" ON)
option(ENABLE_ASAN "Enable Address Sanitizer (Unix Only)" OFF)

set(rime_data_dir "/share/rime-data" CACHE STRING "Target directory for Rime data")
set(RIME_DATA_DIR "${CMAKE_INSTALL_FULL_DATADIR}/rime-data" CACHE STRING "Target directory for Rime data")

if(WIN32)
set(ext ".exe")
Expand Down Expand Up @@ -177,7 +177,7 @@ if(${CMAKE_SYSTEM_NAME} MATCHES "Linux|FreeBSD|DragonFly|GNU")
set(exec_prefix "${CMAKE_INSTALL_PREFIX}")
set(bindir "${CMAKE_INSTALL_FULL_BINDIR}")
set(libdir "${CMAKE_INSTALL_FULL_LIBDIR}")
set(pkgdatadir "${CMAKE_INSTALL_PREFIX}${rime_data_dir}")
set(pkgdatadir "${RIME_DATA_DIR}")
set(includedir "${CMAKE_INSTALL_FULL_INCLUDEDIR}")
configure_file(
${PROJECT_SOURCE_DIR}/rime.pc.in
Expand All @@ -196,8 +196,7 @@ install(FILES ${rime_public_header_files}

if(BUILD_DATA)
file(GLOB rime_preset_data_files ${PROJECT_SOURCE_DIR}/data/preset/*.yaml)
install(FILES ${rime_preset_data_files}
DESTINATION ${CMAKE_INSTALL_PREFIX}${rime_data_dir})
install(FILES ${rime_preset_data_files} DESTINATION ${RIME_DATA_DIR})
endif()

if(BUILD_SHARED_LIBS)
Expand Down
1 change: 1 addition & 0 deletions rime.pc.in
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ prefix=@prefix@
exec_prefix=@exec_prefix@
libdir=@libdir@
includedir=@includedir@
pkgdatadir=@pkgdatadir@

Name: Rime
Description: Rime Input Method Engine
Expand Down

0 comments on commit db72474

Please sign in to comment.