이클립스 등을 사용해서 컴파일할때 Header를 include하기 위해서 경로를 설정한다.

 

프로젝트 Properites -> C/C++ Build -> Settings 에서

GCC C++ Compiler -> Includes를 선택하고

Include paths에서 설저을 해주는데 여러 개발자가 공유하는 프로젝트의 경우 로컬 경로로 설정한다면

 

작업하는 개발자 마다 자신의 컴퓨터 경로로 수정하여야하는데 이때 간편하게 할수있는 방법이다.

 

한가지 예를 들면

 

워크페이스 경로 : /home/build/project

 

${workspace_loc} ->  /home/build/project

${workspace_loc:/include} ->  /home/build/project/include

 

프로젝트 네임 : AAAA

"${workspace_loc:/${ProjName}/src}" -> /home/build/project/AAAA/src

 

더많은 방법과 자세한 설명은 아래 이클립스 사이트에서 퍼온 자료를 보면  알수있을것이다.

 

 

Variable Name

Description

${workspace_loc}The absolute path on the system's hard drive to Eclipse's workspace directory
${workspace_loc:<resource path>}The absolute path on the system's hard drive to the specified resource. The <resource path> is the full path of the resource relative to the workspace root. For example ${workspace_loc:/MyProject/MyFile.txt}. Note that the expanded result of this variable is not the same as ${workspace_loc}/MyProject/MyFile.txt if the project's contents directory for MyProject is outside the workspace directory.
${project_loc}The absolute path on the system's hard drive to the currently selected resource's project or to the project being built if the external tool is run as part of a build.
${project_loc:<resource path>}The absolute path on the system's hard drive to the specified resource's project. The <resource path> is the full path of the resource relative to the workspace root. For example ${workspace_loc:/MyProject/MyFile.txt}. Note that the expanded result of this variable is not the same as ${workspace_loc}/MyProject if the project's contents directory for MyProject is outside the workspace directory.
${container_loc}The absolute path on the system's hard drive to the currently selected resource's parent (either a folder or project).
${container_loc:<resource path>}The absolute path on the system's hard drive to the specified resource's parent (either a folder or project). The <resource path> is the full path of the resource relative to the workspace root. For example:${workspace_loc:/MyProject/MyFolder/MyFile.txt}. Note that the expanded result of this variable is not the same as ${workspace_loc}/MyProject/MyFolder if the project's contents directory for MyProject is outside the workspace directory.
${resource_loc}The absolute path on the system's hard drive to the currently selected resource.
${resource_loc:<resource path>}The absolute path on the system's hard drive to the specified resource. The <resource path> is the full path of the resource relative to the workspace root. For example ${workspace_loc:/MyProject/MyFile.txt}. Note that the expanded result of this variable is not the same as ${workspace_loc}/MyProject/MyFile.txt if the project's contents directory for MyProject is outside the workspace directory.
${project_path}The full path, relative to the workspace root, of the currently selected resource's project or of the project being built if the external tool is run as part of a build.
${container_path}The full path, relative to the workspace root, of the currently selected resource's parent (either a folder or project).
${resource_path}The full path, relative to the workspace root, of the currently selected resource.
${project_name}The name of the currently selected resource's project or of the project being built if the external tool is run as part of a build.
${container_name}The name of the currently selected resource's parent (either a folder or project).
${resource_name}The name of the currently selected resource.
${build_type}The kind of build when the external tool is run as part of a build. The value can be one of "full", "incremental", or "auto". If the external tool is run outside of a build, the value is then "none".

 

Variable Example

Expanded Results

${workspace_loc}c:\eclipse\workspace
${workspace_loc:/MyProject1/MyFile.txt}c:\eclipse\workspace\MyProject\MyFile.txt
${workspace_loc:/MyProject2/MyFile.txt}c:\projects\MyProject2\MyFile.txt
${project_loc}c:\projects\MyProject2
${project_loc:/MyProject1/MyFile.txt}c:\eclipse\workspace\MyProject
${container_loc}c:\projects\MyProject2\MyFolder
${resource_loc}c:\projects\MyProject2\MyFile.txt
${project_path}/MyProject2
${container_path}/MyProject2/MyFolder
${resource_path}/MyProject2/MyFolder/MyFile.txt
${project_name}MyProject2
${container_name}MyFolder
${resource_name}MyFile.txt
${build_type}none


+ Recent posts