Add nuget package source for Windows build.

This fixes the "Unable to find package ..." error.

Thanks to:

https://stackoverflow.com/a/65012088/262458

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
This commit is contained in:
Rafael Kitover 2021-07-21 12:55:15 +00:00
parent c08bb6bdb0
commit f23fae6559
No known key found for this signature in database
GPG Key ID: 08AB596679D86240
1 changed files with 7 additions and 1 deletions

View File

@ -529,11 +529,17 @@ if(ENABLE_NLS)
file(DOWNLOAD "https://dist.nuget.org/win-x86-commandline/latest/nuget.exe" ${CMAKE_BINARY_DIR}/nuget.exe)
endif()
# Add nuget package source.
execute_process(
COMMAND nuget sources add -Name "NuGet official package source" -Source "https://api.nuget.org/v3/index.json"
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
)
# Install the Gettext.Tools package.
execute_process(
COMMAND nuget.exe install Gettext.Tools -OutputDirectory ${CMAKE_BINARY_DIR}/nuget
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
)
)
# Find the path to the binaries in the package and add them to find path.
file(GLOB pkg ${CMAKE_BINARY_DIR}/nuget/Gettext.Tools*)