-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
issue #201
- Loading branch information
Scott M Anderson
committed
Jul 12, 2018
1 parent
35efc82
commit 23fae80
Showing
3 changed files
with
61 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
# nuget | ||
xpProOption(nuget) | ||
set(VER 2.8.6) | ||
set(PRO_NUGET | ||
NAME nuget | ||
WEB "NuGet" https://www.nuget.org "NuGet website" | ||
LICENSE "MIT" "https://docs.microsoft.com/en-us/nuget/policies/nuget-faq#nuget-command-line" "MIT" | ||
DESC "pre-built (MSW) the package manager for .NET" | ||
REPO "repo" https://github.com/NuGet "NuGet on github" | ||
VER ${VER} | ||
DLURL https://dist.nuget.org/win-x86-commandline/v${VER}/nuget.exe | ||
DLMD5 ef16c016d7eb396c8f65888a53b69d78 | ||
) | ||
######################################## | ||
function(build_nuget) | ||
if(NOT (XP_DEFAULT OR XP_PRO_NUGET)) | ||
return() | ||
endif() | ||
if(NOT MSVC) | ||
return() | ||
endif() | ||
xpDownloadProject(${PRO_NUGET}) # download_${fn} target | ||
xpGetArgValue(${PRO_NUGET} ARG DLURL VALUE dwnldUrl) | ||
get_filename_component(fn ${dwnldUrl} NAME) | ||
set(tgtDep download_${fn}) | ||
if(DEFINED XP_NUGET_COMPLETE_PKG) | ||
xpGetArgValue(${PRO_NUGET} ARG VER VALUE VER) | ||
configure_file(${PRO_DIR}/use/usexp-nuget-config.cmake ${STAGE_DIR}/share/cmake/ | ||
@ONLY NEWLINE_STYLE LF | ||
) | ||
ExternalProject_Add(nuget_bld DEPENDS ${tgtDep} | ||
DOWNLOAD_COMMAND "" DOWNLOAD_DIR ${NULL_DIR} CONFIGURE_COMMAND "" | ||
SOURCE_DIR ${NULL_DIR} BINARY_DIR ${NULL_DIR} INSTALL_DIR ${NULL_DIR} | ||
BUILD_COMMAND ${CMAKE_COMMAND} -E copy_if_different ${DWNLD_DIR}/${fn} ${STAGE_DIR}/bin/${fn} | ||
INSTALL_COMMAND "" | ||
) | ||
set_property(TARGET nuget_bld PROPERTY FOLDER ${bld_folder}) | ||
set(tgtDep nuget_bld) | ||
endif() | ||
message(STATUS "target ${tgtDep}") | ||
if(ARGN) | ||
set(${ARGN} ${tgtDep} PARENT_SCOPE) | ||
set(NUGET_EXE ${DWNLD_DIR}/${fn} PARENT_SCOPE) | ||
endif() | ||
endfunction() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
# NUGET_FOUND - nuget was found | ||
# NUGET_VER - nuget version | ||
# NUGET_EXE - the nuget executable (MSVC on Windows only) | ||
# this file (-config) installed to share/cmake | ||
get_filename_component(XP_ROOTDIR ${CMAKE_CURRENT_LIST_DIR}/../.. ABSOLUTE) | ||
get_filename_component(XP_ROOTDIR ${XP_ROOTDIR} ABSOLUTE) # remove relative parts | ||
set(NUGET_VER "@VER@ [@PROJECT_NAME@]") | ||
set(reqVars NUGET_VER) | ||
if(MSVC) | ||
set(NUGET_EXE ${XP_ROOTDIR}/bin/nuget.exe) | ||
list(APPEND reqVars NUGET_EXE) | ||
endif() | ||
include(FindPackageHandleStandardArgs) | ||
find_package_handle_standard_args(nuget REQUIRED_VARS ${reqVars}) | ||
mark_as_advanced(${reqVars}) |