views:

63

answers:

2

Hi!

These questions may not be perfectly suited for this site, so I apologize in advance for asking them here.

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 project 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 .hpp manually 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 IDE under GNU/Linux.

I know that the best answer to most of my questions is RTFM, but I'm not sure what I exactly need and where to start looking.

+1  A: 

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.

pmr
AndrejaKo
@AndrejaKo /usr/include is used for header files and /usr/lib for shared libraries. Google finds plenty of tutorials.
pmr
@AndrejaKo, you wouldn't use all of these at once. You either use the Autotools or you use CMake, not both. CMake generates a Makefile, which you then build with Make. As for headers and libraries, it depends on the build system. With Make, you actually have to pass compiler flags to adjust the paths, using "-I" to add header include paths and "-L" to add library include paths. With CMake, you use INCLUDE_DIRECTORIES and LINK_DIRECTORIES to add header and library search paths, respectively.
Michael Aaron Safyan
+1  A: 

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.

Michael Aaron Safyan
While it is a heave hitter: I absolutely recommend the GNU Make manual as a Makefile tutorial: http://www.gnu.org/software/make/manual/make.html
pmr
@pmr, the GNU Make manual is definitely worth reading when learning Make, but it isn't exactly a tutorial. If you look at my own tutorial, at the very end it links to the GNU Make manual for further reading. However, I think some of the warnings I put in it are worth reading as well, since too many people make (forgive the pun) those same exact poor decisions with their Makefiles.
Michael Aaron Safyan