How to show build directory in IntelliJ IDEA - build

I build my project and on the file system I see the build directory but in IntelliJ IDEA 13.01 I see:
How to make IntelliJ to show it like in Eclipse

Maybe your build directory is marked as "Excluded". Go to Project Settings -> Modules -> your module. Remove "Excluded" mark from your build directory.
Then modules->

You could overwrite the exclude of the build directory (see IdeaModule in the Gradle Build Language Reference for details). However, from what I remember, this will slow down IntelliJ, give duplicates in file searches, etc. Hence, it may not be a good solution to whatever problem you are ultimately trying to solve.

Related

Selecting C++ main function to build in eclipse

I've a C++ project in eclipse which is version managed with git. I've a git submodule, which is another project I've written in C++. The submodule has its main function and my project has its own.
Eclipse chooses other main (from the submodule) to compile when I press build. Is there a way to choose which main to build in eclipse?
Update: I'm still working on the issue. Excluding resources from the project didn't help either. Will answer the question when I solve it.
Update 2: Solved at last. See my answer.
I have solved the problem, at last. The solution is not a simple and straightforward one, so I'm writing step by step:
First set your toolchain correctly from Properties -> C/C++ Build -> Tool Chain Editor -> Current toolchain. It's MacOSX GCCor Linux GCC for me.
Set your correct project source path. I've symlinked the files from projects I imported as submodules to my project, so setting the correct source directory didn't exclude any required files from my project. Setting is at Properties -> C/C++ General -> Paths & Symbols -> Source Location. Make sure you exclude the other submodules and symlink the required files to your project.
Change the name of the artifact (binary, library, etc.) to something different than the ${projName}, because when you have submodules, you will have a directory named as ${projName} inside your build folder. Setting is at Properties -> C/C++ Build -> Settings -> Build Artifact -> Artifact name.
After making these changes, your project should build automatically. Looks like eclipse makes all necessary checks during build, but doesn't warn you about the problems. I had to see all these problems with running make --always-build inside the Debug folder.

How to exclude a source file from being build in eclipse (C++)?

I am trying to follow some insane complicated steps in order to be able to create C++ unit-tests for C++ code in eclipse (I am utterly new to eclipse). These steps state to exclude some source files from using in the built - which makes sense to me. However, in my eclipse I do not see any Exclude from built option when right-clicking on the source file. Also, neither this answer nor this answer do work, as I do not see the mentioned options in the list of things when I right-click on the source file.
So how to exclude a source file from a built?
P.S. The Version of eclipse seems to be Luna 4.4.0.
(Or, even better: If anyone knows an easier way to set up eclipse with ANY unit-testing framework in a SIMPLE way,- or knows a different Linux framework to start developing C++ projects with unit-testing right away without trying to set up things in unknown and complicated ways for weeks before starting to actually code something - ideas are VERY VERY welcome...)
I ran into a similar problem.
The C/C++ perspective of Eclipse Luna (4.4) is missing the contextual menu "Exclude from build".
I solve my problem by using the java perpective:
Window -> Open Perspective -> Other... -> Java(default)
Navigate to the file/folder you want to exclude
Right Click -> Resource -> Exclude from build
Then you can switch back to the C/C++ CDT perspective
Project Properties> C/C++ General> Path and Symbols
Tab Source Location
Select the source folder
Click the Edit Filter button
Add the file you want to exclude
I've tried this and it worked on Eclipse:
Right Click the file > Properties ... > Resource > Attributes : Derived.
(Eclipse Indigo)
Hope that helps.
I am using MARS eclipse version.
You have to create a build configuration for each component you are building.
Here is how to do that: multiple_execs
Then for each source file that you do not want included in that build; you right click on that source file and then select Resource Configuration and select Exclude From Build. Then you check the box of the build configuration you created above that you do not want the source a part of.
Here is YouTube video showing this: exclude files from a build

Project properties lost on external checkout

Our company might be moving from CVS to Subversion soon. This has brought about an issue for us, which I am trying to solve.
For CVS and Eclipse, we were able to use team project set files to gather various modules and check them out together (http://vpms.de.csc.com/projectset/). This made it very easy to manage projects, since there was no need to remember each module in the project.
However, project sets do not support SVN. I know there is an 'externals' property for SVN that does approximately (or possible exactly) the same thing. I tried this. Now, for the problem:
When I use the externals property and checkout 2 modules in eclipse, their C/C++ project properties are lost, and so I cannot right click on them to say "build project" or "clean project". They appear to Eclipse to be folders with files in them.
Is there something I am missing here?
EDIT
When I check out each module separately, they check out as projects, so they do have the individual .project/.cproject/settings stuff
You forgot to place Eclipse project metadata into your source control system. Make sure all files starting with '.' in project root make it in along with the entire contents of the .settings directory.
Subversion externals simply allows you to take files from one part of the repository and bring them in under a folder in your local checkout. At my last company, we had a java source directory that called "commonSrc" that was an SVN External for another project's main "src" directory, but in the project it was brought into, it simply acted as another folder (as you are experiencing).
I never really liked that method and wouldn't recommend it unless you have only one/two modules.
In order to do what you are trying to do with SVN, you might have to checkout each project separately, and use "Module Dependencies" in the project's properties to create the proper dependencies in Eclipse. You might be able to commit these project files so that the next person doesn't have to re-link them.
In case anyone needs this, here's what I found:
http://vpms.de.csc.com/projectset/
&
http://www.polarion.org/index.php?page=download&project=subversive
OR
http://www.giniality.com/old/update/projectset/
for Subversion + Project Set integration.
There is no need to break your project set. Once you have the integration plugins installed in Eclipse, all you need to do is change the source from the CVS server to SVN.

Change output directory of an Eclipse CDT project

I cannot find the possibility to change the output of the built files. The only I've found deactivates the whole generated makefile process, which I don't want to.
Right-click on your project and choose Properties.
Go under C/C++ Build, under Settings.
Click on the Build Artifact tab.
Under "Output prefix", enter the directory that you want to contain your built file (including a trailing slash).
It looks like you'll also need to modify your Run / Debug Settings with the updated path.
(However, writing your own makefile really isn't hard, especially if you use Eclipse's generated makefiles as a starting point, and it can give you a lot more flexibility.)

How to create Visual studio solution from make files?

I have a source code for a project with their make files. I want to create a Visual Studio (2005) solution from it. Is there any direct way to do this? can anyone help me please. I spent hours for searching, but couldn't find a way to do this.
Thanks.
Unfortunately, Microsoft removed this capability after VC++ 6.
If all you're looking to do is to build a Visual Studio project from a command line or script, you can use the devenv command to build using the settings in a project.
Something like:
devenv /build debug /project myproj myapp.sln
Ans starting with VS2010, C++ projects will use the MSBuild system, so you can drive builds using that technology.
If you really want a makefile, you'll need to write it up by hand (or maybe there's some 3rd party tool out there that I'm unaware of).
I'm not sure whether this solution can help you. Which I tried and it worked well in my previous projects. It need manually add the files.
Create a blank VS solution/project. Add the source files into that project.
Mark all source files as "Excluded from building". You can right click the files in project explorer and find the setting. So now nothing will happen when you build your project.
In project setting, find something like "Custom build step". Add the commands that invoke your original build command. (You may write different build command for debug/release ). You can also set the post-build actions such to copy your result to some folder....
Now you can edit and build source files.
For my experience, I can even debug it after setting the executable.
Hope this can help you.
If this is a one-off then it is easier to just create the VS project manually in visual studio.
If you are going to need to do this often look at ceating the project in something like cmake or Qt's .pro whcihc an generate makefiles and VS build files from the same defintion.
Do you want to use the makefile to build? You can create a project from existing source in VS 2005 and setup the project to use make to build (and the wizard will take you through all of this).
I am using VS2010.In order to build you can create a project from existing code. In VS2010 you can create project from existing code File->New->Project from Existing code. You can specify the other parameters and then ready with the solution. I did not go with make file but followed this approach which is working great.