libcpr / cpr

C++ Requests: Curl for People, a spiritual port of Python Requests.
https://docs.libcpr.org/
Other
6.49k stars 924 forks source link

NuGet package: 'AdditionalIncludeDirectories' not working in VS 2022 #902

Closed sven-molkenstruck closed 1 year ago

sven-molkenstruck commented 1 year ago

Hi, Thanks @simon-berger for the NuGet package! In my VS 2022 project the <AdditionalIncludeDirectories> entry in libcpr.props does not seem to work here although everything looks right. The compiler just does not find the folder when I try to #include "cpr/cpr.h" --> fatal error C1083: Cannot open include file: 'cpr/cpr.h': No such file or directory

(It does work when I add the folder manually to my project's AdditionalIncludeDirectories.)

I thought that it is necessary to add \;%(AdditionalIncludeDirectories) to the line (other projects do that), making it <AdditionalIncludeDirectories>$(MSBuildThisFileDirectory)\$(Platform)\$(Configuration)\include\;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> but that does not seem to solve it here.

When I copy the <ItemDefinitionGroup> / <ClCompile> / <AdditionalIncludeDirectories> nodes from libcpr.props into libcpr.targets, it works fine here. Is that necessary? Apparently in your tests it wasn't.

What do you think?

Thanks! Sven

simon-berger commented 1 year ago

Hi @Sven-HP ,

First of all, thank you for your comment and suggestion for improvement and sorry for my late reply, but I am quite busy with other projects at the moment. Currently I don't have time to test your change and don't know exactly why the error occurs, but if it solves the problem, feel free to create a pull request with your fix.

Best regards Simon

sven-molkenstruck commented 1 year ago

Done. See https://github.com/libcpr/cpr/pull/912 @simon-berger