English 中文(简体)
将数据文档添加到按厘米生成的项目
原标题:Adding data files to cmake-generated projects

我有一个项目,即源档案存放在源头/和数据/中的一些分文件(这些档案不是汇编的,而是装在编码中)。 我同这些档案一样,在我的CMake生成的VS2010项目档案中显示,因此我可以安抚这些档案。 这样做有什么好办法? 理想的情况是,它们属于一个单独的项目,但任何行之有效的项目都是好的。

感谢!

最佳回答

I can t comment (reputation too low) but is this what you want ? http://www.cmake.org/pipermail/cmake/2006-May/009291.html

EDIT:如果上述链接在一段时间内停止工作,则设想在视力演播室上添加档案,如普通来源档案。 由于民主选举学会没有与之相关的汇编工具,因此将忽视。 讨论清单:

You could add arbitrary files to a target - as long as VS has no "automatic" rule to compile them (e.g. .cc, .cpp etc) I am adding .html files to libraries/executable or using a dummy target e.g:

ADD_EXECUTABLE(dummy dummy.cpp "${CMAKE_CURRENT_BINARY_DIR}/Doc/index.html")

总干事 指挥也是有益的。

并且

I think you have to take care that they are added only to VS IDE generator builds, in particular NOT to makefiles.

因此,我们正在使用这样的东西:

IF    (CMAKE_BUILD_TOOL MATCHES "(msdev|devenv)")
  ADD_EXECUTABLE( hello ${SOURCES} ${HEADER} ${DOC})
ELSE  (CMAKE_BUILD_TOOL MATCHES "(msdev|devenv)")
  ADD_EXECUTABLE( hello ${SOURCES} )
ENDIF (CMAKE_BUILD_TOOL MATCHES "(msdev|devenv)")

Credit to Jan Woetzel

问题回答

暂无回答




相关问题
Best practices for Subversion and Visual Studio projects

I ve recently started working on various C# projects in Visual Studio as part of a plan for a large scale system that will be used to replace our current system that s built from a cobbling-together ...

Enable PHP highlights in VS 2010?

I ve heard that Visual Studio 2010 Beta 2 has support for PHP. When I load a PHP file though, it has nothing highlighted and is nothing more than a glorified text editor. Is there a way to enable it?...

Do I want Publish or Release Build in VB.net?

I wrote a little (like 40 lines little) Winforms application with VB.net in Visual Studio 2010. Now I ve released the code as a Google Code project. It s easy for a developer to get the source but I d ...

Unit Testing .NET 3.5 projects using MStest in VS2010

There s a bug/feature in Visual Studio 2010 where you can t create a unit test project with the 2.0 CLR. https://connect.microsoft.com/VisualStudio/feedback/ViewFeedback.aspx?FeedbackID=483891&wa=...

热门标签