Before logging an issue, please update to the latest release of Visual Micro from the Downloads Page.

When Logging a Support Issue in the Forum, please ensure you have also:-

  • Enabled vMicro > Compiler > Show Build Properties
  • Re-Compile your program with these settings enabled
 
Save the new Output to a Text File and....
  • Click the Reply button and attach as .txt file OR
  • Click here to Email us with the file attached, and a link to your post
Support requests without the output above may be impossible to answer, so please help us to help you
 
Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic Library directory in sketch directory (Read 4309 times)
BobJ
Newbies
*
Offline


Posts: 5
Joined: Dec 28th, 2016
Library directory in sketch directory
Dec 28th, 2016 at 10:47pm
Print Post  
I have multiple computers I use Visual Micro with, and use git for source control.  It would be nice to be able to add a Libraries directory in my project, and include my libraries there instead of the stock Arduino locations under documents.  With my other machine I have to keep the libraries in sync which makes no sense to me, unless I'm missing something.  Seems like deep includes does not search the sketch directory.

Thanks,
Bob
  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12187
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Library directory in sketch directory
Reply #1 - Dec 29th, 2016 at 12:28am
Print Post  
Hi,

Deep search is simply a way to discover libraries from non-ino project code and other libraries. It's a recent addition to the ide which does it by default and can't be disabled. It is optional in visual micro because the old way of adding #includes for each library to the .ino source still works and can improve compile times.

If you are a Pro user and you will find the "vmicro->add code" menu there is an option to add/create a new library. Click it and create a test library. 

Notice the location where it is created, for example "project\src\_micro-api\libraries". Libraries located below this sub folder structure of any project become "local" project libraries. 

Local libraries override the versions in the standard Arduino locations (if they exist). 

Local libraries should be included in the project source code in the exact same way as if they existed in the standard arduino library locations (ie: without path qualifiers), This ensures a local library can become a shared standard arduino library without code change.

You can copy existing libraries and to the correct location below the project then use the "show all files" view of the solution explorer, right click and include the library sources into the current project. As stated above, as long as the are in the designated location they won't be compiled with the project sources and will be compiled as libraries.

  
Back to top
IP Logged
 
BobJ
Newbies
*
Offline


Posts: 5
Joined: Dec 28th, 2016
Re: Library directory in sketch directory
Reply #2 - Dec 29th, 2016 at 1:35am
Print Post  
Hi Tim, 

Sounds reasonable, will give this a try.  I have the Pro version.

Also what files and directories can I safely add to my .gitignore file?

Thanks,
Bob
  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12187
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Library directory in sketch directory
Reply #3 - Dec 29th, 2016 at 5:58pm
Print Post  
Maybe some interesting things in my answer about a new shared project code facility that is about to be released here here http://www.visualmicro.com/forums/YaBB.pl?num=1482999947

Quote:
files and directories can I safely add to my .gitignore file


This is entirely up to you. If you have not used the special features of visual micro such as compiler defines, debug settings etc. and only want to store the basics then an Arduino project is simply the code in the folder and sub folders. Visual Micro can read that code and create a working arduino project from it because this is how the arduino ide works.

If you use the visual studio solution explorer to add/remove certain sources from the project folder or sub folders then you need the .vcxproj and vcxfilter files

The solution (.sln) stores a list of project locations for the current solution. It's just a handy way to work to have a solution to open so it's up to you if you store it. The only other thing a solution stores is breakpoints for the debugger.

The __vm folder below a sketch stores the setting such as configuration specific compiler defines, debug settings etc (project properties), last build info and other non-code settings, It's up to you if you want to share this. Visual Micro will recreate any settings files it can't find.

The build output is copied to the debug/release (configuration name) folders. It's up to you if you need to keep these in source control.

All the visual studio and visual micro settings files are simple text files (normally .xml) and can be viewed with a text editor if unsure what they contain.
  
Back to top
IP Logged
 
BobJ
Newbies
*
Offline


Posts: 5
Joined: Dec 28th, 2016
Re: Library directory in sketch directory
Reply #4 - Dec 29th, 2016 at 9:53pm
Print Post  
Everything seems to be working fine.  Thanks for the help.

I've been using VS for a lot of years so some of the new files and directories were new to me (the ones that visual micro adds that is.)   

Thanks,
Bob
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint