| 1 |
# - Try to find NSIS |
| 2 |
# Once done this will define |
| 3 |
# |
| 4 |
# NSIS_ROOT_PATH - Set this variable to the root installation of NSIS |
| 5 |
# |
| 6 |
# Read-Only variables: |
| 7 |
# |
| 8 |
# NSIS_FOUND - system has NSIS |
| 9 |
# NSIS_MAKE - NSIS creator executable |
| 10 |
# |
| 11 |
#============================================================================= |
| 12 |
# Copyright (c) 2010-2013 Andreas Schneider <[email protected]> |
| 13 |
# |
| 14 |
# Distributed under the OSI-approved BSD License (the "License"); |
| 15 |
# see accompanying file Copyright.txt for details. |
| 16 |
# |
| 17 |
# This software is distributed WITHOUT ANY WARRANTY; without even the |
| 18 |
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
| 19 |
# See the License for more information. |
| 20 |
#============================================================================= |
| 21 |
# |
| 22 |
|
| 23 |
if (WIN32) |
| 24 |
set(_x86 "(x86)") |
| 25 |
|
| 26 |
set(_NSIS_ROOT_PATHS |
| 27 |
"$ENV{ProgramFiles}/NSIS" |
| 28 |
"$ENV{ProgramFiles${_x86}}/NSIS" |
| 29 |
"[HKEY_LOCAL_MACHINE\\SOFTWARE\\Wow6432Node\\NSIS;Default]") |
| 30 |
|
| 31 |
find_path(NSIS_ROOT_PATH |
| 32 |
NAMES |
| 33 |
Include/Library.nsh |
| 34 |
PATHS |
| 35 |
${_NSIS_ROOT_PATHS} |
| 36 |
) |
| 37 |
mark_as_advanced(NSIS_ROOT_PATH) |
| 38 |
endif (WIN32) |
| 39 |
|
| 40 |
find_program(NSIS_MAKE |
| 41 |
NAMES |
| 42 |
makensis |
| 43 |
PATHS |
| 44 |
${NSIS_ROOT_PATH} |
| 45 |
) |
| 46 |
|
| 47 |
include(FindPackageHandleStandardArgs) |
| 48 |
find_package_handle_standard_args(NSIS DEFAULT_MSG NSIS_MAKE) |
| 49 |
|
| 50 |
if (NSIS_MAKE) |
| 51 |
set(NSIS_FOUND TRUE) |
| 52 |
endif (NSIS_MAKE) |
| 53 |
|
| 54 |
mark_as_advanced(NSIS_MAKE) |