MantisBT - CMake | |||||
| View Issue Details | |||||
| ID | Project | Category | View Status | Date Submitted | Last Update |
| 0014508 | CMake | Modules | public | 2013-10-24 11:00 | 2014-06-02 08:37 |
| Reporter | Joe Abbey | ||||
| Assigned To | Brad King | ||||
| Priority | normal | Severity | minor | Reproducibility | always |
| Status | closed | Resolution | fixed | ||
| Platform | Mac OS X 10.9 Mavericks | OS | Darwin | OS Version | 10.9 |
| Product Version | CMake 2.8.11.2 | ||||
| Target Version | CMake 3.0 | Fixed in Version | CMake 3.0 | ||
| Summary | 0014508: FindJNI.cmake fails to set JAVA_INCLUDE_PATH2 for darwin | ||||
| Description | When using find_package(JNI) on Mavericks JAVA_INCLUDE_PATH2 fails to be set. As far as I can tell, /System/Library/Frameworks/JavaVM.Framework/Headers no longer exists. The JAVA_INCLUDE_PATH2 needs to also look for the "darwin" subdirectory. | ||||
| Steps To Reproduce | On a Machine running Mac OS X Mavericks: Create a CMakeLists.txt with the following contents: find_package(JNI) if(JNI_FOUND) message (STATUS "JAVA_INCLUDE_PATH2=${JAVA_INCLUDE_PATH2}") else endif() END OF CMAKELISTS.TXT export JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk1.7.0_XX.jdk/Contents/Home/ mkdir build/ cd build/ cmake .. If JAVA_HOME isn't set of course JNI isn't found at all: -- The C compiler identification is Clang 5.0.0 -- The CXX compiler identification is Clang 5.0.0 -- Check for working C compiler: /usr/bin/cc -- Check for working C compiler: /usr/bin/cc -- works -- Detecting C compiler ABI info -- Detecting C compiler ABI info - done -- Check for working CXX compiler: /usr/bin/c++ -- Check for working CXX compiler: /usr/bin/c++ -- works -- Detecting CXX compiler ABI info -- Detecting CXX compiler ABI info - done -- Could NOT find JNI (missing: JAVA_INCLUDE_PATH JAVA_INCLUDE_PATH2 JAVA_AWT_INCLUDE_PATH) CMake Error at CMakeLists.txt:7 (message): I really need JNI like it's 1999. After I set JAVA_HOME, I'm seeing the following in CMake 2.8.11.2: -- The C compiler identification is Clang 5.0.0 -- The CXX compiler identification is Clang 5.0.0 -- Check for working C compiler: /usr/bin/cc -- Check for working C compiler: /usr/bin/cc -- works -- Detecting C compiler ABI info -- Detecting C compiler ABI info - done -- Check for working CXX compiler: /usr/bin/c++ -- Check for working CXX compiler: /usr/bin/c++ -- works -- Detecting CXX compiler ABI info -- Detecting CXX compiler ABI info - done -- Could NOT find JNI (missing: JAVA_INCLUDE_PATH2) CMake Error at CMakeLists.txt:7 (message): I really need JNI like it's 1999. With my patch (against cmake git) I get the following: -- JAVA_INCLUDE_PATH2=/Library/Java/JavaVirtualMachines/jdk1.7.0_XX.jdk/Contents/Home/include/darwin -- Configuring done -- Generating done -- Build files have been written to: /Users/jabbey/src/cmakebugs/build | ||||
| Additional Information | The following patch addresses this issue. diff --git a/Modules/FindJNI.cmake b/Modules/FindJNI.cmake index 1780a8e..22823e5 100644 --- a/Modules/FindJNI.cmake +++ b/Modules/FindJNI.cmake @@ -238,6 +238,7 @@ find_path(JAVA_INCLUDE_PATH jni.h find_path(JAVA_INCLUDE_PATH2 jni_md.h ${JAVA_INCLUDE_PATH} + ${JAVA_INCLUDE_PATH}/darwin ${JAVA_INCLUDE_PATH}/win32 ${JAVA_INCLUDE_PATH}/linux ${JAVA_INCLUDE_PATH}/freebsd | ||||
| Tags | No tags attached. | ||||
| Relationships | |||||
| Attached Files | |||||
| Issue History | |||||
| Date Modified | Username | Field | Change | ||
| 2013-10-24 11:00 | Joe Abbey | New Issue | |||
| 2013-10-24 11:01 | Joe Abbey | Note Added: 0034235 | |||
| 2013-10-29 05:55 | Rolf Eike Beer | Assigned To | => Mathieu Malaterre | ||
| 2013-10-29 05:55 | Rolf Eike Beer | Status | new => assigned | ||
| 2014-01-08 23:03 | Larry Shaffer | Note Added: 0034918 | |||
| 2014-01-08 23:04 | Larry Shaffer | Note Edited: 0034918 | bug_revision_view_page.php?bugnote_id=34918#r1364 | ||
| 2014-01-09 10:02 | Brad King | Note Added: 0034920 | |||
| 2014-01-09 10:02 | Brad King | Assigned To | Mathieu Malaterre => Brad King | ||
| 2014-01-09 10:02 | Brad King | Status | assigned => resolved | ||
| 2014-01-09 10:02 | Brad King | Resolution | open => fixed | ||
| 2014-01-09 10:02 | Brad King | Fixed in Version | => CMake 3.0 | ||
| 2014-01-09 10:02 | Brad King | Target Version | => CMake 3.0 | ||
| 2014-06-02 08:37 | Robert Maynard | Note Added: 0036071 | |||
| 2014-06-02 08:37 | Robert Maynard | Status | resolved => closed | ||
| Notes | |||||
|
|
|||||
|
|
||||
|
|
|||||
|
|
||||
|
|
|||||
|
|
||||
|
|
|||||
|
|
||||