diff options
author | Mathieu Malaterre <mathieu.malaterre@gmail.com> | 2009-11-02 16:37:16 (GMT) |
---|---|---|
committer | Mathieu Malaterre <mathieu.malaterre@gmail.com> | 2009-11-02 16:37:16 (GMT) |
commit | ccb8accc1b705c62f10e2f75f961667c76535365 (patch) | |
tree | f10b3eb4b906c3deae1c7bd3f34de1778d043194 /Modules/FindJava.cmake | |
parent | ca73562e5470e9c9c43c018ff73e9b920c7feed5 (diff) | |
download | CMake-ccb8accc1b705c62f10e2f75f961667c76535365.zip CMake-ccb8accc1b705c62f10e2f75f961667c76535365.tar.gz CMake-ccb8accc1b705c62f10e2f75f961667c76535365.tar.bz2 |
BUG: hardcoded path, are not hints. Split the two lists. Thanks Brad
Diffstat (limited to 'Modules/FindJava.cmake')
-rw-r--r-- | Modules/FindJava.cmake | 32 |
1 files changed, 20 insertions, 12 deletions
diff --git a/Modules/FindJava.cmake b/Modules/FindJava.cmake index af6e999..59c10de 100644 --- a/Modules/FindJava.cmake +++ b/Modules/FindJava.cmake @@ -28,16 +28,21 @@ # (To distributed this file outside of CMake, substitute the full # License text for the above reference.) -SET(JAVA_BIN_PATH - "[HKEY_LOCAL_MACHINE\\SOFTWARE\\JavaSoft\\Java Development Kit\\2.0;JavaHome]/bin" - "[HKEY_LOCAL_MACHINE\\SOFTWARE\\JavaSoft\\Java Development Kit\\1.9;JavaHome]/bin" - "[HKEY_LOCAL_MACHINE\\SOFTWARE\\JavaSoft\\Java Development Kit\\1.8;JavaHome]/bin" - "[HKEY_LOCAL_MACHINE\\SOFTWARE\\JavaSoft\\Java Development Kit\\1.7;JavaHome]/bin" - "[HKEY_LOCAL_MACHINE\\SOFTWARE\\JavaSoft\\Java Development Kit\\1.6;JavaHome]/bin" - "[HKEY_LOCAL_MACHINE\\SOFTWARE\\JavaSoft\\Java Development Kit\\1.5;JavaHome]/bin" - "[HKEY_LOCAL_MACHINE\\SOFTWARE\\JavaSoft\\Java Development Kit\\1.4;JavaHome]/bin" - "[HKEY_LOCAL_MACHINE\\SOFTWARE\\JavaSoft\\Java Development Kit\\1.3;JavaHome]/bin" +# The HINTS option should only be used for values computed from the system. +SET(_JAVA_HINTS + "[HKEY_LOCAL_MACHINE\\SOFTWARE\\JavaSoft\\Java Development Kit\\2.0;JavaHome]/bin" + "[HKEY_LOCAL_MACHINE\\SOFTWARE\\JavaSoft\\Java Development Kit\\1.9;JavaHome]/bin" + "[HKEY_LOCAL_MACHINE\\SOFTWARE\\JavaSoft\\Java Development Kit\\1.8;JavaHome]/bin" + "[HKEY_LOCAL_MACHINE\\SOFTWARE\\JavaSoft\\Java Development Kit\\1.7;JavaHome]/bin" + "[HKEY_LOCAL_MACHINE\\SOFTWARE\\JavaSoft\\Java Development Kit\\1.6;JavaHome]/bin" + "[HKEY_LOCAL_MACHINE\\SOFTWARE\\JavaSoft\\Java Development Kit\\1.5;JavaHome]/bin" + "[HKEY_LOCAL_MACHINE\\SOFTWARE\\JavaSoft\\Java Development Kit\\1.4;JavaHome]/bin" + "[HKEY_LOCAL_MACHINE\\SOFTWARE\\JavaSoft\\Java Development Kit\\1.3;JavaHome]/bin" $ENV{JAVA_HOME}/bin + ) +# Hard-coded guesses should still go in PATHS. This ensures that the user +# environment can always override hard guesses. +SET(_JAVA_PATHS /usr/lib/java/bin /usr/share/java/bin /usr/local/java/bin @@ -50,7 +55,8 @@ SET(JAVA_BIN_PATH ) FIND_PROGRAM(Java_JAVA_EXECUTABLE NAMES java - HINTS ${JAVA_BIN_PATH} + HINTS ${_JAVA_HINTS} + PATHS ${_JAVA_PATHS} ) IF(Java_JAVA_EXECUTABLE) @@ -112,12 +118,14 @@ ENDIF(Java_JAVA_EXECUTABLE) FIND_PROGRAM(Java_JAR_EXECUTABLE NAMES jar - HINTS ${JAVA_BIN_PATH} + HINTS ${_JAVA_HINTS} + PATHS ${_JAVA_PATHS} ) FIND_PROGRAM(Java_JAVAC_EXECUTABLE NAMES javac - HINTS ${JAVA_BIN_PATH} + HINTS ${_JAVA_HINTS} + PATHS ${_JAVA_PATHS} ) include(FindPackageHandleStandardArgs) |