View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0009793CMakeCMakepublic2009-10-29 12:272009-10-29 13:48
ReporterMathieu Malaterre 
Assigned To 
PrioritynormalSeverityminorReproducibilityalways
StatusclosedResolutionfixed 
PlatformOSOS Version
Product Version 
Target VersionFixed in Version 
Summary0009793: FindJNI.cmake confused in multiple installation.
DescriptionFindJNI.cmake would pick a jni.h file from one java installation and a jni_md.h from another installation.

Attached patch solved situation.
Additional InformationTesting consisted in running:

http://gdcm.svn.sourceforge.net/svnroot/gdcm/Sandbox/CMakeBug/8/CMakeLists.txt [^]

project(testjni)
# Check that JAVA_HOME setting works with find_package(JNI)

cmake_minimum_required(VERSION 2.8)


macro(CHECK_JNI ref)
  message("working on ${ref}")
  set(ENV{JAVA_HOME} ${ref})
  find_package(JNI)
  message(${JNI_INCLUDE_DIRS})
  message(${JNI_LIBRARIES})
  
  foreach(include ${JNI_INCLUDE_DIRS})
    string(REGEX MATCH ${ref} out ${include})
    if(NOT out)
      message(FATAL_ERROR "problem with ${include} should contains ${ref}")
    endif(NOT out)
  endforeach(include)
endmacro(CHECK_JNI)

# locate jni.h
  # /usr/lib/gcc-snapshot/lib/gcc/x86_64-linux-gnu/4.5.0/include/jni.h
  # /usr/lib/gcc-snapshot/lib/jvm/java-1.5.0-gcj-4.5-snap/include/jni.h
  # /usr/lib/jvm/java-1.5.0-gcj-4.3-1.5.0.0/include/jni.h
  # /usr/lib/jvm/java-1.5.0-gcj-4.4/include/jni.h
  # /usr/lib/jvm/java-6-openjdk/include/jni.h
  # /usr/lib/jvm/java-6-sun-1.6.0.12/include/jni.h

set(java_loc
  #/usr/lib/gcc-snapshot/lib/gcc/x86_64-linux-gnu/4.5.0/
  #/usr/lib/gcc-snapshot/lib/jvm/java-1.5.0-gcj-4.5-snap/ # ok
  #/usr/lib/jvm/java-1.5.0-gcj-4.3-1.5.0.0/
  #/usr/lib/jvm/java-1.5.0-gcj-4.4/
  #/usr/lib/jvm/java-6-openjdk/
  /usr/lib/jvm/java-6-sun-1.6.0.12/
  )

foreach(ref ${java_loc})
  CHECK_JNI(${ref})
endforeach(ref)
TagsNo tags attached.
Attached Filespatch file icon jni_include_path.patch [^] (644 bytes) 2009-10-29 12:27 [Show Content]

- Relationships Relation Graph ] Dependency Graph ]

-  Notes
(0018278)
Bill Hoffman (manager)
2009-10-29 13:48

$ cvs commit -m "Fix for bug 0009793 try to make sure jni.h matches jni_md.h " FindJNI.cmake
Committer: Bill Hoffman <bill.hoffman@kitware.com>
/cvsroot/CMake/CMake/Modules/FindJNI.cmake,v <-- FindJNI.cmake
new revision: 1.46; previous revision: 1.45

- Issue History
Date Modified Username Field Change
2009-10-29 12:27 Mathieu Malaterre New Issue
2009-10-29 12:27 Mathieu Malaterre File Added: jni_include_path.patch
2009-10-29 13:48 Bill Hoffman Note Added: 0018278
2009-10-29 13:48 Bill Hoffman Status new => closed
2009-10-29 13:48 Bill Hoffman Resolution open => fixed


Copyright © 2000 - 2017 MantisBT Team
Powered by Mantis Bugtracker