What does it mean to build a project? - build

When it comes to programming what does it really mean to build a project?
From my experience it usually means to compile a program. But what if it is a project that doesn't need compilation like a Python program or Django web application?

Typically, building a project is not really about "building a project" at all. It is about "building items" that are considered to be the deliverables of the project.
In some circles the deliverables are also named "artifacts" or "build artifacts"; however, "to build a project" is really abbreviated speech for "to build the deliverables of a project from the sources".

Not having python or django in mind - because I am not familiar with them; however, thinking back to visual basic, which never used to be compiled, a person would build a p-code file that contained their program and a runtime library would interpret it. It wasn't compiled, but it could run as though it had been. I imagine that building a python program would be to create a file which could be interpreted by another process.

Related

Run a script in eclipse before build

Simply put:
In eclipse how do I run a shell/batch script when I build? I have an external tool that can be run by hand but I want to trigger it when the project is built. Using build variables in the script would be an added bonus.
Why I want this:
I work on multi-platform games for mobile. The teams in the company I'm at use X-Code, Visual Studio, and Eclipse (Momentics) for our games. We want to be able to pick up a phone and see overlay on-top of it with information such as who built it, when it was built, what branch and revision it's from, and what library versions are being used. I've done this with X-Code by running a script on build that dumps some of that information to the resource directory of my game that I can then parse at runtime. It's really simple and I'm up for alternate suggestions if you have them; keeping in mind it must work for the three IDE's our developers use.
Bonus Sugar:
In X-Code we can use build variables which would be super nice to have for eclipse as well. I use them to change to the active cocos2d-x repository and get a git log to tell us when the last commit to that repository was made and by who. If that isn't possible in eclipse I can figure something out.
Thanks in advance!
Add a custom builder to your project: open Project properties from the popup menu, on the builders page add a new Program. That will open a "External tool configuration" page.
There you can define a script to run, and also add parameters, where you can add Eclipse variables, such as ${workspace}, etc.
Be careful though: this will run every time when the incremental project builder runs, and the configuration is shared through version control (so beware of absolute paths).

what is a project in eclipse?

I've just started working with Eclipse for C++ and I just want to clarify something that I haven't been able to figure out by searching so far. Is a project folder in eclipse only intended to have one program in it? i.e., a what is meant by project is basically a C++ program? And so you're not supposed to store many different programs in one project directory? Am I understanding this correctly?
That is correct, though they are trying to change that:
http://www.eclipse.org/eclipse/development/towards-more-flexible-projects.html
Eclipse requires that the contents of each project be stored in a
single directory on disk. Every file and folder in that directory tree
on disk must belong to the project in the workspace
Project is a project. You could divine you aplication to .dll, .exe, or other stuffs. When you are developing something that could go apart in another solution the you can put apart that piece (.dll for example). When you are developing in Visual Studio you can see that projects are in final a single file that has some own functionality, and the whole program is called solution. Didn't fired up Eclipse for a while, but it goes in the same direction. I can remember that projects in Eclipse were very poor, and meaning of the project was considered with actual language that you use (Java, C/C++, PHP, PYTHON, etc.).
Good definition is that project hold some part of application (if not all of it).

Import existing C++ project into Xcode IDE

I am trying to open an existing C++ open-source library in Xcode to publish it with my own modification/additions. The library is Tesseract-OCR, which does not include a .xcodeproj file.
Since Xcode can function as an IDE, is it possible to open a bunch of files as a single project in Xcode? Is there an easy way to produce an Xcode project?
There are several ways you could do it, depending on the level of IDE integration you want. There's no direct way of importing a Makefile-based project into Xcode. You can create a project that builds via the Makefile, but you wouldn't get many of the benefits of using an IDE, since the editor features such as word completion rely on Xcode being able to parse the files in the project. You will be able to use the debugger though. To do this, create a new project and add a custom target with a script build phase that just calls down to Makefile.
If however the project you're building compiles very easily, ie without requiring a lot of macros to be set up, include paths, etc, then it may be simple to just create an empty project and merely add all source files to it. I've used this method extensively for building boost libraries. If this is a configure && make type project then you will probably have to run the configure step first, and ensure any top level config.h files are included in the project.
If the project has a complex makefile then it is likely to be an involved task to create a useful Xcode project
I realise you asked explicitly for Xcode, but in case you were actually trying to solve the problem of "I have existing C++ code which builds and runs fine from the command line, and I'd like to code and debug it in an IDE, what should I do?" my firm recommendation would be to avoid Xcode and go for Eclipse.
The reason is that as far as I can tell, Xcode has no way of ingesting the command line build environment and effectively requires you to recreate the make process inside Xcode from scratch. Fine for tiny projects, but anything with more than a few source files and it quickly becomes painful. Whereas in Eclipse everything is built around Makefiles. So in my case I got to the "step through code with working code completion" in Eclipse a lot quicker vs. never in Xcode. This of course could be because I'm an Xcode noob, but my 2c.
To create an Xcode project from an existing cmake project, you can run cmake -G Xcode. It produces some folders and files apart from the project file, so it might be better to create a folder for it first. For example:
mkdir -p build/xcode
cd build/xcode
cmake -G Xcode ../..
Xcode is a useable IDE for library creation.
Of course a good first step is to see if the one source code will build on its own with configure scripts that are included.
If not, it becomes a question of how many libraries you need to link in.
There are resources online (or at least there used to be) for using Xcode (or perhaps it's forerunner Product builder) for porting Unix projects to Mac.
Good tutorial at: http://www.macresearch.org/tutorial-introducing-xcode-30-organizer
Another good reference is Darwin Ports.
As for doing this on your own. You can build c++ based libraries in XCode. People do that every day. You can even use one of the Xcode templates to get you started.
However, library dev requires more experience with Xcode then say a simple Cocoa "Hello World" app.
The remaining questions will be assuring that the source code's dependencies are already built into the Mac's SDK. (Don't hold your breath for linking to MFC)
It's a general question... So it's a general answer.
In Xcode8,there is "Xcode->file->add files to...",then choose your files.If you want to add several files at a time,press "Cmd" when you are choosing.

C++ Code not building with build project (F6) in Visual Studio 2008

I have a large solution that contains C# and C++ projects. After I code in my classes or functions I run a build to have the parser check syntax. What I have noticed is that when I press F6 the entire solution will build and get parsed except for the C++ files that I'm working on.
This seems like it's not the intended function of the editor so is there a way I can force this to happen when I perform a build?
Thanks,
P.S. I know I can go to rebuild project and force a build that way. I'm looking for a way to have the editors treatment of C++ and C# files be consistent.
In the solution properties, under "Configuration Properties", make sure the C++ projects are set to build. Also, make sure the project dependencies are setup properly.
These two things control which projects are built when you run a build.

standalone tool for generating makefile(s) from Eclipse's .cproject file?

Is there a standalone tool, that can be ran from a shell script, to generate a makefile from the .cproject? Actually, the same functionality as the CDT itself, but that can be non-interactive.
As is probably obvious, I want to be able to run a script that checkouts and builds the software, comprising from several C++ project. I am trying to avoid moving to a build system like maven, as it seems as like an overhead in this early stage of our project. thanks!
I know that there was discussions on the CDT-dev mailinglist a few months back about having a command-line tool for building CDT projects. Writing such a tool is really not very difficult (there was an example mentioned), it is simply a matter of defining your own Eclipse-application, load the project, and build it. Searching the CDT-dev list on "standalone build" should give you some relevant hits.