summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBill Hoffman <bill.hoffman@kitware.com>2004-09-27 11:36:29 -0400
committerBill Hoffman <bill.hoffman@kitware.com>2004-09-27 11:36:29 -0400
commit016e0e52cb758267f1af945b55d2ac5383f4e226 (patch)
tree92bdbec0c93b22a412663aab64587426c96378e2
parentf5b978fe2f03c865549d4d0e3c9aebc8edc50288 (diff)
downloadcmake-016e0e52cb758267f1af945b55d2ac5383f4e226.tar.gz
BUG: make sure java jar files are not libfoo.jar but are just foo.jar
-rw-r--r--Modules/CMakeJavaCompiler.cmake.in2
-rw-r--r--Modules/CMakeJavaInformation.cmake1
-rw-r--r--Source/cmLocalUnixMakefileGenerator.cxx15
3 files changed, 15 insertions, 3 deletions
diff --git a/Modules/CMakeJavaCompiler.cmake.in b/Modules/CMakeJavaCompiler.cmake.in
index c0dc075d0c..0c3eaf6da1 100644
--- a/Modules/CMakeJavaCompiler.cmake.in
+++ b/Modules/CMakeJavaCompiler.cmake.in
@@ -6,3 +6,5 @@ SET(CMAKE_Java_COMPILER_LOADED 1)
SET(CMAKE_Java_SOURCE_FILE_EXTENSIONS java)
SET(CMAKE_Java_LINKER_PREFERENCE Prefered)
SET(CMAKE_Java_OUTPUT_EXTENSION .class)
+SET(CMAKE_STATIC_LIBRARY_PREFIX_Java "")
+SET(CMAKE_STATIC_LIBRARY_SUFFIX_Java ".jar")
diff --git a/Modules/CMakeJavaInformation.cmake b/Modules/CMakeJavaInformation.cmake
index d9a8a31aae..b890694631 100644
--- a/Modules/CMakeJavaInformation.cmake
+++ b/Modules/CMakeJavaInformation.cmake
@@ -1,5 +1,4 @@
# this is a place holder if java needed flags for javac they would go here.
-SET(CMAKE_STATIC_LIBRARY_SUFFIX_Java ".jar")
IF(NOT CMAKE_Java_CREATE_STATIC_LIBRARY)
SET(CMAKE_Java_CREATE_STATIC_LIBRARY
"<CMAKE_Java_ARCHIVE> -cf <TARGET> *.class")
diff --git a/Source/cmLocalUnixMakefileGenerator.cxx b/Source/cmLocalUnixMakefileGenerator.cxx
index 0dab6bfb2a..1131e830e2 100644
--- a/Source/cmLocalUnixMakefileGenerator.cxx
+++ b/Source/cmLocalUnixMakefileGenerator.cxx
@@ -342,8 +342,19 @@ std::string cmLocalUnixMakefileGenerator::GetBaseTargetName(const char* n,
}
// if there is no prefix on the target use the cmake definition
if(!targetPrefix && prefixVar)
- {
- targetPrefix = m_Makefile->GetSafeDefinition(prefixVar);
+ {
+ // first check for a language specific suffix var
+ const char* ll = t.GetLinkerLanguage(this->GetGlobalGenerator());
+ if(ll)
+ {
+ std::string langPrefix = prefixVar + std::string("_") + ll;
+ targetPrefix = m_Makefile->GetDefinition(langPrefix.c_str());
+ }
+ // if there not a language specific suffix then use the general one
+ if(!targetPrefix)
+ {
+ targetPrefix = m_Makefile->GetSafeDefinition(prefixVar);
+ }
}
std::string name = pathPrefix + (targetPrefix?targetPrefix:"");
name += n;