'How to configure include directory when using HUNTER w/CMAKE
It seems that Hunter uses a common include directory when building packages, so the headers for all packages configured added by Hunter will be placed into:
$HOME/.hunter/_Base/<hex>/<hex>/<hex>/Install/include
or
C:\.hunter\_Base\<hex>\<hex>\<hex>\Install\include
for Windows.
The problem that I am running into is this:
If we have package_a added via Hunter and then for the next release (let's call it NEW) package_b will be configured via Hunter in the next version but currently (let's call it OLD) uses source download and build then I am running into an issue that I can't build both on the same machine or from the same home directory on Linux. The reason is as follows:
Hunter based include directory contains a header file:
package_b/header.h
The older source compiled version also contains header:
package_b/header.h
Between these 2 files there was a change internally that the a function with the same name was moved from namespace A to namespace B.
So the NEW build works fine since it ignores the old source compiled package_b and everything is great. The OLD build attempts to use the source compiled package_b but generates a link error for the moved function because it is looking for the function from namespace B which source compiled library does not have. The reason that the OLD build is looking for that is because it takes the package_b/header.h from the Hunter version of the package since it needs to have package_a, which has already been configured for use with Hunter in OLD build.
Is there any way to set the include directory for Hunter configured packages to be specific for a given version rather than generic?
P.S. Suggestion of using the same version of the package_b between the builds won't work either NEW build needs a newer version.
P.P.S. This may be an even bigger issue if the same problem occurred using Hunter for 2 different versions of the same library but I haven't tested that.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
