--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -399,6 +399,7 @@
       ELSE(NSIS_FOUND)
         MESSAGE(STATUS "NSIS not found")
       ENDIF(NSIS_FOUND)
+      ADD_CUSTOM_TARGET(HuginSetup COMMAND cd .. & ${MAKENSIS_EXECUTABLE} HuginSetup.nsi WORKING_DIRECTORY ${CMAKE_INSTALL_PREFIX})
     ENDIF(BUILD_HUGINSETUP)
   ENDIF(WIN32)