我可以在Linux上的cmake中获取系统主目录吗 [英] Can I get the system home directory in cmake on linux
本文介绍了我可以在Linux上的cmake中获取系统主目录吗的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
在cmake中是否有一个与Linux系统的home_dir(例如/ home / user)有关的变量。或其他简单的获取方式
Is there a variable related to the home_dir(like /home/user) of linux system in cmake. Or some other easy ways to get it
推荐答案
主目录由 HOME $引用c $ c>环境变量,因此您可以通过以下方式在CMake脚本中访问它:
Home directory is referred to by the HOME
environment variable, so you can access it in CMake script by:
$ENV{HOME}
这篇关于我可以在Linux上的cmake中获取系统主目录吗的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文