Eclipse CDT - 将静态资源文件复制到bin_dir [英] Eclipse CDT - Copy static resource file to bin_dir
问题描述
所以我的问题:
我在Eclipse 3.5上的CDT 6.0中有一个C ++项目,现在我有一个静态资源文件(一个用于log4cxx的.properties)需要被复制到build文件夹。运行时访问该文件以配置log4cxx子系统,并且需要在与可执行文件相同的目录中可用。例如,Debug /文件夹中应该有Debug / Executable和Debug / config.properties。
So my problem: I have a C++ project in CDT 6.0 on Eclipse 3.5, and I now have a static resource file (a .properties for log4cxx) that needs to be copied to the build folder. This file is accessed at runtime to configure the log4cxx subsystem, and it needs to be available in the same directory as the executable. For example, the Debug/ folder should have Debug/Executable and Debug/config.properties in it.
我想要的是,CDT会在构建时自动将文件从我的src(或资源)目录复制到bin目录。有没有办法做这个没有自定义的目标?我正在使用Eclipse管理的make项目(或者现在的C ++可执行文件的默认设置),如果这改变了需要设置的内容。
What I would like is to have CDT automatically copy the file from my src (or a resource) directory to the bin directory at build time. Is there a way to do this without making a custom make target? I'm using an Eclipse managed make project (or whatever the default for C++ executable is nowadays), if that changes how things need to be setup.
推荐答案
好的,所以我发现Eclipse实际上是从根项目文件夹运行可执行文件。我能够在项目下创建一个config目录,并将我的文件放在那里,所以它不再需要将任何属性文件从src复制到可执行目录。
Okay... so I figured out that Eclipse was actually running the Executable from the root project folder. I was able to make a config directory under the project and stuff my files in there, so it no longer needs to copy any properties files over from src to the executable directory.
这篇关于Eclipse CDT - 将静态资源文件复制到bin_dir的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!