在配OpenNI2的时候, 导出变量到~/.bashrc后, 发现cmake和cmake-gui读出的变量不一致,
仔细一看cmake读的变量是从~/.bashrc文件里面的读的
cmake-gui是从~/.profile文件里面读的
可以在cmake文件里面加入
execute_process(
COMMAND ${CMAKE_COMMAND} -E environment
)
看细节
注意source命令对.profile文件不起作用, 得log out才行.
(
After changing the .profile file, you have to logout from your account and login, then it will be sourced once automatically.
Also make sure these file does not exist in your home directory:
~/.bash_profile
~/.bash_login
If you’ve got these files, the .profile will be ignored.
)

在配置OpenNI2时,导出变量到~/.bashrc后,发现cmake和cmake-gui读出的变量不一致,cmake从~/.bashrc读,cmake-gui从~/.profile读。可在cmake文件里添加相关内容,注意source命令对.profile文件无效,需log out,且要确保~/.bash_profile等文件不存在,否则.profile会被忽略。
1525

被折叠的 条评论
为什么被折叠?



