【发布时间】:2018-09-08 05:22:57
【问题描述】:
我正在尝试从源代码安装很棒的 wm。所以我创建了一个构建目录并执行了以下命令:
cmake .. -DCMAKE_INSTALL_PREFIX=$PREFIX
但是make install 试图将一些程序文件放在/usr/local/share 中,这不是我想要的:
> make install
[ 3%] Built target generated_sources
[ 6%] Built target test-gravity
[ 9%] Built target lgi-check
[ 9%] Built target version_stamp
[ 29%] Built target generated_icons
[ 31%] Checking for LGI...
Building for Lua 5.3.
Found lgi 0.9.2.
[ 31%] Built target lgi-check-run
[ 35%] Built target generate_awesomerc
[100%] Built target awesome
Install the project...
-- Install configuration: ""
-- Up-to-date: /home/user/.local/bin/awesome
-- Up-to-date: /home/user/.local/bin/awesome-client
-- Installing: /usr/local/share/awesome/lib
CMake Error at cmake_install.cmake:69 (file):
file INSTALL cannot make directory "/usr/local/share/awesome/lib": No such
file or directory
make: *** [Makefile:107: install] Error 1
是否有一些类似于CMAKE_INSTALL_PREFIX 或CMAKE_INSTALL_LIBDIR 的cmake 变量需要为share 数据指定?
【问题讨论】:
-
取决于项目安装文件的方式,需要查看
CMakeLists.txt才能得到解答 -
变量
PREFIX的值是多少? -
@TimothyBrown
PREFIX设置为${HOME}/.local,我想在其中安装程序。 -
我个人会使用
cmake --build build --target install -- DESTDIR=${PREFIX}
标签: build cmake installation gnu-make awesome-wm