summaryrefslogtreecommitdiff
path: root/Modules/Internal/CPack/CPackNuGet.cmake
diff options
context:
space:
mode:
authorYacoub Hossain <yacoub.hossain@autodesk.com>2020-02-14 14:02:52 -0500
committerBrad King <brad.king@kitware.com>2020-02-17 11:01:08 -0500
commite6c470997f5d59b0ea4249af64172edb7d1ee0db (patch)
tree07409152d2d3ee0501024a6cc6c842ff21d680a0 /Modules/Internal/CPack/CPackNuGet.cmake
parentb782fc9390a82dc23de12b5cefbf9aa3af489365 (diff)
downloadcmake-e6c470997f5d59b0ea4249af64172edb7d1ee0db.tar.gz
CPack/NuGet: Provide more granular errors
Address the problem of not knowing when cpack fails to create a nuget package which occurs when creating multiple nupkgs. Fixes: #20094
Diffstat (limited to 'Modules/Internal/CPack/CPackNuGet.cmake')
-rw-r--r--Modules/Internal/CPack/CPackNuGet.cmake16
1 files changed, 16 insertions, 0 deletions
diff --git a/Modules/Internal/CPack/CPackNuGet.cmake b/Modules/Internal/CPack/CPackNuGet.cmake
index 1f4bcfdcd1..20eed2eef8 100644
--- a/Modules/Internal/CPack/CPackNuGet.cmake
+++ b/Modules/Internal/CPack/CPackNuGet.cmake
@@ -287,7 +287,11 @@ if(CPACK_NUGET_ORDINAL_MONOLITIC)
execute_process(
COMMAND "${NUGET_EXECUTABLE}" pack ${CPACK_NUGET_PACK_ADDITIONAL_OPTIONS}
WORKING_DIRECTORY "${CPACK_TEMPORARY_DIRECTORY}"
+ RESULT_VARIABLE _nuget_result
)
+ if(NOT _nuget_result EQUAL 0)
+ message(FATAL_ERROR "Nuget pack failed")
+ endif()
elseif(CPACK_NUGET_ALL_IN_ONE)
# This variable `CPACK_NUGET_ALL_IN_ONE` set by C++ code:
@@ -300,7 +304,11 @@ elseif(CPACK_NUGET_ALL_IN_ONE)
execute_process(
COMMAND "${NUGET_EXECUTABLE}" pack ${CPACK_NUGET_PACK_ADDITIONAL_OPTIONS}
WORKING_DIRECTORY "${CPACK_TEMPORARY_DIRECTORY}"
+ RESULT_VARIABLE _nuget_result
)
+ if(NOT _nuget_result EQUAL 0)
+ message(FATAL_ERROR "Nuget pack failed")
+ endif()
else()
# Is there any grouped component?
@@ -322,7 +330,11 @@ else()
execute_process(
COMMAND "${NUGET_EXECUTABLE}" pack ${CPACK_NUGET_PACK_ADDITIONAL_OPTIONS}
WORKING_DIRECTORY "${CPACK_TEMPORARY_DIRECTORY}"
+ RESULT_VARIABLE _nuget_result
)
+ if(NOT _nuget_result EQUAL 0)
+ message(FATAL_ERROR "Nuget pack failed")
+ endif()
endforeach()
endif()
# Is there any single component package needed?
@@ -341,7 +353,11 @@ else()
execute_process(
COMMAND "${NUGET_EXECUTABLE}" pack ${CPACK_NUGET_PACK_ADDITIONAL_OPTIONS}
WORKING_DIRECTORY "${CPACK_TEMPORARY_DIRECTORY}"
+ RESULT_VARIABLE _nuget_result
)
+ if(NOT _nuget_result EQUAL 0)
+ message(FATAL_ERROR "Nuget pack failed")
+ endif()
endforeach()
endif()
endif()