java - How do I use cmake's FindJNI on Cygwin? -


i have swig code i'm trying compile on cygwin before buy visual studio. cmakelist.txt works fine on osx. on windows, installed cygwin's version of cmake 3.3.1, installed latest jdk oracle , ran following cmakelists.txt (the .lib suffix commented because it's not helping):

cmake_minimum_required(version 2.8.9) project(myproject)  #set(cmake_find_library_suffixes ".lib")  find_package(java components development) find_package(jni required) 

but it's choking output:

.... -- found java: /home/user/jdk/bin/java.exe (found version "1.8.0.71") cmake error @ /usr/share/cmake-3.3.2/modules/findpackagehandlestandardargs.cmake:148 (message):   not find jni (missing: java_awt_library java_jvm_library) call stack (most recent call first):   /usr/share/cmake-3.3.2/modules/findpackagehandlestandardargs.cmake:388 (_fphsa_failure_message)   /usr/share/cmake-3.3.2/modules/findjni.cmake:287 (find_package_handle_standard_args)   cmakelists.txt:20 (find_package)   -- configuring incomplete, errors occurred! 

and following lines in .bash_profile:

export java_home="/home/user/jdk" export java_awt_library="$java_home/lib/jawt.lib" export java_jvm_library="$java_home/lib/jvm.lib" 

which reflects few of things i've tried already. reason jdk in home directory because tried see if problem space in original install path of /cygdrive/c/program files/java/jdk1.8.0_71 same error both locations.

is should work?

ah, figured out solution. these lines seem fix it:

set(cmake_find_library_prefixes "lib" "") set(cmake_find_library_suffixes ".dll.a" ".a" ".lib") 

although i'm not sure why need set them myself.

[edit] bought visual studio , ran similar problem. in case, although found java, couldn't find jni unless selected win64 generator.


Comments

Popular posts from this blog

authentication - Mongodb revoke acccess to connect test database -

r - Update two sets of radiobuttons reactively - shiny -

ios - Realm over CoreData should I use NSFetchedResultController or a Dictionary? -