Skip to content

Commit

Permalink
nuget project fixes
Browse files Browse the repository at this point in the history
issue #189 (comment)
nuget #201
  • Loading branch information
Scott M Anderson committed Jul 13, 2018
1 parent b81a8ec commit 7a788eb
Showing 1 changed file with 21 additions and 9 deletions.
30 changes: 21 additions & 9 deletions projects/nuget.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -12,32 +12,44 @@ set(PRO_NUGET
DLMD5 ef16c016d7eb396c8f65888a53b69d78
)
########################################
function(patch_nuget)
# do nothing here
# don't want xpPatchProject(${PRO_NUGET}) called automatically
# because then an ExternalProject_Add(nuget) will try to extract the executable
# which doesn't make any sense...
endfunction()
########################################
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)
if(NOT TARGET download_${fn})
xpDownloadProject(${PRO_NUGET}) # download_${fn} target
message(STATUS "target download_${fn}")
endif()
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})
if(NOT TARGET nuget_bld)
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})
message(STATUS "target nuget_bld")
endif()
set(tgtDep nuget_bld)
endif()
message(STATUS "target ${tgtDep}")
if(ARGN)
set(${ARGN} ${tgtDep} PARENT_SCOPE)
set(NUGET_EXE ${DWNLD_DIR}/${fn} PARENT_SCOPE)
Expand Down

0 comments on commit 7a788eb

Please sign in to comment.