--- CMakeLists.txt.orig	2020-08-01 01:40:38 UTC
+++ CMakeLists.txt
@@ -200,16 +200,21 @@ endif()
     set(SYSCONFDIR "${CMAKE_INSTALL_PREFIX}/etc" CACHE PATH "sys config directory [default=PREFIX/etc/]")
 endif()
 
-set(includedir "${CMAKE_INSTALL_PREFIX}/include")
-set(libdir ${LIB_INSTALL_DIR})
-set(pkgconfdir ${LIBDATA_INSTALL_DIR}/pkgconfig)
+set(includedir "${PREFIX}/include")
+set(libdir ${PREFIX}/lib)
+set(pkgconfdir ${PREFIX}/libdata/pkgconfig)
 set(mandir ${MAN_INSTALL_DIR})
 set(addondir ${libdir}/${package} )
-set(pkgdatadir ${prefix}/share/${package})
+set(addondestdir "\${PREFIX}/lib/${package}" )
+set(pkgdatadir ${DATADIR})
+set(pkgdatadestdir "\${DATADIR}")
 set(configdescdir ${pkgdatadir}/configdesc)
+set(configdescdestdir ${pkgdatadestdir}/configdesc)
 set(addonconfigdir ${pkgdatadir}/addon)
+set(addonconfigdestdir ${pkgdatadestdir}/addon)
 set(imconfigdir ${pkgdatadir}/inputmethod)
-set(localedir ${CMAKE_INSTALL_PREFIX}/share/locale)
+set(imconfigdestdir ${pkgdatadestdir}/inputmethod)
+set(localedir ${PREFIX}/share/locale)
 
 list(FIND CMAKE_PLATFORM_IMPLICIT_LINK_DIRECTORIES "${LIB_INSTALL_DIR}" _isSystemPlatformLibDir)
 list(FIND CMAKE_CXX_IMPLICIT_LINK_DIRECTORIES "${LIB_INSTALL_DIR}" _isSystemCxxLibDir)
@@ -222,9 +227,13 @@ set(FCITX4_ADDON_INSTALL_DIR ${addondir})
 
 # For FcitxMacro
 set(FCITX4_ADDON_INSTALL_DIR ${addondir})
+set(FCITX4_ADDON_INSTALL_DESTDIR ${addondestdir})
 set(FCITX4_CONFIGDESC_INSTALL_DIR ${configdescdir})
+set(FCITX4_CONFIGDESC_INSTALL_DESTDIR ${configdescdir})
 set(FCITX4_ADDON_CONFIG_INSTALL_DIR ${addonconfigdir})
+set(FCITX4_ADDON_CONFIG_INSTALL_DESTDIR ${addonconfigdir})
 set(FCITX4_INPUTMETHOD_CONFIG_INSTALL_DIR ${imconfigdir})
+set(FCITX4_INPUTMETHOD_CONFIG_INSTALL_DESTDIR ${imconfigdir})
 set(FCITX4_PACKAGE_NAME ${package})
 
 function(_RESOLVE_LIBRARY_PATH _FILE_NAME _LIBRARY_PATH)
