diff --git a/Source/cmDocumentVariables.cxx b/Source/cmDocumentVariables.cxx index bbe90d24a..85d8c85a5 100644 --- a/Source/cmDocumentVariables.cxx +++ b/Source/cmDocumentVariables.cxx @@ -203,8 +203,10 @@ void cmDocumentVariables::DefineVariables(cmake* cm) ("CMAKE_EXECUTABLE_SUFFIX", cmProperty::VARIABLE, "The suffix for executables on this platform.", "The suffix to use for the end of an executable if any, " - ".exe on Windows.",false, - "Variables that Provide Information"); + ".exe on Windows." + "\n" + "CMAKE_EXECUTABLE_SUFFIX_ overrides this for language ." + ,false, "Variables that Provide Information"); cm->DefineProperty ("CMAKE_MAJOR_VERSION", cmProperty::VARIABLE, "The Major version of cmake (i.e. the 2 in 2.X.X)", @@ -346,52 +348,60 @@ void cmDocumentVariables::DefineVariables(cmake* cm) ("CMAKE_IMPORT_LIBRARY_PREFIX", cmProperty::VARIABLE, "The prefix for import libraries that you link to.", "The prefix to use for the name of an import library if used " - "on this platform.", - false, - "Variables that Provide Information"); + "on this platform." + "\n" + "CMAKE_IMPORT_LIBRARY_PREFIX_ overrides this for language ." + ,false, "Variables that Provide Information"); cm->DefineProperty ("CMAKE_IMPORT_LIBRARY_SUFFIX", cmProperty::VARIABLE, "The suffix for import libraries that you link to.", "The suffix to use for the end of an import library if used " - "on this platform.", - false, - "Variables that Provide Information"); + "on this platform." + "\n" + "CMAKE_IMPORT_LIBRARY_SUFFIX_ overrides this for language ." + ,false, "Variables that Provide Information"); cm->DefineProperty ("CMAKE_SHARED_LIBRARY_PREFIX", cmProperty::VARIABLE, "The prefix for shared libraries that you link to.", - "The prefix to use for the name of a shared library, lib on UNIX.", - false, - "Variables that Provide Information"); + "The prefix to use for the name of a shared library, lib on UNIX." + "\n" + "CMAKE_SHARED_LIBRARY_PREFIX_ overrides this for language ." + ,false, "Variables that Provide Information"); cm->DefineProperty ("CMAKE_SHARED_LIBRARY_SUFFIX", cmProperty::VARIABLE, "The suffix for shared libraries that you link to.", - "The suffix to use for the end of a shared library, .dll on Windows.", - false, - "Variables that Provide Information"); + "The suffix to use for the end of a shared library, .dll on Windows." + "\n" + "CMAKE_SHARED_LIBRARY_SUFFIX_ overrides this for language ." + ,false, "Variables that Provide Information"); cm->DefineProperty ("CMAKE_SHARED_MODULE_PREFIX", cmProperty::VARIABLE, "The prefix for loadable modules that you link to.", - "The prefix to use for the name of a loadable module on this platform.", - false, - "Variables that Provide Information"); + "The prefix to use for the name of a loadable module on this platform." + "\n" + "CMAKE_SHARED_MODULE_PREFIX_ overrides this for language ." + ,false, "Variables that Provide Information"); cm->DefineProperty ("CMAKE_SHARED_MODULE_SUFFIX", cmProperty::VARIABLE, "The suffix for shared libraries that you link to.", - "The suffix to use for the end of a loadable module on this platform", - false, - "Variables that Provide Information"); + "The suffix to use for the end of a loadable module on this platform" + "\n" + "CMAKE_SHARED_MODULE_SUFFIX_ overrides this for language ." + ,false, "Variables that Provide Information"); cm->DefineProperty ("CMAKE_STATIC_LIBRARY_PREFIX", cmProperty::VARIABLE, "The prefix for static libraries that you link to.", - "The prefix to use for the name of a static library, lib on UNIX.", - false, - "Variables that Provide Information"); + "The prefix to use for the name of a static library, lib on UNIX." + "\n" + "CMAKE_STATIC_LIBRARY_PREFIX_ overrides this for language ." + ,false, "Variables that Provide Information"); cm->DefineProperty ("CMAKE_STATIC_LIBRARY_SUFFIX", cmProperty::VARIABLE, "The suffix for static libraries that you link to.", - "The suffix to use for the end of a static library, .lib on Windows.", - false, - "Variables that Provide Information"); + "The suffix to use for the end of a static library, .lib on Windows." + "\n" + "CMAKE_STATIC_LIBRARY_SUFFIX_ overrides this for language ." + ,false, "Variables that Provide Information"); cm->DefineProperty ("CMAKE_EXTRA_SHARED_LIBRARY_SUFFIXES", cmProperty::VARIABLE, "Additional suffixes for shared libraries.", @@ -1245,12 +1255,18 @@ void cmDocumentVariables::DefineVariables(cmake* cm) cmProperty::VARIABLE,0,0); cm->DefineProperty("CMAKE__USE_RESPONSE_FILE_FOR_OBJECTS", cmProperty::VARIABLE,0,0); + cm->DefineProperty("CMAKE_EXECUTABLE_SUFFIX_", + cmProperty::VARIABLE,0,0); cm->DefineProperty("CMAKE_EXE_LINK_DYNAMIC__FLAGS", cmProperty::VARIABLE,0,0); cm->DefineProperty("CMAKE_EXE_LINK_STATIC__FLAGS", cmProperty::VARIABLE,0,0); cm->DefineProperty("CMAKE_GENERATOR_", cmProperty::VARIABLE,0,0); + cm->DefineProperty("CMAKE_IMPORT_LIBRARY_PREFIX_", + cmProperty::VARIABLE,0,0); + cm->DefineProperty("CMAKE_IMPORT_LIBRARY_SUFFIX_", + cmProperty::VARIABLE,0,0); cm->DefineProperty("CMAKE_INCLUDE_FLAG_", cmProperty::VARIABLE,0,0); cm->DefineProperty("CMAKE_INCLUDE_FLAG_SEP_", @@ -1269,6 +1285,10 @@ void cmDocumentVariables::DefineVariables(cmake* cm) cmProperty::VARIABLE,0,0); cm->DefineProperty("CMAKE_SHARED_LIBRARY_LINK_STATIC__FLAGS", cmProperty::VARIABLE,0,0); + cm->DefineProperty("CMAKE_SHARED_LIBRARY_PREFIX_", + cmProperty::VARIABLE,0,0); + cm->DefineProperty("CMAKE_SHARED_LIBRARY_SUFFIX_", + cmProperty::VARIABLE,0,0); cm->DefineProperty("CMAKE_SHARED_LIBRARY_RUNTIME__FLAG", cmProperty::VARIABLE,0,0); cm->DefineProperty("CMAKE_SHARED_LIBRARY_RUNTIME__FLAG_SEP", @@ -1291,10 +1311,18 @@ void cmDocumentVariables::DefineVariables(cmake* cm) cmProperty::VARIABLE,0,0); cm->DefineProperty("CMAKE_SHARED_MODULE_LINK_STATIC__FLAGS", cmProperty::VARIABLE,0,0); + cm->DefineProperty("CMAKE_SHARED_MODULE_PREFIX_", + cmProperty::VARIABLE,0,0); + cm->DefineProperty("CMAKE_SHARED_MODULE_SUFFIX_", + cmProperty::VARIABLE,0,0); cm->DefineProperty("CMAKE_SHARED_MODULE_RUNTIME__FLAG", cmProperty::VARIABLE,0,0); cm->DefineProperty("CMAKE_SHARED_MODULE_RUNTIME__FLAG_SEP", cmProperty::VARIABLE,0,0); + cm->DefineProperty("CMAKE_STATIC_LIBRARY_PREFIX_", + cmProperty::VARIABLE,0,0); + cm->DefineProperty("CMAKE_STATIC_LIBRARY_SUFFIX_", + cmProperty::VARIABLE,0,0); cm->DefineProperty("CMAKE_LINK_DEPENDENT_LIBRARY_FILES", cmProperty::VARIABLE,0,0); cm->DefineProperty("CMAKE_LINK_DEPENDENT_LIBRARY_DIRS", diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx index 32c16880e..6c9197c1a 100644 --- a/Source/cmTarget.cxx +++ b/Source/cmTarget.cxx @@ -2709,6 +2709,21 @@ void cmTarget::GetFullNameInternal(const char* config, const char* prefixVar = this->GetPrefixVariableInternal(implib); const char* suffixVar = this->GetSuffixVariableInternal(implib); + // Check for language-specific default prefix and suffix. + if(const char* ll = this->GetLinkerLanguage(config)) + { + if(!targetSuffix && suffixVar && *suffixVar) + { + std::string langSuff = suffixVar + std::string("_") + ll; + targetSuffix = this->Makefile->GetDefinition(langSuff.c_str()); + } + if(!targetPrefix && prefixVar && *prefixVar) + { + std::string langPrefix = prefixVar + std::string("_") + ll; + targetPrefix = this->Makefile->GetDefinition(langPrefix.c_str()); + } + } + // if there is no prefix on the target use the cmake definition if(!targetPrefix && prefixVar) {