How to change default working directory in Clion EAP on the Mac?
Every time when I create new project, I need to change it to project location.
First of all, it is not possible to change the working directory through the GUI of CLion (see second question in "CMake configuration" section in Source) but you can ask the developers to add this feature in the future (see this).
On the other hand, as far as I know, it is not possible to automatically add set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}") in the CMakeList.txt, but if I find a solution, I will write it here.
Are you still having this problem?
I just tried the following: I closed all of my projects to get back to the "Welcome to CLion" dialog. I selected "New Project" from the Quick Start menu on the right. This brings up a "New CMake Project" dialog. I then entered a new path under Project Location. The last segment of the project is interpreted as the Project Name
. Click OK to create the new project.
The next time you create a new project, it should remember the location as shown here.
Related
In Xcode how do I create a new workspace and add 1 project to it so that I can see the project and its files?
If I just drag in the project, all I can see is the project it cannot be expanded, I cannot see the files. Also, is there anyway to copy over existing schemes from the project so that they can be used in the workspace?
First choose file > new > Workspace...
Then, you must first, and this is important, you must first close the project that you want to drag in. Than drag in the .xcodeproj file from the finder to your new workspace. Then it will appear properly and expand to show all of its files and your schemes will be available.
Although the accepted answer is correct, there is an alternate way to accomplish the same thing, and it is arguably easier/more straightforward. You can just open up the project in Xcode and click File -> Save as Workspace...
Bam! You now have a workspace with 1 project in it, as requested.
Just FYI, 2020, Apple recently added a thing,
make your workspace, exit it and
make your new project. in fact when you enter the name to save the project,
they added this option:
just select the workspace you wish to add it to.
Besides all above solutions you can use this alternative. Let's say you have a workspace and a project that you want to add to that workspace.
Close your project.
Open your workspace.
Option + Click in the Project navigator. Make sure you are clicking on an empty area, not on the existing files or folders.
In the context menu, select "Add files to your workspace...".
Finally select your project xcodeproj file on you disk.
Have a nice project 😉,
Add project into workspace
As alternative
- Close a project that you are going to add to a workspace
- Open Project Navigator -> Right click -> Add Files to "<workspace_name>"...
I don't see an option to tell VC++ what the current project is, so that I can search within a specific project within my solution, rather than the whole solution.
Is it something that happens as a side-effect of some other operation or can I somehow explicitly select which project is the current one?
currently opened file on which you opened the Find/Replace dialog belongs to a certain project. So that project is basically the "Current Project"
Right click on a project in the Solution Explorer and select 'Set as Startup Project.' The 'Startup' project is the "current" project.
This question has a longer answer that it would seem. To make the Current Project selection, go to Solution Explorer and click on the desired project so that it is highlighted. It is not necessary to make the project your StartUp Project, but doing so will highlight the project as required to make it the Current Project for the search. You can make the project selection before or after opening the find/replace dialog. If you do not have a project selected (by selecting the solution), there is no current project and nothing gets searched.
However, there is at least one alternative. If the Property Manager is opened, a selection there will also set the current project. If both are opened, it appears that the last selection becomes the current project. This information is for VS2017, but probably it has been that way for many older versions since the Current Project search option has been around for a long time.
One would think that adding a project to a Workspace in Xcode would be intuitive.
1) But when you add a new project it is added within the existing project - It must be a bug, or is there actually a reason.
2) How do you add a project then (ctr + right click et.)
You could use the plus (+) button on the lower left corner of Xcode IDE to add a new project to a workspace. You must have first a blank workspace, which you could use the menu (New/Workspaces with short cuts ^%N).
To morning I spend some time doing what you asked to. so here are the steps (you can skip if you already have followed some).
Create a new blank work space
Add a project to it by clicking File->Add new files to "Your workSpace" or "command+option+A"
Choose your project folder Or yourproject.xcodeproj file
Just let the indexing finish properly, and congratulations you have added a new project to your xcode work space successfully.
Note: Make sure that project which you are adding is not already opened, Xcode get lil sensitive about that and doesn't show files tree in workspace in that case.
My answer pertains to XCode 5, but should pertain to XCode 4 as well.
In typical Apple fashion, they have given you multiple ways to do the almost the same thing. Very confusing and annoying. There are three ways, and only one way pertains to the original posters question:
(1) Use File --> Add Files to ...
Problem with this, is that it will only add files to workspace if NO project has been selected.
Problem with THAT, is that once you select a project, there is no way I know of to unselect it.
(2) Use the "+" in the lower-left corner.
Problem with that, it is equivalent to using the pull down menu (#1 above)
(3) Right click in the left pane (in an empty area), and you will see "Add files to "
This is the only right way to do it, as it guarantees that the file will be added to the workspace, and not any selected project.
Try all three methods after selecting an existing project, and you will see what I mean.
Based on my previous experience with XCode, Apple will take about 10 more years to fix this sort of thing.
One would think that adding a project to a Workspace in Xcode would be
intuitive.
Of course not, this is Apple, only usable for certain experts...
1) But when you add a new project it is added within the existing project -
It must be a bug, or is there actually a reason
You did miss the drop down selection list "Add to:" in the last of three dialog pages, the place where the location of the .xcodeproj file is specified. There you can select the Workspace you are currently using. So simply use "File" "New..." "Project...", give it a name and select from templates, and NEVER intuitiveley double click on the directory where to place the project file, but be sure to adjust the selection drop down list to your currently open workspace. Of course this choice is never preselected.
I'm using Xcode version 3.2.2.
If I follow these steps with Xcode:
create a new Cocoa application called "Test"
in Info change the "Build Products Path" to "_build"
build project
I find that there is still a "build" directory being created called:
build/Test.build/Test.pbxindex/<various files>
These look like the files that Xcode creates when indexing the project. Is there anyway to change this location so these go into the new "_build" location?
I've just tested the steps you outlined above in XCode 3.2.3 and I could not reproduce that symptom. Renaming the build products path to "_build" properly moves all build-related files (and the .pbindex) to that location. I have also built with the different XCode-project compatibility options with the same results.
Thinking this might be a bug in XCode 3.2.2, I've read the changelog but no such symptom is reported, and I personally have not seen that before.
An option that might help (but it should NOT be necessary) is to set the Build Intermediate Files path (in the Info panel of the Project) to the "Build products location", but I presume you have already tried that. In my XCode, the only case where the .pbxindex files do get built in another location is when I force them to by choosing the "Custom location" in the same panel.
Is it possible that it's a simple oversight on your part and that you haven't removed the directory after the cleanup? If not, then some more information would be helpful:
perform a clean build
open up the debugger (CMD+Shift+B)
from the toolbar, make sure you have toggled "All Results" under overview, "By Step", and "All Messages" from the last combobox
right-click somewhere in the debug output, and choose the option "Open These Results as a Transcript File"
HTH
I added a project to an existing solution that is currently under source control using TFS, but for some reason I cannot check in the new project. When I view my pending changes, none of the files in the new project show up. None of the files have a plus (for a new file) next to them. What did I do wrong? How do I fix it? It's time to check in.
The problem is the solution has lost its binding. That's why it's not checking out automatically when you add the new project.
In order to restore the binding in VS 2010, go to File->Source Control->Change Source Control. Look for the "Solution: your solution name" and if it's not bound it will say "no server". Click on it and then click "Bind" from the toolbar.
in Visual Studio 2012/2013 it's File->Source Control->Advanced->Change Source Control (Thanks to danglund).
This should create a new vssscc file that is correctly bound. Now add the new project and everything should work correctly.
I was also having the same problem, this is how I fixed it:
Go to Visual Studion: File->Source Control->Change Source Control
Find your project there, its status would be "Invalid", Click on it and press "Unbind". Now go back to Solution Explorer and Remove your project. Add this project again into the solution explorer solve the problem.
Good Luck!
Click on the Team Project name in Source Control Explorer
File -> Source Control -> Add Items to Folder...
Follow the wizard.
Head over to Source Control Explorer and browse to the place in the tree which matches where the new project is at for your solution. Add the files there.
However, I'd be concerned that you modified the solution file and it didn't ask you to check that out. What you may want to try doing is manually checking out the solution file, then readding the project to the solution and seeing if it takes then.
You shouldn't need to drop to the command line - this is a pretty straightforward operation.
Open the solution. Select the project (make sure it is in the solution).
File -> Source Control -> Properties will bring up the binding dialog.
Bind the project to source control.
You should now see + signs next to all your files. The key is that that a .vssscc is added for your project to version control.
If that fails, open your csproj in notepad (after making a backup), and ensure any version control bindings are removed, then try again.
Unfortunately, I'd wager that your best bet is to manually do the check-ins through the command line. I've ran into situations where the Team Explorer UI grows out of sync with what's actually happening in source control, and manually fixing things through tf.exe was the only way to resolve it.
That said, normally, adding a new project to a solution isn't a hassle.
TFS can simply do not know about your project existed. Just add your project files through Source Control Explorer and re-load the solution.
While loading of a solution it can ask you to bind your project to source control. Let it do so by clicking Bind button - it should do all the magic for you.
Make sure you get the latest version of the solution
Check out the solution file
Add the new project
If the newly added project was previously under (another) source control, that might mess things up, make sure to "unbind" it before adding it. (See source control bindings somewhere under the "file" menu in Visual Studio)
You shouldn't need the command line.
I had this same problem in VS 2019, where I had added a new project to an existing solution, and the project wasn't showing up in pending changes. Right-clicking on the project and going to Source Control only had an option to "Add Solution to Source Control".
Using the above answers, I started down the File --> Source Control path, which then yielded an option to directly "Add selected projects to source control". Taking that option solved the problem, so that now the new project shows up in pending changes. NOTE: I'm adding this answer since it's still an issue in VS 2019, but has an easier solution now than in the past.