Visual-Studio tutorial on how to make all code in one directory and all sln and proj stuff in another?

429 Views Asked by At

So what I want is to develop a project easily portable / compilable across diffident platforms. I use only crossplatform libs. But My First priority currently is windows os so I am using Visual Studio for main development. Structure I Want to achieve looks like:

  !MainFolderForSolution
    !SolutionBuildDebugFolder
    - solution.sln
    - project1.vcproj
    - libUsedInproject1.vcproj
    !FolderForProject1
      - main.cpp
    !LibUsedInproject1
      - lib.cpp
      - lib.h

my point is that top level with projects and sln can be some make file or qt proj etc.

What I really need as a beginner is not only where to look but alsow how to do it... step by step.

So how to do such thing?

3

There are 3 best solutions below

5
On BEST ANSWER

You might want to consider using CMake.

It supports out of place builds (which supports a directory structure similar to yours), but also would assist in automatically generating and maintaining your other build settings, such as Qt or makefile based builds for cross platform development.

0
On

When adding files to a project in Visual Studio, you are asked where to put them at the bottom.
Name: [<Enter_Name>....]
Location: [D:\Path\ProjectName\...] [Browse...]
Just hit browse and browse to the location where you want to store your files. Hope this helps, if not, comment and maybe phrase the question a bit better. :)

3
On

In Visual Studio, right-click on your project, go to -> Properties | Configuration Properties | General. There you can set the Output Directory and the Intermediate Directory.