Skip to content

Commit 9377945

Browse files
author
Bogdan Degtyariov
committed
WL#15846 - Fixing the header comment and the env variable check
Change-Id: I0532bb2247493f6471fd851f3e108c406d1e1761
1 parent a933a20 commit 9377945

File tree

1 file changed

+38
-33
lines changed

1 file changed

+38
-33
lines changed

packaging/WiX/wix_setup.cmake

Lines changed: 38 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1,41 +1,46 @@
11
# Copyright (c) 2010, 2023, Oracle and/or its affiliates. All rights reserved.
2-
#
3-
#
4-
#
5-
#
6-
#
7-
#
8-
#
9-
#
10-
#
11-
#
12-
#
13-
#
14-
#
15-
#
16-
#
17-
#
18-
#
19-
#
20-
#
21-
# The lines above are intentionally left blank
2+
#
3+
# This program is free software; you can redistribute it and/or modify
4+
# it under the terms of the GNU General Public License, version 2.0,
5+
# as published by the Free Software Foundation.
6+
#
7+
# This program is also distributed with certain software (including
8+
# but not limited to OpenSSL) that is licensed under separate terms,
9+
# as designated in a particular file or component or in included license
10+
# documentation. The authors of MySQL hereby grant you an additional
11+
# permission to link the program and your derivative works with the
12+
# separately licensed software that they have included with MySQL.
13+
#
14+
# This program is distributed in the hope that it will be useful,
15+
# but WITHOUT ANY WARRANTY; without even the implied warranty of
16+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17+
# GNU General Public License, version 2.0, for more details.
18+
#
19+
# You should have received a copy of the GNU General Public License
20+
# along with this program; if not, write to the Free Software
21+
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
2222

2323
#-------------- FIND WIX_DIR ------------------
24-
IF(DEFINED $ENV{WIX_DIR})
25-
SET(WIX_DIR "$ENV{WIX_DIR}")
26-
ELSE()
27-
SET(WIX_DIR "$ENV{USERPROFILE}\\.dotnet\\tools")
28-
ENDIF(DEFINED $ENV{WIX_DIR})
24+
# First check if WIX_DIR was given in the command line
25+
IF(NOT DEFINED WIX_DIR)
26+
# If WIX_DIR is not given in command line check env
27+
IF(DEFINED $ENV{WIX_DIR})
28+
SET(WIX_DIR "$ENV{WIX_DIR}")
29+
ELSE()
30+
SET(WIX_DIR "$ENV{USERPROFILE}\\.dotnet\\tools")
31+
ENDIF(DEFINED $ENV{WIX_DIR})
32+
ENDIF(NOT DEFINED WIX_DIR)
2933

3034
#----------------- FIND WIX EXECUTABLE -------------------
31-
IF (EXISTS "${WIX_DIR}\\wix.exe")
32-
MESSAGE(STATUS "Wix found in ${WIX_DIR}")
35+
FIND_PROGRAM(WIX_EXECUTABLE wix ${WIX_DIR})
36+
37+
IF (EXISTS ${WIX_EXECUTABLE})
38+
MESSAGE(STATUS "Wix found in ${WIX_DIR}")
3339
ELSE ()
34-
IF ($ENV{WIX_DIR})
35-
MESSAGE(FATAL_ERROR "Cannot find Wix in $ENV{WIX_DIR}")
36-
ELSE ($ENV{WIX_DIR})
37-
MESSAGE(FATAL_ERROR "Cannot find Wix in ${WIX_DIR}. Please set environment variable WIX_DIR which points to the wix installation directory")
38-
ENDIF ($ENV{WIX_DIR})
40+
IF ($ENV{WIX_DIR})
41+
MESSAGE(FATAL_ERROR "Cannot find Wix in $ENV{WIX_DIR}")
42+
ELSE ($ENV{WIX_DIR})
43+
MESSAGE(FATAL_ERROR "Cannot find Wix in ${WIX_DIR}. Please set environment variable WIX_DIR which points to the wix installation directory")
44+
ENDIF ($ENV{WIX_DIR})
3945
ENDIF ()
4046

41-
FIND_PROGRAM(WIX_EXECUTABLE wix ${WIX_DIR})

0 commit comments

Comments
 (0)