开发者

Porting C++ application from Windows to GNU/Linux.

I'm trying to port a computer game from windows to GNU/Linux. It uses Ogre3D,CEGUI, ogreogg and ogrenewt. As far as I know all dependencies work on GNU/Linux and in the game itself there is no ooze-specific code.

Here's the questions part: Is there any easy way to port visual studio 2008 projec开发者_如何学Got to GNU/Linux tool-chain?

How do I manage dependencies? In Visual Studio, I'd just add them in property sheets or default directories. I assume on GNU/Linux autoconf and make take care of that, but in which way? Do I have to add each .cpp and .hppmanually or is there some way to automate things? How do I solve the problem of dependencies on different locations on different systems? I'd like to use Eclipse as my IDE under GNU/Linux.


As @pmr has noted, you are really looking for a build system. While the GNU Autotools (Automake, Autoconf, etc.) have traditionally been used, there are a lot of problems with these tools, and they have an incredibly steep learning curve. I would strongly suggest, instead, that you use CMake. CMake is somewhat of a meta build system in that CMake generates projects for a variety of build systems using the CMake project description; CMake, by default, generates a Makefile project from its project description, but it can also generate projects for Visual Studio, Xcode, KDevelop, and others. You may find the C++ Application Project Template and the C++ Library Project Template useful as examples of how to use the CMake build system. Tutorials and other introductory material about CMake may be found on the CMake Wiki, while the CMake Reference Manual gives detailed instructions for all the various commands that CMake supports (you will probably find ADD_EXECUTABLE, ADD_LIBRARY, TARGET_LINK_LIBRARIES, INCLUDE_DIRECTORIES, and LINK_DIRECTORIES to be the most useful of the commands that are available). Also, while I would strongly advise you to use CMake instead of Make, you may find my Makefile tutorial useful in the event you decide to use Make.


What you are essentially asking is: What is a good build system for GNU/Linux. There is no definitive answer to this problem. Make + autoconf are the standard way of doing things but you could be happier with cmake which has the benefit of being cross-plattform.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜