<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <meta content="text/html; charset=ISO-8859-1"
      http-equiv="Content-Type">
    <title></title>
  </head>
  <body text="#000000" bgcolor="#ffffff">
    Am 05.04.2011 16:33, schrieb David Cole:
    <blockquote
      cite="mid:BANLkTimkWztcABMVbLSF3qVGoZDjZ2Lh-w@mail.gmail.com"
      type="cite">
      <div class="gmail_quote">On Tue, Apr 5, 2011 at 7:16 AM, Oliver
        Buchtala <span dir="ltr">&lt;<a moz-do-not-send="true"
            href="mailto:oliver.buchtala@jku.at">oliver.buchtala@jku.at</a>&gt;</span>
        wrote:<br>
        <blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt
          0.8ex; border-left: 1px solid rgb(204, 204, 204);
          padding-left: 1ex;">
          Am 05.04.2011 13:12, schrieb Oliver Buchtala:
          <div class="im"><br>
            <blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt
              0.8ex; border-left: 1px solid rgb(204, 204, 204);
              padding-left: 1ex;">
              Hello,<br>
              <br>
              I am working with CMake 2.8 and using UseJNI.cmake<br>
              I have a JDK installed locally (registered in
              Win-Registry) but want to configure a project to use a
              different JDK lying on my disk.<br>
              <br>
              Looking at UseJNI.cmake I find that the environment
              variable JAVA_HOME could be handy,<br>
              but unfortunately UseJNI prefers the Windows-Registry
              entries above all other search paths.<br>
              <br>
              Did I miss something?<br>
              Shall I file an issue?<br>
              <br>
              Oliver<br>
              <br>
            </blockquote>
          </div>
          Sorry, the macro file is called FindJNI.cmake.
          <div>
            <div class="h5"><br>
              <br>
              _______________________________________________<br>
              Powered by <a moz-do-not-send="true"
                href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
              <br>
              Visit other Kitware open-source projects at <a
                moz-do-not-send="true"
                href="http://www.kitware.com/opensource/opensource.html"
                target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
              <br>
              Please keep messages on-topic and check the CMake FAQ at:
              <a moz-do-not-send="true"
                href="http://www.cmake.org/Wiki/CMake_FAQ"
                target="_blank">http://www.cmake.org/Wiki/CMake_FAQ</a><br>
              <br>
              Follow this link to subscribe/unsubscribe:<br>
              <a moz-do-not-send="true"
                href="http://www.cmake.org/mailman/listinfo/cmake"
                target="_blank">http://www.cmake.org/mailman/listinfo/cmake</a><br>
            </div>
          </div>
        </blockquote>
      </div>
      <br>
      The only find_* calls I see in FindJNI.cmake are:<br>
      <br>
      &nbsp; FIND_LIBRARY(JAVA_AWT_LIBRARY jawt <br>
      &nbsp; FIND_LIBRARY(JAVA_JVM_LIBRARY NAMES jvm JavaVM<br>
      &nbsp; FIND_PATH(JAVA_INCLUDE_PATH jni.h <br>
      &nbsp; FIND_PATH(JAVA_INCLUDE_PATH2 jni_md.h <br>
      &nbsp; FIND_PATH(JAVA_AWT_INCLUDE_PATH jawt.h<br>
      <br>
      If you want to override the default locations to find a specific
      installation of java stuff, just set those variables in your cache
      to point to the right stuff before calling find_package(JNI).<br>
      <br>
      For example:<br>
      &nbsp; set(JAVA_AWT_LIBRARY "/full/path/to/libjawt.a" CACHE FILEPATH
      "jawt library")<br>
      &nbsp; find_package(JNI)<br>
      <br>
      If a variable is already set before calling a find_* command, then
      the find is a no-op and it trusts that you've set it correctly.<br>
      <br>
      <br>
      HTH,<br>
      David<br>
      <br>
    </blockquote>
    Hi David,<br>
    <br>
    ok. I thought it could even be easier ;) <br>
    If I disable the win-Registry lookup stuff and set JAVA_HOME
    appropriately then everything is found perfectly.<br>
    And if disabling would be just changing the order of search paths
    this would be more control for me and still powerful (i.e., when not
    using JAVA_HOME).<br>
    Nevertheless, I can also live with your suggestion...<br>
    <br>
    Thank you,<br>
    Oliver<br>
    <br>
  </body>
</html>