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