我可以在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}