Reputation: 676
I'm about to start work on a project that is supposed to be cross-platform. The code already works on Mac OS X, and I've taken on the task to write a new GUI for Windows and Linux.
I was thinking of starting with Windows, but then I've ran into some problems. I need some third-party C++ libraries, but I'm not sure how I should set up the VC++ solution.
More specifically, where can I assume the third-party libraries are installed? Are there standard folders on Windows where I can expect the libraries to be installed?
Or is it better to include a custom build script that fetches the needed libraries from the web, and extracts to a folder of my choosing, something like:
[git repository]
[vc++ solution files]
[ externallibs]
bin/
*.dll
include/
*.h
lib/
*.lib
[non-windows stuff]
and reference those folders in the solution?
At my workplace, we do something similar, with .NET assemblies (but only DLL's, of course).
Thank you!
Upvotes: 3
Views: 1176
Reputation: 10557
I would advise to use an old pattern:
c:/Programs Files/Company Name/Product Name/
Library is not a product, but, well, this is something that is installed on the computer.
Upvotes: 0
Reputation: 5866
There's no "standard place" in Windows for libraries. However there's something you can do to automate your build.
Looks like you are using git
and I'd imagine you have your 3-rd party library in the repository. What you are doing is correct then - you can have a script to put the files into proper place.
-OR- you "assume" the libraries are in the local repo snapshot and use relative paths in your MSVC++ solution (remember - you can define those as part of "properties" to projects so there's one place where you specify the relative location of the files you need for your build).
In my projects I just set up the "properties" and "link" them to my projects in a solution. Those "properties" specify relative paths to the 3-rd party libraries I'm using, all of which are in the same source control system, so are accessible regardless of the individual developer's setup.
Here's an example for one of the 3-rd party libraries, taken from the global.props
file that I use for my projects (so you have a sample):
<PropertyGroup Label="UserMacros">
<CxImage>..\cximage702_full\CxImage</CxImage>
</PropertyGroup>
<PropertyGroup>
<IncludePath>$(CxImage);$(IncludePath)</IncludePath>
<LibraryPath>$(CxImage);$(LibraryPath)</LibraryPath>
</PropertyGroup>
Upvotes: 3