diff options
author | Brad King <brad.king@kitware.com> | 2009-07-08 18:33:08 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2009-07-08 18:33:08 (GMT) |
commit | 99e432508eabcfd5ce42ffd9a88029332d178cc2 (patch) | |
tree | cbfb570c3e23b3de0fbb441fac27b951d9874e81 | |
parent | 173448d9886deccb7cadd4fd0ffeaa236fa66e49 (diff) | |
download | CMake-99e432508eabcfd5ce42ffd9a88029332d178cc2.zip CMake-99e432508eabcfd5ce42ffd9a88029332d178cc2.tar.gz CMake-99e432508eabcfd5ce42ffd9a88029332d178cc2.tar.bz2 |
BUG: Use link language for target name computation
The commit "Do not compute link language for LOCATION" was wrong. The
variables
CMAKE_STATIC_LIBRARY_PREFIX_Java
CMAKE_STATIC_LIBRARY_SUFFIX_Java
are used for building Java .jar files. This commit re-enables the
feature and documents the variables:
CMAKE_EXECUTABLE_SUFFIX_<LANG>
CMAKE_IMPORT_LIBRARY_PREFIX_<LANG>
CMAKE_IMPORT_LIBRARY_SUFFIX_<LANG>
CMAKE_SHARED_LIBRARY_PREFIX_<LANG>
CMAKE_SHARED_LIBRARY_SUFFIX_<LANG>
CMAKE_SHARED_MODULE_PREFIX_<LANG>
CMAKE_SHARED_MODULE_SUFFIX_<LANG>
CMAKE_STATIC_LIBRARY_PREFIX_<LANG>
CMAKE_STATIC_LIBRARY_SUFFIX_<LANG>
Instead of making separate, repetitive entries for the _<LANG> variable
documentation, we just mention the per-language name in the text of the
platform-wide variable documentation. Internally we keep undocumented
definitions of these properties to satisfy CMAKE_STRICT mode.
-rw-r--r-- | Source/cmDocumentVariables.cxx | 80 | ||||
-rw-r--r-- | Source/cmTarget.cxx | 15 |
2 files changed, 69 insertions, 26 deletions
diff --git a/Source/cmDocumentVariables.cxx b/Source/cmDocumentVariables.cxx index bbe90d2..85d8c85 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_<LANG> overrides this for language <LANG>." + ,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_<LANG> overrides this for language <LANG>." + ,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_<LANG> overrides this for language <LANG>." + ,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_<LANG> overrides this for language <LANG>." + ,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_<LANG> overrides this for language <LANG>." + ,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_<LANG> overrides this for language <LANG>." + ,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_<LANG> overrides this for language <LANG>." + ,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_<LANG> overrides this for language <LANG>." + ,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_<LANG> overrides this for language <LANG>." + ,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_<LANG>_USE_RESPONSE_FILE_FOR_OBJECTS", cmProperty::VARIABLE,0,0); + cm->DefineProperty("CMAKE_EXECUTABLE_SUFFIX_<LANG>", + cmProperty::VARIABLE,0,0); cm->DefineProperty("CMAKE_EXE_LINK_DYNAMIC_<LANG>_FLAGS", cmProperty::VARIABLE,0,0); cm->DefineProperty("CMAKE_EXE_LINK_STATIC_<LANG>_FLAGS", cmProperty::VARIABLE,0,0); cm->DefineProperty("CMAKE_GENERATOR_<LANG>", cmProperty::VARIABLE,0,0); + cm->DefineProperty("CMAKE_IMPORT_LIBRARY_PREFIX_<LANG>", + cmProperty::VARIABLE,0,0); + cm->DefineProperty("CMAKE_IMPORT_LIBRARY_SUFFIX_<LANG>", + cmProperty::VARIABLE,0,0); cm->DefineProperty("CMAKE_INCLUDE_FLAG_<LANG>", cmProperty::VARIABLE,0,0); cm->DefineProperty("CMAKE_INCLUDE_FLAG_SEP_<LANG>", @@ -1269,6 +1285,10 @@ void cmDocumentVariables::DefineVariables(cmake* cm) cmProperty::VARIABLE,0,0); cm->DefineProperty("CMAKE_SHARED_LIBRARY_LINK_STATIC_<LANG>_FLAGS", cmProperty::VARIABLE,0,0); + cm->DefineProperty("CMAKE_SHARED_LIBRARY_PREFIX_<LANG>", + cmProperty::VARIABLE,0,0); + cm->DefineProperty("CMAKE_SHARED_LIBRARY_SUFFIX_<LANG>", + cmProperty::VARIABLE,0,0); cm->DefineProperty("CMAKE_SHARED_LIBRARY_RUNTIME_<LANG>_FLAG", cmProperty::VARIABLE,0,0); cm->DefineProperty("CMAKE_SHARED_LIBRARY_RUNTIME_<LANG>_FLAG_SEP", @@ -1291,10 +1311,18 @@ void cmDocumentVariables::DefineVariables(cmake* cm) cmProperty::VARIABLE,0,0); cm->DefineProperty("CMAKE_SHARED_MODULE_LINK_STATIC_<LANG>_FLAGS", cmProperty::VARIABLE,0,0); + cm->DefineProperty("CMAKE_SHARED_MODULE_PREFIX_<LANG>", + cmProperty::VARIABLE,0,0); + cm->DefineProperty("CMAKE_SHARED_MODULE_SUFFIX_<LANG>", + cmProperty::VARIABLE,0,0); cm->DefineProperty("CMAKE_SHARED_MODULE_RUNTIME_<LANG>_FLAG", cmProperty::VARIABLE,0,0); cm->DefineProperty("CMAKE_SHARED_MODULE_RUNTIME_<LANG>_FLAG_SEP", cmProperty::VARIABLE,0,0); + cm->DefineProperty("CMAKE_STATIC_LIBRARY_PREFIX_<LANG>", + cmProperty::VARIABLE,0,0); + cm->DefineProperty("CMAKE_STATIC_LIBRARY_SUFFIX_<LANG>", + 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 32c1688..6c9197c 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) { |