summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBill Hoffman <bill.hoffman@kitware.com>2008-07-25 23:23:54 -0400
committerBill Hoffman <bill.hoffman@kitware.com>2008-07-25 23:23:54 -0400
commite23aeb399aea6b8218ef3412bb5bc8d68420c806 (patch)
tree02db4ad99aa62f86cd02ba4d89cea7fef1cd67fd
parent7c473defceeea01203d47e0aa3a103bc2c069220 (diff)
downloadcmake-e23aeb399aea6b8218ef3412bb5bc8d68420c806.tar.gz
ENH: merge in from main tree and fix bug for flex and yacc stuff in SecondLife
-rw-r--r--CMakeLists.txt2
-rw-r--r--ChangeLog.manual3
-rw-r--r--Modules/FindJNI.cmake34
-rw-r--r--Source/cmSourceFileLocation.cxx30
4 files changed, 64 insertions, 5 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 8378b0dcc9..9636aa1ff4 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -354,7 +354,7 @@ ENDMACRO (CMAKE_BUILD_UTILITIES)
SET(CMake_VERSION_MAJOR 2)
SET(CMake_VERSION_MINOR 6)
SET(CMake_VERSION_PATCH 1)
-SET(CMake_VERSION_RC 12)
+SET(CMake_VERSION_RC 13)
# CVS versions are odd, if this is an odd minor version
# then set the CMake_VERSION_DATE variable
IF("${CMake_VERSION_MINOR}" MATCHES "[13579]$")
diff --git a/ChangeLog.manual b/ChangeLog.manual
index c56dfc6acc..0ebcafc3b4 100644
--- a/ChangeLog.manual
+++ b/ChangeLog.manual
@@ -1,4 +1,7 @@
Changes in CMake 2.6.1 RC 12
+- More find locations for FindJNI.
+- Fix bug with source files ending in .l and .l.cpp, causing cmake
+ to think they were the same file in some cases.
- Fix issue with .lib being seen as .obj with VS due to a full path
to a library given without the file extension. This only worked
with the VS generator, but some projects had worked around it with
diff --git a/Modules/FindJNI.cmake b/Modules/FindJNI.cmake
index 26f473473b..bed0e1d0d2 100644
--- a/Modules/FindJNI.cmake
+++ b/Modules/FindJNI.cmake
@@ -3,35 +3,47 @@
# include files and libraries are. It also determines what the name of
# the library is. This code sets the following variables:
#
-# JAVA_AWT_LIB_PATH = the path to the jawt library
-# JAVA_JVM_LIB_PATH = the path to the jvm library
+# JNI_INCLUDE_DIRS = the include dirs to use
+# JNI_LIBRARIES = the libraries to use
+# JAVA_AWT_LIBRARY = the path to the jawt library
+# JAVA_JVM_LIBRARY = the path to the jvm library
# JAVA_INCLUDE_PATH = the include path to jni.h
# JAVA_INCLUDE_PATH2 = the include path to jni_md.h
# JAVA_AWT_INCLUDE_PATH = the include path to jawt.h
-#
+#
+
GET_FILENAME_COMPONENT(java_install_version
"[HKEY_LOCAL_MACHINE\\SOFTWARE\\JavaSoft\\Java Development Kit;CurrentVersion]" NAME)
+
SET(JAVA_AWT_LIBRARY_DIRECTORIES
"[HKEY_LOCAL_MACHINE\\SOFTWARE\\JavaSoft\\Java Development Kit\\1.4;JavaHome]/lib"
"[HKEY_LOCAL_MACHINE\\SOFTWARE\\JavaSoft\\Java Development Kit\\1.3;JavaHome]/lib"
"[HKEY_LOCAL_MACHINE\\SOFTWARE\\JavaSoft\\Java Development Kit\\${java_install_version};JavaHome]/lib"
$ENV{JAVA_HOME}/jre/lib/i386
$ENV{JAVA_HOME}/jre/lib/amd64
+ $ENV{JAVA_HOME}/jre/lib/ppc
/usr/lib
/usr/local/lib
+ /usr/lib/jvm/java/lib
/usr/lib/java/jre/lib/i386
/usr/local/lib/java/jre/lib/i386
/usr/local/share/java/jre/lib/i386
/usr/lib/j2sdk1.4-sun/jre/lib/i386
/usr/lib/j2sdk1.5-sun/jre/lib/i386
/opt/sun-jdk-1.5.0.04/jre/lib/amd64
- /usr/lib/java/jre/lib/amd64
/usr/lib/jvm/java-6-sun-1.6.0.00/jre/lib/amd64
+ /usr/lib/java/jre/lib/amd64
/usr/local/lib/java/jre/lib/amd64
/usr/local/share/java/jre/lib/amd64
/usr/lib/j2sdk1.4-sun/jre/lib/amd64
/usr/lib/j2sdk1.5-sun/jre/lib/amd64
+ /usr/lib/java/jre/lib/ppc
+ /usr/local/lib/java/jre/lib/ppc
+ /usr/local/share/java/jre/lib/ppc
+ /usr/lib/j2sdk1.4-sun/jre/lib/ppc
+ /usr/lib/j2sdk1.5-sun/jre/lib/ppc
)
+
SET(JAVA_JVM_LIBRARY_DIRECTORIES)
FOREACH(dir ${JAVA_AWT_LIBRARY_DIRECTORIES})
SET(JAVA_JVM_LIBRARY_DIRECTORIES
@@ -52,6 +64,7 @@ SET(JAVA_AWT_INCLUDE_DIRECTORIES
/usr/local/include
/usr/lib/java/include
/usr/local/lib/java/include
+ /usr/lib/jvm/java/include
/usr/lib/jvm/java-6-sun-1.6.0.00/include
/usr/local/share/java/include
/usr/lib/j2sdk1.4-sun/include
@@ -130,6 +143,7 @@ FIND_PATH(JAVA_INCLUDE_PATH2 jni_md.h
${JAVA_AWT_INCLUDE_DIRECTORIES}
${JAVA_INCLUDE_PATH}/win32
${JAVA_INCLUDE_PATH}/linux
+ ${JAVA_INCLUDE_PATH}/freebsd
)
FIND_PATH(JAVA_AWT_INCLUDE_PATH jawt.h
@@ -144,3 +158,15 @@ MARK_AS_ADVANCED(
JAVA_INCLUDE_PATH
JAVA_INCLUDE_PATH2
)
+
+SET(JNI_LIBRARIES
+ ${JAVA_AWT_LIBRARY}
+ ${JAVA_JVM_LIBRARY}
+)
+
+SET(JNI_INCLUDE_DIRS
+ ${JAVA_INCLUDE_PATH}
+ ${JAVA_INCLUDE_PATH2}
+ ${JAVA_AWT_INCLUDE_PATH}
+)
+
diff --git a/Source/cmSourceFileLocation.cxx b/Source/cmSourceFileLocation.cxx
index ad2f40c89b..274c0ed156 100644
--- a/Source/cmSourceFileLocation.cxx
+++ b/Source/cmSourceFileLocation.cxx
@@ -100,6 +100,36 @@ void cmSourceFileLocation::UpdateExtension(const char* name)
this->Name = cmSystemTools::GetFilenameName(name);
this->AmbiguousExtension = false;
}
+ else
+ {
+ // This is not a known extension. See if the file exists on disk as
+ // named.
+ std::string tryPath;
+ if(this->AmbiguousDirectory)
+ {
+ // Check the source tree only because a file in the build tree should
+ // be specified by full path at least once. We do not want this
+ // detection to depend on whether the project has already been built.
+ tryPath = this->Makefile->GetCurrentDirectory();
+ tryPath += "/";
+ }
+ tryPath += this->Directory;
+ tryPath += "/";
+ tryPath += this->Name;
+ if(cmSystemTools::FileExists(tryPath.c_str(), true))
+ {
+ // We found a source file named by the user on disk. Trust it's
+ // extension.
+ this->Name = cmSystemTools::GetFilenameName(name);
+ this->AmbiguousExtension = false;
+
+ // If the directory was ambiguous, it isn't anymore.
+ if(this->AmbiguousDirectory)
+ {
+ this->DirectoryUseSource();
+ }
+ }
+ }
}
//----------------------------------------------------------------------------