From 2803688998cebbd40df1a0678106e62271217add Mon Sep 17 00:00:00 2001 From: Bill Hoffman Date: Wed, 4 Apr 2007 13:43:12 -0400 Subject: BUG: fix for bug 4605 --- Modules/FindJNI.cmake | 26 ++++++++++++++++++++++---- 1 file changed, 22 insertions(+), 4 deletions(-) diff --git a/Modules/FindJNI.cmake b/Modules/FindJNI.cmake index 45e6c20..f3b65d4 100644 --- a/Modules/FindJNI.cmake +++ b/Modules/FindJNI.cmake @@ -6,7 +6,7 @@ # JAVA_AWT_LIB_PATH = the path to the jawt library # JAVA_JVM_LIB_PATH = the path to the jvm library # JAVA_INCLUDE_PATH = the include path to jni.h -# JAVA_INCLUDE_PATH2 = the include path to jni.h +# JAVA_INCLUDE_PATH2 = the include path to jni_md.h # JAVA_AWT_INCLUDE_PATH = the include path to jawt.h # @@ -79,17 +79,33 @@ IF(APPLE) IF(EXISTS /Library/Frameworks/JavaVM.framework) SET(JAVA_HAVE_FRAMEWORK 1) ENDIF(EXISTS /Library/Frameworks/JavaVM.framework) + IF(EXISTS /System/Library/Frameworks/JavaVM.framework) + SET(JAVA_HAVE_FRAMEWORK 1) + ENDIF(EXISTS /System/Library/Frameworks/JavaVM.framework) + IF(JAVA_HAVE_FRAMEWORK) IF(NOT JAVA_AWT_LIBRARY) SET (JAVA_AWT_LIBRARY "-framework JavaVM" CACHE FILEPATH "Java Frameworks" FORCE) ENDIF(NOT JAVA_AWT_LIBRARY) + IF(NOT JAVA_JVM_LIBRARY) SET (JAVA_JVM_LIBRARY "-framework JavaVM" CACHE FILEPATH "Java Frameworks" FORCE) ENDIF(NOT JAVA_JVM_LIBRARY) - SET(JAVA_AWT_INCLUDE_DIRECTORIES ${JAVA_AWT_INCLUDE_DIRECTORIES} + + IF(NOT JAVA_AWT_INCLUDE_PATH) + IF(EXISTS /System/Library/Frameworks/JavaVM.framework/Headers/jawt.h) + SET (JAVA_AWT_INCLUDE_PATH "/System/Library/Frameworks/JavaVM.framework/Headers" CACHE FILEPATH "jawt.h location" FORCE) + ENDIF(EXISTS /System/Library/Frameworks/JavaVM.framework/Headers/jawt.h) + ENDIF(NOT JAVA_AWT_INCLUDE_PATH) + + # If using "-framework JavaVM", prefer its headers *before* the others in + # JAVA_AWT_INCLUDE_DIRECTORIES... (*prepend* to the list here) + # + SET(JAVA_AWT_INCLUDE_DIRECTORIES ~/Library/Frameworks/JavaVM.framework/Headers /Library/Frameworks/JavaVM.framework/Headers /System/Library/Frameworks/JavaVM.framework/Headers + ${JAVA_AWT_INCLUDE_DIRECTORIES} ) ENDIF(JAVA_HAVE_FRAMEWORK) ELSE(APPLE) @@ -112,8 +128,10 @@ FIND_PATH(JAVA_INCLUDE_PATH2 jni_md.h ${JAVA_INCLUDE_PATH}/linux ) -FIND_PATH(JAVA_AWT_INCLUDE_PATH jawt.h - ${JAVA_AWT_INCLUDE_DIRECTORIES} ${JAVA_INCLUDE_PATH} ) +FIND_PATH(JAVA_AWT_INCLUDE_PATH jawt.h + ${JAVA_AWT_INCLUDE_DIRECTORIES} + ${JAVA_INCLUDE_PATH} +) MARK_AS_ADVANCED( JAVA_AWT_LIBRARY -- cgit v0.12