cmake and cmake-gui读的环境变量不一致

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

在配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.

)

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值