1
0
mirror of https://github.com/Kitware/CMake.git synced 2025-10-19 11:18:40 +08:00

FindJava, FindJNI: fix erroneous regex, enhance registry lookup

This commit is contained in:
Marc Chevrier
2018-05-05 15:45:57 +02:00
committed by Brad King
parent 1013560a6a
commit b4e1569315
2 changed files with 3 additions and 3 deletions

View File

@@ -128,7 +128,7 @@ if (WIN32)
OUTPUT_VARIABLE _JNI_VERSIONS
ERROR_QUIET)
if (NOT _JNI_RESULT)
string (REGEX MATCHALL "HKEY_LOCAL_MACHINE\\\\SOFTWARE\\\\JavaSoft\\\\JDK\\\\[0-9\.]+" _JNI_VERSIONS "${_JNI_VERSIONS}")
string (REGEX MATCHALL "HKEY_LOCAL_MACHINE\\\\SOFTWARE\\\\JavaSoft\\\\JDK\\\\[0-9.]+" _JNI_VERSIONS "${_JNI_VERSIONS}")
if (_JNI_VERSIONS)
# sort versions. Most recent first
## handle version 9 apart from other versions to get correct ordering
@@ -141,7 +141,7 @@ if (WIN32)
list (REVERSE _JNI_V9)
list (APPEND _JNI_VERSIONS ${_JNI_V9})
foreach (_JNI_HINT IN LISTS _JNI_VERSIONS)
list(APPEND _JNI_HINTS "[${_JNI_HINT}\\MSI;INSTALLDIR]")
list(APPEND _JNI_HINTS "[${_JNI_HINT};JavaHome]")
endforeach()
endif()
endif()

View File

@@ -97,7 +97,7 @@ if (WIN32)
list (REVERSE _JAVA_V9)
list (APPEND _JAVA_VERSIONS ${_JAVA_V9})
foreach (_JAVA_HINT IN LISTS _JAVA_VERSIONS)
list(APPEND _JAVA_HINTS "[${_JAVA_HINT}\\MSI;INSTALLDIR]/bin")
list(APPEND _JAVA_HINTS "[${_JAVA_HINT};JavaHome]/bin")
endforeach()
endif()
endif()