diff options
author | Bill Hoffman <bill.hoffman@kitware.com> | 2004-10-21 18:34:02 (GMT) |
---|---|---|
committer | Bill Hoffman <bill.hoffman@kitware.com> | 2004-10-21 18:34:02 (GMT) |
commit | 7cef36c628a8ef07a0c53ea08691e4e6b949a695 (patch) | |
tree | 6dddd32ad310a5a069b66462cc79ca3fea15f024 /Source/cmTarget.cxx | |
parent | 8ff4c079159a8c5a53017ff1b02c8ac591eb2727 (diff) | |
download | CMake-7cef36c628a8ef07a0c53ea08691e4e6b949a695.zip CMake-7cef36c628a8ef07a0c53ea08691e4e6b949a695.tar.gz CMake-7cef36c628a8ef07a0c53ea08691e4e6b949a695.tar.bz2 |
ENH: add the ability to generate custom commands for a language that is not supported by an IDE
Diffstat (limited to 'Source/cmTarget.cxx')
-rw-r--r-- | Source/cmTarget.cxx | 73 |
1 files changed, 69 insertions, 4 deletions
diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx index 39f450e..aa75573 100644 --- a/Source/cmTarget.cxx +++ b/Source/cmTarget.cxx @@ -769,10 +769,7 @@ const char* cmTarget::GetLinkerLanguage(cmGlobalGenerator* gg) const } if(languages.size() == 0) { - std::string m = "Error Target: "; - m += m_Name + " contains no source files with an enabled languages."; - cmSystemTools::Error(m.c_str()); - return "(NullLanguage)"; + return 0; } if(languages.size() == 1) { @@ -809,3 +806,71 @@ const char* cmTarget::GetLinkerLanguage(cmGlobalGenerator* gg) const const_cast<cmTarget*>(this)->SetProperty("LINKER_LANGUAGE", prefLang); return this->GetProperty("LINKER_LANGUAGE"); } + +const char* cmTarget::GetCreateRuleVariable() +{ + switch(this->GetType()) + { + case cmTarget::STATIC_LIBRARY: + return "_CREATE_STATIC_LIBRARY"; + break; + case cmTarget::SHARED_LIBRARY: + return "_CREATE_SHARED_LIBRARY"; + break; + case cmTarget::MODULE_LIBRARY: + return "_CREATE_SHARED_MODULE"; + break; + case cmTarget::EXECUTABLE: + return "_LINK_EXECUTABLE"; + break; + } + return ""; +} + + +const char* cmTarget::GetSuffixVariable() const +{ + switch(this->GetType()) + { + case cmTarget::STATIC_LIBRARY: + return "CMAKE_STATIC_LIBRARY_SUFFIX"; + break; + case cmTarget::SHARED_LIBRARY: + return "CMAKE_SHARED_LIBRARY_SUFFIX"; + break; + case cmTarget::MODULE_LIBRARY: + return "CMAKE_SHARED_MODULE_SUFFIX"; + break; + case cmTarget::EXECUTABLE: + return cmSystemTools::GetExecutableExtension(); + case cmTarget::UTILITY: + case cmTarget::INSTALL_FILES: + case cmTarget::INSTALL_PROGRAMS: + break; + } + return ""; +} + + +const char* cmTarget::GetPrefixVariable() const +{ + switch(this->GetType()) + { + case cmTarget::STATIC_LIBRARY: + return "CMAKE_STATIC_LIBRARY_PREFIX"; + break; + case cmTarget::SHARED_LIBRARY: + return "CMAKE_SHARED_LIBRARY_PREFIX"; + break; + case cmTarget::MODULE_LIBRARY: + return "CMAKE_SHARED_MODULE_PREFIX"; + break; + case cmTarget::EXECUTABLE: + return cmSystemTools::GetExecutableExtension(); + case cmTarget::UTILITY: + case cmTarget::INSTALL_FILES: + case cmTarget::INSTALL_PROGRAMS: + break; + } + return ""; +} |