2005-12-14 18:51:08 +00:00
|
|
|
# - Find JNI java libraries.
|
2001-05-04 13:47:58 +00:00
|
|
|
# This module finds if Java is installed and determines where the
|
|
|
|
# include files and libraries are. It also determines what the name of
|
|
|
|
# the library is. This code sets the following variables:
|
2005-12-14 18:51:08 +00:00
|
|
|
#
|
2008-07-20 19:39:02 +00:00
|
|
|
# JNI_INCLUDE_DIRS = the include dirs to use
|
|
|
|
# JNI_LIBRARIES = the libraries to use
|
2009-12-21 20:56:05 +00:00
|
|
|
# JNI_FOUND = TRUE if JNI headers and libraries were found.
|
2008-07-20 19:39:02 +00:00
|
|
|
# JAVA_AWT_LIBRARY = the path to the jawt library
|
|
|
|
# JAVA_JVM_LIBRARY = the path to the jvm library
|
2005-12-15 15:41:19 +00:00
|
|
|
# JAVA_INCLUDE_PATH = the include path to jni.h
|
2007-04-04 17:43:12 +00:00
|
|
|
# JAVA_INCLUDE_PATH2 = the include path to jni_md.h
|
2005-12-15 15:41:19 +00:00
|
|
|
# JAVA_AWT_INCLUDE_PATH = the include path to jawt.h
|
2008-07-20 19:39:02 +00:00
|
|
|
#
|
|
|
|
|
2009-09-28 15:45:50 +00:00
|
|
|
#=============================================================================
|
|
|
|
# Copyright 2001-2009 Kitware, Inc.
|
|
|
|
#
|
|
|
|
# Distributed under the OSI-approved BSD License (the "License");
|
|
|
|
# see accompanying file Copyright.txt for details.
|
|
|
|
#
|
|
|
|
# This software is distributed WITHOUT ANY WARRANTY; without even the
|
|
|
|
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
|
|
|
# See the License for more information.
|
|
|
|
#=============================================================================
|
2010-08-07 00:48:47 +00:00
|
|
|
# (To distribute this file outside of CMake, substitute the full
|
2009-09-28 15:45:50 +00:00
|
|
|
# License text for the above reference.)
|
|
|
|
|
2009-09-30 18:15:23 +00:00
|
|
|
# Expand {libarch} occurences to java_libarch subdirectory(-ies) and set ${_var}
|
2009-09-30 13:59:00 +00:00
|
|
|
MACRO(java_append_library_directories _var)
|
|
|
|
# Determine java arch-specific library subdir
|
2010-07-30 08:19:42 +00:00
|
|
|
# Mostly based on openjdk/jdk/make/common/shared/Platform.gmk as of openjdk
|
|
|
|
# 1.6.0_18 + icedtea patches. However, it would be much better to base the
|
|
|
|
# guess on the first part of the GNU config.guess platform triplet.
|
|
|
|
IF(CMAKE_SYSTEM_PROCESSOR STREQUAL "x86_64")
|
|
|
|
SET(_java_libarch "amd64")
|
|
|
|
ELSEIF(CMAKE_SYSTEM_PROCESSOR MATCHES "^i.86$")
|
|
|
|
SET(_java_libarch "i386")
|
|
|
|
ELSEIF(CMAKE_SYSTEM_PROCESSOR MATCHES "^alpha")
|
|
|
|
SET(_java_libarch "alpha")
|
|
|
|
ELSEIF(CMAKE_SYSTEM_PROCESSOR MATCHES "^arm")
|
|
|
|
# Subdir is "arm" for both big-endian (arm) and little-endian (armel).
|
|
|
|
SET(_java_libarch "arm")
|
|
|
|
ELSEIF(CMAKE_SYSTEM_PROCESSOR MATCHES "^mips")
|
|
|
|
# mips* machines are bi-endian mostly so processor does not tell
|
|
|
|
# endianess of the underlying system.
|
|
|
|
SET(_java_libarch "${CMAKE_SYSTEM_PROCESSOR}" "mips" "mipsel" "mipseb")
|
|
|
|
ELSEIF(CMAKE_SYSTEM_PROCESSOR MATCHES "^(powerpc|ppc)64")
|
|
|
|
SET(_java_libarch "ppc64")
|
|
|
|
ELSEIF(CMAKE_SYSTEM_PROCESSOR MATCHES "^(powerpc|ppc)")
|
|
|
|
SET(_java_libarch "ppc")
|
|
|
|
ELSEIF(CMAKE_SYSTEM_PROCESSOR MATCHES "^sparc")
|
|
|
|
# Both flavours can run on the same processor
|
|
|
|
SET(_java_libarch "${CMAKE_SYSTEM_PROCESSOR}" "sparc" "sparcv9")
|
|
|
|
ELSEIF(CMAKE_SYSTEM_PROCESSOR MATCHES "^(parisc|hppa)")
|
|
|
|
SET(_java_libarch "parisc" "parisc64")
|
|
|
|
ELSEIF(CMAKE_SYSTEM_PROCESSOR MATCHES "^s390")
|
|
|
|
# s390 binaries can run on s390x machines
|
|
|
|
SET(_java_libarch "${CMAKE_SYSTEM_PROCESSOR}" "s390" "s390x")
|
|
|
|
ELSEIF(CMAKE_SYSTEM_PROCESSOR MATCHES "^sh")
|
|
|
|
SET(_java_libarch "sh")
|
|
|
|
ELSE(CMAKE_SYSTEM_PROCESSOR STREQUAL "x86_64")
|
|
|
|
SET(_java_libarch "${CMAKE_SYSTEM_PROCESSOR}")
|
|
|
|
ENDIF(CMAKE_SYSTEM_PROCESSOR STREQUAL "x86_64")
|
|
|
|
|
|
|
|
# Append default list architectures if CMAKE_SYSTEM_PROCESSOR was empty or
|
|
|
|
# system is non-Linux (where the code above has not been well tested)
|
|
|
|
IF(NOT _java_libarch OR NOT (CMAKE_SYSTEM_NAME MATCHES "Linux"))
|
|
|
|
LIST(APPEND _java_libarch "i386" "amd64" "ppc")
|
|
|
|
ENDIF(NOT _java_libarch OR NOT (CMAKE_SYSTEM_NAME MATCHES "Linux"))
|
|
|
|
|
|
|
|
# Sometimes ${CMAKE_SYSTEM_PROCESSOR} is added to the list to prefer
|
|
|
|
# current value to a hardcoded list. Remove possible duplicates.
|
|
|
|
LIST(REMOVE_DUPLICATES _java_libarch)
|
2009-09-30 13:59:00 +00:00
|
|
|
|
|
|
|
FOREACH(_path ${ARGN})
|
|
|
|
IF(_path MATCHES "{libarch}")
|
|
|
|
FOREACH(_libarch ${_java_libarch})
|
|
|
|
STRING(REPLACE "{libarch}" "${_libarch}" _newpath "${_path}")
|
|
|
|
LIST(APPEND ${_var} "${_newpath}")
|
|
|
|
ENDFOREACH(_libarch)
|
|
|
|
ELSE(_path MATCHES "{libarch}")
|
|
|
|
LIST(APPEND ${_var} "${_path}")
|
|
|
|
ENDIF(_path MATCHES "{libarch}")
|
|
|
|
ENDFOREACH(_path)
|
|
|
|
ENDMACRO(java_append_library_directories)
|
|
|
|
|
2007-12-17 22:22:51 +00:00
|
|
|
GET_FILENAME_COMPONENT(java_install_version
|
|
|
|
"[HKEY_LOCAL_MACHINE\\SOFTWARE\\JavaSoft\\Java Development Kit;CurrentVersion]" NAME)
|
2008-07-20 19:39:02 +00:00
|
|
|
|
2003-02-11 18:37:19 +00:00
|
|
|
SET(JAVA_AWT_LIBRARY_DIRECTORIES
|
2003-10-16 15:05:04 +00:00
|
|
|
"[HKEY_LOCAL_MACHINE\\SOFTWARE\\JavaSoft\\Java Development Kit\\1.4;JavaHome]/lib"
|
|
|
|
"[HKEY_LOCAL_MACHINE\\SOFTWARE\\JavaSoft\\Java Development Kit\\1.3;JavaHome]/lib"
|
2007-12-17 22:22:51 +00:00
|
|
|
"[HKEY_LOCAL_MACHINE\\SOFTWARE\\JavaSoft\\Java Development Kit\\${java_install_version};JavaHome]/lib"
|
2009-09-30 13:59:00 +00:00
|
|
|
)
|
2009-10-22 10:57:00 +00:00
|
|
|
|
|
|
|
FILE(TO_CMAKE_PATH "$ENV{JAVA_HOME}" _JAVA_HOME)
|
|
|
|
|
2009-09-30 13:59:00 +00:00
|
|
|
JAVA_APPEND_LIBRARY_DIRECTORIES(JAVA_AWT_LIBRARY_DIRECTORIES
|
2009-10-22 10:57:00 +00:00
|
|
|
${_JAVA_HOME}/jre/lib/{libarch}
|
|
|
|
${_JAVA_HOME}/jre/lib
|
|
|
|
${_JAVA_HOME}/lib
|
|
|
|
${_JAVA_HOME}
|
2003-02-11 18:37:19 +00:00
|
|
|
/usr/lib
|
|
|
|
/usr/local/lib
|
2008-07-20 19:50:13 +00:00
|
|
|
/usr/lib/jvm/java/lib
|
2009-09-30 13:59:00 +00:00
|
|
|
/usr/lib/java/jre/lib/{libarch}
|
2011-06-15 17:18:14 +00:00
|
|
|
/usr/lib/jvm/jre/lib/{libarch}
|
2009-09-30 13:59:00 +00:00
|
|
|
/usr/local/lib/java/jre/lib/{libarch}
|
|
|
|
/usr/local/share/java/jre/lib/{libarch}
|
|
|
|
/usr/lib/j2sdk1.4-sun/jre/lib/{libarch}
|
|
|
|
/usr/lib/j2sdk1.5-sun/jre/lib/{libarch}
|
|
|
|
/opt/sun-jdk-1.5.0.04/jre/lib/{libarch}
|
|
|
|
/usr/lib/jvm/java-6-sun/jre/lib/{libarch}
|
|
|
|
/usr/lib/jvm/java-1.5.0-sun/jre/lib/{libarch}
|
|
|
|
/usr/lib/jvm/java-6-sun-1.6.0.00/jre/lib/{libarch} # can this one be removed according to #8821 ? Alex
|
2009-09-30 18:15:23 +00:00
|
|
|
/usr/lib/jvm/java-6-openjdk/jre/lib/{libarch}
|
2011-03-28 15:39:27 +00:00
|
|
|
/usr/lib/jvm/java-1.6.0-openjdk-1.6.0.0/jre/lib/{libarch} # fedora
|
2009-09-30 13:59:00 +00:00
|
|
|
# Debian specific paths for default JVM
|
|
|
|
/usr/lib/jvm/default-java/jre/lib/{libarch}
|
|
|
|
/usr/lib/jvm/default-java/jre/lib
|
|
|
|
/usr/lib/jvm/default-java/lib
|
2003-02-11 18:37:19 +00:00
|
|
|
)
|
2008-07-20 19:39:02 +00:00
|
|
|
|
2006-10-27 21:29:05 +00:00
|
|
|
SET(JAVA_JVM_LIBRARY_DIRECTORIES)
|
|
|
|
FOREACH(dir ${JAVA_AWT_LIBRARY_DIRECTORIES})
|
|
|
|
SET(JAVA_JVM_LIBRARY_DIRECTORIES
|
|
|
|
${JAVA_JVM_LIBRARY_DIRECTORIES}
|
|
|
|
"${dir}"
|
|
|
|
"${dir}/client"
|
|
|
|
"${dir}/server"
|
|
|
|
)
|
|
|
|
ENDFOREACH(dir)
|
|
|
|
|
|
|
|
|
2003-02-11 18:37:19 +00:00
|
|
|
SET(JAVA_AWT_INCLUDE_DIRECTORIES
|
2003-10-16 15:05:04 +00:00
|
|
|
"[HKEY_LOCAL_MACHINE\\SOFTWARE\\JavaSoft\\Java Development Kit\\1.4;JavaHome]/include"
|
|
|
|
"[HKEY_LOCAL_MACHINE\\SOFTWARE\\JavaSoft\\Java Development Kit\\1.3;JavaHome]/include"
|
2007-12-17 22:22:51 +00:00
|
|
|
"[HKEY_LOCAL_MACHINE\\SOFTWARE\\JavaSoft\\Java Development Kit\\${java_install_version};JavaHome]/include"
|
2009-10-22 10:57:00 +00:00
|
|
|
${_JAVA_HOME}/include
|
2001-06-06 13:43:54 +00:00
|
|
|
/usr/include
|
|
|
|
/usr/local/include
|
2002-06-17 17:43:21 +00:00
|
|
|
/usr/lib/java/include
|
2002-07-15 13:22:17 +00:00
|
|
|
/usr/local/lib/java/include
|
2008-07-20 19:50:13 +00:00
|
|
|
/usr/lib/jvm/java/include
|
2009-04-21 21:12:32 +00:00
|
|
|
/usr/lib/jvm/java-6-sun/include
|
|
|
|
/usr/lib/jvm/java-1.5.0-sun/include
|
|
|
|
/usr/lib/jvm/java-6-sun-1.6.0.00/include # can this one be removed according to #8821 ? Alex
|
2009-09-30 18:15:23 +00:00
|
|
|
/usr/lib/jvm/java-6-openjdk/include
|
2006-10-12 17:12:37 +00:00
|
|
|
/usr/local/share/java/include
|
2005-02-10 03:46:33 +00:00
|
|
|
/usr/lib/j2sdk1.4-sun/include
|
2005-09-08 14:03:51 +00:00
|
|
|
/usr/lib/j2sdk1.5-sun/include
|
2005-09-23 18:38:51 +00:00
|
|
|
/opt/sun-jdk-1.5.0.04/include
|
2009-09-30 18:15:23 +00:00
|
|
|
# Debian specific path for default JVM
|
|
|
|
/usr/lib/jvm/default-java/include
|
2003-02-11 18:37:19 +00:00
|
|
|
)
|
|
|
|
|
2004-02-06 15:49:46 +00:00
|
|
|
FOREACH(JAVA_PROG "${JAVA_RUNTIME}" "${JAVA_COMPILE}" "${JAVA_ARCHIVE}")
|
|
|
|
GET_FILENAME_COMPONENT(jpath "${JAVA_PROG}" PATH)
|
|
|
|
FOREACH(JAVA_INC_PATH ../include ../java/include ../share/java/include)
|
|
|
|
IF(EXISTS ${jpath}/${JAVA_INC_PATH})
|
|
|
|
SET(JAVA_AWT_INCLUDE_DIRECTORIES ${JAVA_AWT_INCLUDE_DIRECTORIES} "${jpath}/${JAVA_INC_PATH}")
|
|
|
|
ENDIF(EXISTS ${jpath}/${JAVA_INC_PATH})
|
|
|
|
ENDFOREACH(JAVA_INC_PATH)
|
|
|
|
FOREACH(JAVA_LIB_PATH
|
|
|
|
../lib ../jre/lib ../jre/lib/i386
|
|
|
|
../java/lib ../java/jre/lib ../java/jre/lib/i386
|
|
|
|
../share/java/lib ../share/java/jre/lib ../share/java/jre/lib/i386)
|
|
|
|
IF(EXISTS ${jpath}/${JAVA_LIB_PATH})
|
|
|
|
SET(JAVA_AWT_LIBRARY_DIRECTORIES ${JAVA_AWT_LIBRARY_DIRECTORIES} "${jpath}/${JAVA_LIB_PATH}")
|
|
|
|
ENDIF(EXISTS ${jpath}/${JAVA_LIB_PATH})
|
|
|
|
ENDFOREACH(JAVA_LIB_PATH)
|
|
|
|
ENDFOREACH(JAVA_PROG)
|
|
|
|
|
2003-02-11 18:37:19 +00:00
|
|
|
IF(APPLE)
|
2006-10-27 19:59:40 +00:00
|
|
|
IF(EXISTS ~/Library/Frameworks/JavaVM.framework)
|
2003-02-11 18:37:19 +00:00
|
|
|
SET(JAVA_HAVE_FRAMEWORK 1)
|
2006-10-27 19:59:40 +00:00
|
|
|
ENDIF(EXISTS ~/Library/Frameworks/JavaVM.framework)
|
|
|
|
IF(EXISTS /Library/Frameworks/JavaVM.framework)
|
2003-02-11 18:37:19 +00:00
|
|
|
SET(JAVA_HAVE_FRAMEWORK 1)
|
2006-10-27 19:59:40 +00:00
|
|
|
ENDIF(EXISTS /Library/Frameworks/JavaVM.framework)
|
2007-04-04 17:43:12 +00:00
|
|
|
IF(EXISTS /System/Library/Frameworks/JavaVM.framework)
|
|
|
|
SET(JAVA_HAVE_FRAMEWORK 1)
|
|
|
|
ENDIF(EXISTS /System/Library/Frameworks/JavaVM.framework)
|
|
|
|
|
2003-02-11 18:37:19 +00:00
|
|
|
IF(JAVA_HAVE_FRAMEWORK)
|
2003-02-11 18:56:35 +00:00
|
|
|
IF(NOT JAVA_AWT_LIBRARY)
|
2006-10-24 14:03:39 +00:00
|
|
|
SET (JAVA_AWT_LIBRARY "-framework JavaVM" CACHE FILEPATH "Java Frameworks" FORCE)
|
2003-02-11 18:56:35 +00:00
|
|
|
ENDIF(NOT JAVA_AWT_LIBRARY)
|
2007-04-04 17:43:12 +00:00
|
|
|
|
2006-10-27 21:29:05 +00:00
|
|
|
IF(NOT JAVA_JVM_LIBRARY)
|
|
|
|
SET (JAVA_JVM_LIBRARY "-framework JavaVM" CACHE FILEPATH "Java Frameworks" FORCE)
|
|
|
|
ENDIF(NOT JAVA_JVM_LIBRARY)
|
2007-04-04 17:43:12 +00:00
|
|
|
|
|
|
|
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
|
2003-02-11 19:49:11 +00:00
|
|
|
~/Library/Frameworks/JavaVM.framework/Headers
|
|
|
|
/Library/Frameworks/JavaVM.framework/Headers
|
|
|
|
/System/Library/Frameworks/JavaVM.framework/Headers
|
2007-04-04 17:43:12 +00:00
|
|
|
${JAVA_AWT_INCLUDE_DIRECTORIES}
|
2003-02-11 19:49:11 +00:00
|
|
|
)
|
2003-02-11 18:37:19 +00:00
|
|
|
ENDIF(JAVA_HAVE_FRAMEWORK)
|
2003-02-11 19:49:11 +00:00
|
|
|
ELSE(APPLE)
|
|
|
|
FIND_LIBRARY(JAVA_AWT_LIBRARY jawt
|
|
|
|
PATHS ${JAVA_AWT_LIBRARY_DIRECTORIES}
|
|
|
|
)
|
2006-12-26 13:47:15 +00:00
|
|
|
FIND_LIBRARY(JAVA_JVM_LIBRARY NAMES jvm JavaVM
|
2006-10-27 21:29:05 +00:00
|
|
|
PATHS ${JAVA_JVM_LIBRARY_DIRECTORIES}
|
|
|
|
)
|
2003-02-11 18:37:19 +00:00
|
|
|
ENDIF(APPLE)
|
|
|
|
|
|
|
|
# add in the include path
|
|
|
|
FIND_PATH(JAVA_INCLUDE_PATH jni.h
|
|
|
|
${JAVA_AWT_INCLUDE_DIRECTORIES}
|
2001-06-06 13:43:54 +00:00
|
|
|
)
|
|
|
|
|
2001-05-04 14:13:37 +00:00
|
|
|
FIND_PATH(JAVA_INCLUDE_PATH2 jni_md.h
|
2009-10-29 17:48:32 +00:00
|
|
|
${JAVA_INCLUDE_PATH}
|
2001-05-04 14:13:37 +00:00
|
|
|
${JAVA_INCLUDE_PATH}/win32
|
|
|
|
${JAVA_INCLUDE_PATH}/linux
|
2008-07-20 19:45:49 +00:00
|
|
|
${JAVA_INCLUDE_PATH}/freebsd
|
2009-11-02 09:03:06 +00:00
|
|
|
${JAVA_INCLUDE_PATH}/solaris
|
2011-03-28 15:57:04 +00:00
|
|
|
${JAVA_INCLUDE_PATH}/hp-ux
|
|
|
|
${JAVA_INCLUDE_PATH}/alpha
|
2001-05-04 14:13:37 +00:00
|
|
|
)
|
2001-06-06 13:43:54 +00:00
|
|
|
|
2007-04-04 17:43:12 +00:00
|
|
|
FIND_PATH(JAVA_AWT_INCLUDE_PATH jawt.h
|
|
|
|
${JAVA_INCLUDE_PATH}
|
|
|
|
)
|
2001-12-20 02:51:39 +00:00
|
|
|
|
Modules: Include builtin FindPackageHandleStandardArgs directly
The FindPackageHandleStandardArgs module was originally created outside
of CMake. It was added for CMake 2.6.0 by commit e118a627 (add a macro
FIND_PACKAGE_HANDLE_STANDARD_ARGS..., 2007-07-18). However, it also
proliferated into a number of other projects that at the time required
only CMake 2.4 and thus could not depend on CMake to provide the module.
CMake's own find modules started using the module in commit b5f656e0
(use the new FIND_PACKAGE_HANDLE_STANDARD_ARGS in some of the FindXXX
modules..., 2007-07-18).
Then commit d358cf5c (add 2nd, more powerful mode to
find_package_handle_standard_args, 2010-07-29) added a new feature to
the interface of the module that was fully optional and backward
compatible with all existing users of the module. Later commit 5f183caa
(FindZLIB: use the FPHSA version mode, 2010-08-04) and others shortly
thereafter started using the new interface in CMake's own find modules.
This change was also backward compatible because it was only an
implementation detail within each module.
Unforutnately these changes introduced a problem for projects that still
have an old copy of FindPackageHandleStandardArgs in CMAKE_MODULE_PATH.
When any such project uses one of CMake's builtin find modules the line
include(FindPackageHandleStandardArgs)
loads the copy from the project which does not have the new interface!
Then the including find module tries to use the new interface with the
old module and fails.
Whether this breakage can be considered a backward incompatible change
in CMake is debatable. The situation is analagous to copying a standard
library header from one version of a compiler into a project and then
observing problems when the next version of the compiler reports errors
in its other headers that depend on its new version of the original
header. Nevertheless it is a change to CMake that causes problems for
projects that worked with previous versions.
This problem was discovered during the 2.8.3 release candidate cycle.
It is an instance of a more general problem with projects that provide
their own versions of CMake modules when other CMake modules depend on
them. At the time we resolved this instance of the problem with commit
b0118402 (Use absolute path to FindPackageHandleStandardArgs.cmake
everywhere, 2010-09-28) for the 2.8.3 release.
In order to address the more general problem we introduced policy
CMP0017 in commit db44848f (Prefer files from CMAKE_ROOT when including
from CMAKE_ROOT, 2010-11-17). That change was followed by commit
ce28737c (Remove usage of CMAKE_CURRENT_LIST_DIR now that we have
CMP0017, 2010-12-20) which reverted the original workaround in favor of
using the policy. However, existing project releases do not set the
policy behavior to NEW and therefore still exhibit the problem.
We introduced in commit a364daf1 (Allow users to specify defaults for
unset policies, 2011-01-03) an option for users to build existing
projects by adding -DCMAKE_POLICY_DEFAULT_CMP0017=NEW to the command
line. Unfortunately this solution still does not allow such projects to
build out of the box, and there is no good way to suggest the use of the
new option.
The only remaining solution to keep existing projects that exhibit this
problem building is to restore the change originally made in commit
b0118402 (Use absolute path to FindPackageHandleStandardArgs.cmake
everywhere, 2010-09-28). This also avoids policy CMP0017 warnings for
this particular instance of the problem the policy addresses.
2011-01-20 15:56:49 +00:00
|
|
|
INCLUDE(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
|
2009-12-21 20:56:05 +00:00
|
|
|
FIND_PACKAGE_HANDLE_STANDARD_ARGS(JNI DEFAULT_MSG JAVA_AWT_LIBRARY JAVA_JVM_LIBRARY
|
|
|
|
JAVA_INCLUDE_PATH JAVA_INCLUDE_PATH2 JAVA_AWT_INCLUDE_PATH)
|
|
|
|
|
2001-12-20 02:51:39 +00:00
|
|
|
MARK_AS_ADVANCED(
|
|
|
|
JAVA_AWT_LIBRARY
|
2006-10-27 21:30:26 +00:00
|
|
|
JAVA_JVM_LIBRARY
|
2001-12-20 02:51:39 +00:00
|
|
|
JAVA_AWT_INCLUDE_PATH
|
|
|
|
JAVA_INCLUDE_PATH
|
|
|
|
JAVA_INCLUDE_PATH2
|
|
|
|
)
|
2008-07-20 19:39:02 +00:00
|
|
|
|
|
|
|
SET(JNI_LIBRARIES
|
|
|
|
${JAVA_AWT_LIBRARY}
|
|
|
|
${JAVA_JVM_LIBRARY}
|
|
|
|
)
|
|
|
|
|
|
|
|
SET(JNI_INCLUDE_DIRS
|
|
|
|
${JAVA_INCLUDE_PATH}
|
|
|
|
${JAVA_INCLUDE_PATH2}
|
|
|
|
${JAVA_AWT_INCLUDE_PATH}
|
|
|
|
)
|
|
|
|
|