MantisBT - CMake | ||||||||||
View Issue Details | ||||||||||
ID | Project | Category | View Status | Date Submitted | Last Update | |||||
0014143 | CMake | Modules | public | 2013-05-15 16:18 | 2013-10-07 10:10 | |||||
Reporter | vitaut | |||||||||
Assigned To | ||||||||||
Priority | normal | Severity | major | Reproducibility | always | |||||
Status | closed | Resolution | no change required | |||||||
Platform | x64 | OS | Windows | OS Version | XP Pro x64 SP2 | |||||
Product Version | CMake 2.8.10.2 | |||||||||
Target Version | Fixed in Version | |||||||||
Summary | 0014143: FindJNI cannot find JDK installed | |||||||||
Description | FindJNI cannot find JDK installed in C:\Program Files\Java\jdk1.7.0_21 on Windows XP Professional x64 Edition with SP2. It seems that the problem is find_library not resolving registry references in PATHS which is illustrated by the following CMakeLists.txt: cmake_minimum_required(VERSION 2.8) project(TEST) get_filename_component(java_install_version "[HKEY_LOCAL_MACHINE\\SOFTWARE\\JavaSoft\\Java Development Kit;CurrentVersion]" NAME) message("java_install_version: ${java_install_version}") find_library(JAVA_AWT_LIBRARY jawt PATHS "[HKEY_LOCAL_MACHINE\\SOFTWARE\\JavaSoft\\Java Development Kit\\${java_install_version};JavaHome]/lib") message("JAVA_AWT_LIBRARY: ${JAVA_AWT_LIBRARY}") get_filename_component(java_library_path "[HKEY_LOCAL_MACHINE\\SOFTWARE\\JavaSoft\\Java Development Kit\\${java_install_version};JavaHome]/lib" ABSOLUTE) message("java_library_path: ${java_library_path}") find_library(JAVA_AWT_LIBRARY2 jawt PATHS "${java_library_path}") message("JAVA_AWT_LIBRARY2: ${JAVA_AWT_LIBRARY2}") CMake gives the following output on it: java_install_version: 1.7 JAVA_AWT_LIBRARY: JAVA_AWT_LIBRARY-NOTFOUND java_library_path: C:/Program Files/Java/jdk1.7.0_21/lib JAVA_AWT_LIBRARY2: C:/Program Files/Java/jdk1.7.0_21/lib/jawt.lib -- Configuring done -- Generating done -- Build files have been written to: C:/temp/test Note that JAVA_AWT_LIBRARY is not found, while the JAVA_AWT_LIBRARY2 where PATHS don't contain registry references is found. The find_library code for JAVA_AWT_LIBRARY is similar to what FindJNI.cmake uses. | |||||||||
Steps To Reproduce | 1. Install JDK. 2. Run CMake using the following CMakeLists.txt: cmake_minimum_required(VERSION 2.8) project(TEST) find_package(JNI) 3. Observe that CMake reports -- Could NOT find JNI (missing: JAVA_AWT_LIBRARY JAVA_JVM_LIBRARY JAVA_INCLUDE_PATH JAVA_INCLUDE_PATH2 JAVA_AWT_INCLUDE_PATH) | |||||||||
Additional Information | ||||||||||
Tags | No tags attached. | |||||||||
Relationships |
| |||||||||
Attached Files | ||||||||||
Issue History | ||||||||||
Date Modified | Username | Field | Change | |||||||
2013-05-15 16:18 | vitaut | New Issue | ||||||||
2013-05-15 16:24 | Brad King | Note Added: 0033046 | ||||||||
2013-05-15 17:14 | vitaut | Note Added: 0033047 | ||||||||
2013-05-16 11:51 | Brad King | Note Added: 0033060 | ||||||||
2013-05-17 00:22 | vitaut | Note Added: 0033081 | ||||||||
2013-05-17 08:09 | Brad King | Note Added: 0033082 | ||||||||
2013-05-17 10:01 | vitaut | Note Added: 0033088 | ||||||||
2013-05-17 10:25 | vitaut | Note Added: 0033089 | ||||||||
2013-05-17 10:36 | Brad King | Note Added: 0033090 | ||||||||
2013-05-17 10:36 | Brad King | Status | new => resolved | |||||||
2013-05-17 10:36 | Brad King | Resolution | open => no change required | |||||||
2013-05-17 10:38 | Brad King | Note Added: 0033091 | ||||||||
2013-05-31 12:44 | Brad King | Relationship added | related to 0011303 | |||||||
2013-10-07 10:10 | Robert Maynard | Note Added: 0034070 | ||||||||
2013-10-07 10:10 | Robert Maynard | Status | resolved => closed |
Notes | |||||
|
|||||
|
|
||||
|
|||||
|
|
||||
|
|||||
|
|
||||
|
|||||
|
|
||||
|
|||||
|
|
||||
|
|||||
|
|
||||
|
|||||
|
|
||||
|
|||||
|
|
||||
|
|||||
|
|
||||
|
|||||
|
|