我想为我的boost库创建一个nuget包。目前boost文件夹包含子文件夹,如boost,lib,pathces和readme.txt文件。
如果所有这些子文件夹都进入内容文件夹,我应该如何从中创建一个nuget包?
任何指针?
答案 0 :(得分:2)
要为本机C ++库创建NuGet包,您应该将这些文件添加到NuGet包中:
{LIBRARY_NAME} .targets应指定标头和lib文件的必需路径。例如,
<?xml version="1.0" encoding="utf-8"?>
<Project ToolVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemDefinitionGroup>
<ClCompile>
<PreprocessorDefinitions>;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalIncludeDirectories>$(MSBuildThisFileDirectory)..\..\lib\native\include\;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
</ClCompile>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Platform)'=='Win32'">
<Link>
<AdditionalLibraryDirectories>$(MSBuildThisFileDirectory)..\..\lib\native\address-model-32\lib;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Platform)'=='x64'">
<Link>
<AdditionalLibraryDirectories>$(MSBuildThisFileDirectory)..\..\lib\native\address-model-64\lib;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
</Link>
</ItemDefinitionGroup>
<ItemGroup />
</Project>
同时,使用此项目https://github.com/sergey-shandar/getboost为所有官方Boost库生成并发布Boost NuGet包。