MantisBT - CMake | |||||
View Issue Details | |||||
ID | Project | Category | View Status | Date Submitted | Last Update |
0013942 | CMake | CCMake | public | 2013-02-21 17:50 | 2016-06-10 14:31 |
Reporter | Carlton Henderson | ||||
Assigned To | Kitware Robot | ||||
Priority | normal | Severity | major | Reproducibility | always |
Status | closed | Resolution | moved | ||
Platform | sparc | OS | solaris | OS Version | 10 |
Product Version | CMake 2.8.10.2 | ||||
Target Version | Fixed in Version | ||||
Summary | 0013942: FindJNI.cmake will not respect JAVA_HOME when setting JAVA_INCLUDE_PATH if jni.h exists in CMAKE_SYSTEM_PREFIX_PATH | ||||
Description | I have multiple JDKs installed on my machine. Also, I have gcc and its java support installed. So, to instruct CMake which java to use, I set the environment variable JAVA_HOME=/opt/java6 before running cmake. CMake set most of the java-related variables correctly except JAVA_INCLUDE_PATH which it set to /usr/local/include. | ||||
Steps To Reproduce | - touch /usr/local/include/jni.h # or install libgcj using the SMCgcc package from sunfreeware - install java6 in /opt/java6 - JAVA_HOME=/opt/java6 - export JAVA_HOME - construct a CMakeLists.txt file which uses - cmake /path/to/sources - grep JAVA_INCLUDE_PATH: CMakeCache.txt =>actual> JAVA_INCLUDE_PATH:PATH=/usr/local/include =>expected> JAVA_INCLUDE_PATH:PATH=/opt/java6/include - We didn't notice it until we went to make something that builds against jni.h => "/usr/local/include/jni.h", line 81: Error: #error jni.h not ported to this platform. - The above error happens because the c++ compiler finds /usr/local/include/jni.h instead of /opt/java6/include/jni.h | ||||
Additional Information | A minimalist fix might be to just add HINTS right after "find_path(JAVA_INCLUDE_PATH jni.h" in FindJNI.cmake. That is, add HINTS right before ${JAVA_AWT_INCLUDE_DIRECTORIES} so these directories are searched before each path in CMAKE_SYSTEM_PREFIX_PATH. However, CMake users such as myself would love to see FindJNI.cmake test the variables to make sure that all the JAVA and JNI-related variables point to the same JVM (like how CMake smartly checks to make sure the C compiler works). Thanks, -Carl | ||||
Tags | No tags attached. | ||||
Relationships | |||||
Attached Files | |||||
Issue History | |||||
Date Modified | Username | Field | Change | ||
2013-02-21 17:50 | Carlton Henderson | New Issue | |||
2013-02-25 12:25 | Carlton Henderson | Note Added: 0032380 | |||
2016-06-10 14:28 | Kitware Robot | Note Added: 0042232 | |||
2016-06-10 14:28 | Kitware Robot | Status | new => resolved | ||
2016-06-10 14:28 | Kitware Robot | Resolution | open => moved | ||
2016-06-10 14:28 | Kitware Robot | Assigned To | => Kitware Robot | ||
2016-06-10 14:31 | Kitware Robot | Status | resolved => closed |
Notes | |||||
|
|||||
|
|
||||
|
|||||
|
|