aboutsummaryrefslogtreecommitdiff
path: root/cmake/Modules/FindNSIS.cmake
diff options
context:
space:
mode:
Diffstat (limited to 'cmake/Modules/FindNSIS.cmake')
-rw-r--r--cmake/Modules/FindNSIS.cmake32
1 files changed, 24 insertions, 8 deletions
diff --git a/cmake/Modules/FindNSIS.cmake b/cmake/Modules/FindNSIS.cmake
index 98a17c78..21f80d86 100644
--- a/cmake/Modules/FindNSIS.cmake
+++ b/cmake/Modules/FindNSIS.cmake
@@ -1,14 +1,15 @@
# - Try to find NSIS
# Once done this will define
#
-# NSIS_ROOT_DIR - Set this variable to the root installation of ZLIB
+# NSIS_ROOT_PATH - Set this variable to the root installation of NSIS
#
# Read-Only variables:
+#
# NSIS_FOUND - system has NSIS
# NSIS_MAKE - NSIS creator executable
#
#=============================================================================
-# Copyright (c) 2010-2011 Andreas Schneider <asn@cryptomilk.org>
+# Copyright (c) 2010-2013 Andreas Schneider <asn@cryptomilk.org>
#
# Distributed under the OSI-approved BSD License (the "License");
# see accompanying file Copyright.txt for details.
@@ -19,21 +20,36 @@
#=============================================================================
#
-set(_NSIS_ROOT_PATHS
- C:/NSIS/Bin
- "$ENV{PROGRAMFILES}/NSIS"
-)
+if (WIN32)
+ set(_NSIS_ROOT_HINTS
+ "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Wow6432Node\\NSIS;Default]")
+
+ set(_NSIS_ROOT_PATHS
+ $ENV{PROGRAMFILES}/NSIS)
+
+ find_path(NSIS_ROOT_PATH
+ NAMES
+ Include/Library.nsh
+ HINTS
+ ${_NSIS_ROOT_HINTS}
+ PATHS
+ ${_NSIS_ROOT_PATHS}
+ )
+ mark_as_advanced(NSIS_ROOT_PATH)
+endif (WIN32)
find_program(NSIS_MAKE
NAMES
makensis
PATHS
${NSIS_ROOT_PATH}
- ${NSIS_ROOT_PATH}/Bin
- ${_NSIS_ROOT_PATHS}
)
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(NSIS DEFAULT_MSG NSIS_MAKE)
+if (NSIS_MAKE)
+ set(NSIS_FOUND TRUE)
+endif (NSIS_MAKE)
+
mark_as_advanced(NSIS_MAKE)