get_filename_component(relative_file_name"srs_tree"REALPATH) message("CMAKE_CURRENT_SOURCE_DIR: ${CMAKE_CURRENT_SOURCE_DIR}") message("relative_file_name: ${relative_file_name}") set(base_dir"/test_source/") get_filename_component(relative_file_name"test_tree"REALPATH BASE_DIR${base_dir...
get_filename_component(<FileName><mode>[BASE_DIR][CACHE]) Setsto the absolute path of<FileName>, where<mode>is one of: ABSOLUTE = Full path to file REALPATH = Full path to existing file with symlinks resolved If the provided<FileName>is a relative path, it is evaluated relative to th...
get_filename_component(<VAR> <FileName> [NAME_WE] [EXT] [PATH] [REALPATH] [CACHE]) 其中<VAR> 是存储结果的变量名,<FileName> 是要处理的文件名。后面的选项是可选的,用于指定要提取的文件路径的哪一部分(如名称、扩展名、路径等)。 检查调用get_filename_component...
1. Set <VAR> to a component of <FileName>, where <COMP> is one of: DIRECTORY=DirectorywithoutfilenameNAME=FilenamewithoutdirectoryEXT=Filenamelongestextension(.b.cfromd/a.b.c)NAME_WE=FilenamewithoutdirectoryorlongestextensionABSOLUTE=FullpathtofileREALPATH=FullpathtoexistingfilewithsymlinksresolvedP...
get_filename_component得到一个完整文件名中的特定部分。 get_filename_component(<VAR>FileName PATH|ABSOLUTE|NAME|EXT|NAME_WE|REALPATH [CACHE]) 1. 2. 3. 将变量设置为路径(PATH),文件名(NAME),文件扩展名(EXT),去掉扩展名的文件名(NAME_WE),完整路径(ABSOLUTE),或者所有符号链接被解析出的完整路径(...
} else if (args[2] == "ABSOLUTE" || args[2] == "REALPATH") { // If the path given is relative, evaluate it relative to the // current source directory unless the user passes a different // base directory. std::string baseDir = this->Makefile->GetCurrentSourceDirectory(); ...
Set <VAR> to a component of <FileName>, where <COMP> is one of: DIRECTORY=DirectorywithoutfilenameNAME=FilenamewithoutdirectoryEXT=Filenamelongestextension(.b.cfromd/a.b.c)NAME_WE=FilenamewithoutdirectoryorlongestextensionABSOLUTE=FullpathtofileREALPATH=FullpathtoexistingfilewithsymlinksresolvedPATH=...
NAME_WLE =Filename with neither the directory nor the last extension PATH = Legacy alias for DIRECTORY (use for CMake <=2.8.11) ABSOLUTE = Full path tofileREALPATH = Full path to existingfilewith symlinks resolved BASE_DIR If no base directory is provided, the default base directory will ...
get_filename_component得到一个完整文件名中的特定部分。 get_filename_component(<VAR>FileName PATH|ABSOLUTE|NAME|EXT|NAME_WE|REALPATH [CACHE]) 1. 2. 3. 将变量设置为路径(PATH),文件名(NAME),文件扩展名(EXT),去掉扩展名的文件名(NAME_WE),完整路径(ABSOLUTE),或者所有符号链接被解析出的完整路径(...