Przeglądaj źródła

Fix for bug#9686 convert java_home to a cmake path before using.

Bill Hoffman 16 lat temu
rodzic
commit
e1c1ab7197
1 zmienionych plików z 8 dodań i 5 usunięć
  1. 8 5
      Modules/FindJNI.cmake

+ 8 - 5
Modules/FindJNI.cmake

@@ -67,11 +67,14 @@ SET(JAVA_AWT_LIBRARY_DIRECTORIES
   "[HKEY_LOCAL_MACHINE\\SOFTWARE\\JavaSoft\\Java Development Kit\\1.3;JavaHome]/lib"
   "[HKEY_LOCAL_MACHINE\\SOFTWARE\\JavaSoft\\Java Development Kit\\${java_install_version};JavaHome]/lib"
   )
+
+FILE(TO_CMAKE_PATH "$ENV{JAVA_HOME}" _JAVA_HOME)
+
 JAVA_APPEND_LIBRARY_DIRECTORIES(JAVA_AWT_LIBRARY_DIRECTORIES
-  $ENV{JAVA_HOME}/jre/lib/{libarch}
-  $ENV{JAVA_HOME}/jre/lib
-  $ENV{JAVA_HOME}/lib
-  $ENV{JAVA_HOME}
+  ${_JAVA_HOME}/jre/lib/{libarch}
+  ${_JAVA_HOME}/jre/lib
+  ${_JAVA_HOME}/lib
+  ${_JAVA_HOME}
   /usr/lib
   /usr/local/lib
   /usr/lib/jvm/java/lib
@@ -106,7 +109,7 @@ SET(JAVA_AWT_INCLUDE_DIRECTORIES
   "[HKEY_LOCAL_MACHINE\\SOFTWARE\\JavaSoft\\Java Development Kit\\1.4;JavaHome]/include"
   "[HKEY_LOCAL_MACHINE\\SOFTWARE\\JavaSoft\\Java Development Kit\\1.3;JavaHome]/include"
   "[HKEY_LOCAL_MACHINE\\SOFTWARE\\JavaSoft\\Java Development Kit\\${java_install_version};JavaHome]/include"
-  $ENV{JAVA_HOME}/include
+  ${_JAVA_HOME}/include
   /usr/include 
   /usr/local/include
   /usr/lib/java/include