Thomas
Thomas

Reputation: 725

Where are nuget package manager include directories set in VS 2015?

i am currently trying my first steps with nuget package manager (3.4.3.855) in VS 2015 (Enterprise). For my C++/Qt project i managed to find some libraries i need and they seem to be correctly downloaded to <myprojectDir>/packages/<package_name>/... folders.

However, it is a mystery to me, where and how include folders for headers and/or libs are specified for the project?

I mean, for example with the Eigen library, after importing the nuget package i can just #include <Eigen/core>, which is located in

<myprojectDir>\packages\Eigen.3.2.9\build\native\include

and everything works fine, but i neither have the packages\Eigen.3.2.9\build\native\include-path popping up in the VC++ Directories->Include Directories list in the property pages nor is there a custom property page in the project properties (yes, i did not click the solution properties ;) ) as seen e.g. in this example video with the zlib package. I do not even have this property page if I install the zlib package.

While it seems to work somehow under the hood for Eigen, it does not for the Visual Leak Detector (vld) package... so knowing how things work would be great ;)

Thanks for any help...

Upvotes: 4

Views: 5244

Answers (1)

Weiwei
Weiwei

Reputation: 3766

From NuGet 2.5, C++ project recognizes the installed packages through MSBuild properties and targets files from NuGet package. After installing packages in C++ project, the MSBuild files are imported into your project file. So the projects will know how to find and use the contents of the NuGet Packages.

To make MSBuild integration better, NuGet has created a new convention for automatically importing MSBuild properties and targets from a NuGet package. Alongside the existing \content, \lib, and \tools folders, NuGet now recognizes a new top-level folder: \build. You could open the Eigen package that you have installed through NuGet Package Explorer, there has a \build folder and a Eigen.targets file which contains MSBuild properties.

Please refer to the MSBuild Integration part from below link:

http://blog.nuget.org/20130426/native-support.html enter image description here

Upvotes: 3

Related Questions