diff options
author | Bill Hoffman <bill.hoffman@kitware.com> | 2007-04-04 17:43:12 (GMT) |
---|---|---|
committer | Bill Hoffman <bill.hoffman@kitware.com> | 2007-04-04 17:43:12 (GMT) |
commit | 2803688998cebbd40df1a0678106e62271217add (patch) | |
tree | b1eea8c50b07f01fe5b843c11ade18a289e814b6 /Modules | |
parent | 310ca5795aa0655f69856145f4647df4f4187b6d (diff) | |
download | CMake-2803688998cebbd40df1a0678106e62271217add.zip CMake-2803688998cebbd40df1a0678106e62271217add.tar.gz CMake-2803688998cebbd40df1a0678106e62271217add.tar.bz2 |
BUG: fix for bug 4605
Diffstat (limited to 'Modules')
-rw-r--r-- | Modules/FindJNI.cmake | 26 |
1 files 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 |