aboutsummaryrefslogtreecommitdiffstats
path: root/cmake/modules/FindChocolatey.cmake
blob: 172335f9b9b887aac2e56c45e2941c568ef5fa04 (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
# FindChocolatey
# ----------
#
# This module looks for Chocolatey

# This code was copied from
# http://cmake.org/gitweb?p=cmake.git;a=blob_plain;f=Modules/FindCygwin.cmake;hb=HEAD
# and modified.
#
# Its toplevel COPYING file starts with:
#=============================================================================
# Copyright 2001-2009 Kitware, Inc.
#
# 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.
#=============================================================================
# (To distribute this file outside of CMake, substitute the full
#  License text for the above reference.)

if (WIN32)
    if (ENV{ChocolateyInstall})
        set(_chocolateyinstall_bin "$ENV{ChocolateyInstall}/bin")
    endif()

    find_path(CHOCOLATEY_BIN_PATH
        choco.exe
        PATHS
            $_chocolateyinstall_bin
            "$ENV{ProgramData}/chocolatey/bin"
            C:/Chocolatey/bin
        DOC "Chocolatey binary path"
        NO_DEFAULT_PATH
    )

    mark_as_advanced(
        CHOCOLATEY_BIN_PATH
    )
endif ()