aboutsummaryrefslogtreecommitdiff
path: root/cmake/Modules/FindNSIS.cmake
blob: 9f1ab176c00a07aa3b81908377249b8cfe40bbd6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
# - Try to find NSIS
# Once done this will define
#
#  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-2013 Andreas Schneider <asn@cryptomilk.org>
#
#  Distributed under the OSI-approved BSD License (the "License");
#  see accompanying file Copyright.txt for details.
#
#  This software is distributed WITHOUT ANY WARRANTY; without even the
#  implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
#  See the License for more information.
#=============================================================================
#

if (WIN32)
    set(_x86 "(x86)")

    set(_NSIS_ROOT_PATHS
        "$ENV{ProgramFiles}/NSIS"
        "$ENV{ProgramFiles${_x86}}/NSIS"
        "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Wow6432Node\\NSIS;Default]")

    find_path(NSIS_ROOT_PATH
        NAMES
            Include/Library.nsh
        PATHS
            ${_NSIS_ROOT_PATHS}
        )
    mark_as_advanced(NSIS_ROOT_PATH)
endif (WIN32)

find_program(NSIS_MAKE
    NAMES
        makensis
    PATHS
        ${NSIS_ROOT_PATH}
)

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)