Skip to content

Commit 39e088d

Browse files
committed
Backport modules from CMake 3.6.1
1 parent 892a82c commit 39e088d

8 files changed

+1268
-261
lines changed
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
2+
#=============================================================================
3+
# Copyright 2013-2014 Kitware, Inc.
4+
#
5+
# Distributed under the OSI-approved BSD License (the "License");
6+
# see accompanying file Copyright.txt for details.
7+
#
8+
# This software is distributed WITHOUT ANY WARRANTY; without even the
9+
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
10+
# See the License for more information.
11+
#=============================================================================
12+
# (To distribute this file outside of CMake, substitute the full
13+
# License text for the above reference.)
14+
15+
# Do not include this module directly from code outside CMake!
16+
set(_JAVA_HOME "")
17+
if(JAVA_HOME AND IS_DIRECTORY "${JAVA_HOME}")
18+
set(_JAVA_HOME "${JAVA_HOME}")
19+
set(_JAVA_HOME_EXPLICIT 1)
20+
else()
21+
set(_ENV_JAVA_HOME "")
22+
if(DEFINED ENV{JAVA_HOME})
23+
file(TO_CMAKE_PATH "$ENV{JAVA_HOME}" _ENV_JAVA_HOME)
24+
endif()
25+
if(_ENV_JAVA_HOME AND IS_DIRECTORY "${_ENV_JAVA_HOME}")
26+
set(_JAVA_HOME "${_ENV_JAVA_HOME}")
27+
set(_JAVA_HOME_EXPLICIT 1)
28+
else()
29+
set(_CMD_JAVA_HOME "")
30+
if(APPLE AND EXISTS /usr/libexec/java_home)
31+
execute_process(COMMAND /usr/libexec/java_home
32+
OUTPUT_VARIABLE _CMD_JAVA_HOME OUTPUT_STRIP_TRAILING_WHITESPACE)
33+
endif()
34+
if(_CMD_JAVA_HOME AND IS_DIRECTORY "${_CMD_JAVA_HOME}")
35+
set(_JAVA_HOME "${_CMD_JAVA_HOME}")
36+
set(_JAVA_HOME_EXPLICIT 0)
37+
endif()
38+
unset(_CMD_JAVA_HOME)
39+
endif()
40+
unset(_ENV_JAVA_HOME)
41+
endif()
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
#.rst:
2+
# CMakeParseArguments
3+
# -------------------
4+
#
5+
# This module once implemented the :command:`cmake_parse_arguments` command
6+
# that is now implemented natively by CMake. It is now an empty placeholder
7+
# for compatibility with projects that include it to get the command from
8+
# CMake 3.4 and lower.
9+
10+
#=============================================================================
11+
# Copyright 2010 Alexander Neundorf <[email protected]>
12+
#
13+
# Distributed under the OSI-approved BSD License (the "License");
14+
# see accompanying file Copyright.txt for details.
15+
#
16+
# This software is distributed WITHOUT ANY WARRANTY; without even the
17+
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
18+
# See the License for more information.
19+
#=============================================================================
20+
# (To distribute this file outside of CMake, substitute the full
21+
# License text for the above reference.)

0 commit comments

Comments
 (0)