ENH: Renamed <CONFIG>_COMPILE_DEFINITIONS to COMPILE_DEFINITIONS_<CONFIG> for better documentation clarity.

This commit is contained in:
Brad King 2008-01-15 21:02:00 -05:00
parent 8e5e423f78
commit 80c2be45e0
7 changed files with 31 additions and 31 deletions

View File

@ -1303,8 +1303,8 @@ void cmGlobalXCodeGenerator::CreateBuildSettings(cmTarget& target,
this->AppendDefines(ppDefs, target.GetProperty("COMPILE_DEFINITIONS")); this->AppendDefines(ppDefs, target.GetProperty("COMPILE_DEFINITIONS"));
if(configName) if(configName)
{ {
std::string defVarName = cmSystemTools::UpperCase(configName); std::string defVarName = "COMPILE_DEFINITIONS_";
defVarName += "_COMPILE_DEFINITIONS"; defVarName += cmSystemTools::UpperCase(configName);
this->AppendDefines(ppDefs, target.GetProperty(defVarName.c_str())); this->AppendDefines(ppDefs, target.GetProperty(defVarName.c_str()));
} }
buildSettings->AddAttribute buildSettings->AddAttribute

View File

@ -417,21 +417,21 @@ void cmLocalVisualStudio6Generator
std::map<cmStdString, cmStdString> cdmap; std::map<cmStdString, cmStdString> cdmap;
this->AppendDefines(compileFlags, this->AppendDefines(compileFlags,
(*sf)->GetProperty("COMPILE_DEFINITIONS")); (*sf)->GetProperty("COMPILE_DEFINITIONS"));
if(const char* cdefs = (*sf)->GetProperty("DEBUG_COMPILE_DEFINITIONS")) if(const char* cdefs = (*sf)->GetProperty("COMPILE_DEFINITIONS_DEBUG"))
{ {
this->AppendDefines(cdmap["DEBUG"], cdefs); this->AppendDefines(cdmap["DEBUG"], cdefs);
} }
if(const char* cdefs = (*sf)->GetProperty("RELEASE_COMPILE_DEFINITIONS")) if(const char* cdefs = (*sf)->GetProperty("COMPILE_DEFINITIONS_RELEASE"))
{ {
this->AppendDefines(cdmap["RELEASE"], cdefs); this->AppendDefines(cdmap["RELEASE"], cdefs);
} }
if(const char* cdefs = if(const char* cdefs =
(*sf)->GetProperty("MINSIZEREL_COMPILE_DEFINITIONS")) (*sf)->GetProperty("COMPILE_DEFINITIONS_MINSIZEREL"))
{ {
this->AppendDefines(cdmap["MINSIZEREL"], cdefs); this->AppendDefines(cdmap["MINSIZEREL"], cdefs);
} }
if(const char* cdefs = if(const char* cdefs =
(*sf)->GetProperty("RELWITHDEBINFO_COMPILE_DEFINITIONS")) (*sf)->GetProperty("COMPILE_DEFINITIONS_RELWITHDEBINFO"))
{ {
this->AppendDefines(cdmap["RELWITHDEBINFO"], cdefs); this->AppendDefines(cdmap["RELWITHDEBINFO"], cdefs);
} }
@ -1505,15 +1505,15 @@ void cmLocalVisualStudio6Generator
// Add per-target and per-configuration preprocessor definitions. // Add per-target and per-configuration preprocessor definitions.
this->AppendDefines(flags, target.GetProperty("COMPILE_DEFINITIONS")); this->AppendDefines(flags, target.GetProperty("COMPILE_DEFINITIONS"));
this->AppendDefines(flagsDebug, this->AppendDefines(flagsDebug,
target.GetProperty("DEBUG_COMPILE_DEFINITIONS")); target.GetProperty("COMPILE_DEFINITIONS_DEBUG"));
this->AppendDefines(flagsRelease, this->AppendDefines(flagsRelease,
target.GetProperty("RELEASE_COMPILE_DEFINITIONS")); target.GetProperty("COMPILE_DEFINITIONS_RELEASE"));
this->AppendDefines this->AppendDefines
(flagsMinSize, (flagsMinSize,
target.GetProperty("MINSIZEREL_COMPILE_DEFINITIONS")); target.GetProperty("COMPILE_DEFINITIONS_MINSIZEREL"));
this->AppendDefines this->AppendDefines
(flagsDebugRel, (flagsDebugRel,
target.GetProperty("RELWITHDEBINFO_COMPILE_DEFINITIONS")); target.GetProperty("COMPILE_DEFINITIONS_RELWITHDEBINFO"));
// The template files have CXX FLAGS in them, that need to be replaced. // The template files have CXX FLAGS in them, that need to be replaced.
// There are not separate CXX and C template files, so we use the same // There are not separate CXX and C template files, so we use the same

View File

@ -521,8 +521,8 @@ void cmLocalVisualStudio7Generator::WriteConfiguration(std::ostream& fout,
} }
std::string configUpper = cmSystemTools::UpperCase(configName); std::string configUpper = cmSystemTools::UpperCase(configName);
std::string defPropName = configUpper; std::string defPropName = "COMPILE_DEFINITIONS_";
defPropName += "_COMPILE_DEFINITIONS"; defPropName += configUpper;
// Get preprocessor definitions for this directory. // Get preprocessor definitions for this directory.
std::string defineFlags = this->Makefile->GetDefineFlags(); std::string defineFlags = this->Makefile->GetDefineFlags();
@ -1093,8 +1093,8 @@ cmLocalVisualStudio7GeneratorFCInfo
fc.CompileDefs = cdefs; fc.CompileDefs = cdefs;
needfc = true; needfc = true;
} }
std::string defPropName = configUpper; std::string defPropName = "COMPILE_DEFINITIONS_";
defPropName += "_COMPILE_DEFINITIONS"; defPropName += configUpper;
if(const char* ccdefs = sf.GetProperty(defPropName.c_str())) if(const char* ccdefs = sf.GetProperty(defPropName.c_str()))
{ {
fc.CompileDefsConfig = ccdefs; fc.CompileDefsConfig = ccdefs;

View File

@ -268,9 +268,9 @@ void cmMakefileTargetGenerator::WriteTargetLanguageFlags()
// Add preprocessor definitions for this target and configuration. // Add preprocessor definitions for this target and configuration.
this->LocalGenerator->AppendDefines this->LocalGenerator->AppendDefines
(defines, this->Target->GetProperty("COMPILE_DEFINITIONS")); (defines, this->Target->GetProperty("COMPILE_DEFINITIONS"));
std::string defPropName = std::string defPropName = "COMPILE_DEFINITIONS_";
defPropName +=
cmSystemTools::UpperCase(this->LocalGenerator->ConfigurationName); cmSystemTools::UpperCase(this->LocalGenerator->ConfigurationName);
defPropName += "_COMPILE_DEFINITIONS";
this->LocalGenerator->AppendDefines this->LocalGenerator->AppendDefines
(defines, this->Target->GetProperty(defPropName.c_str())); (defines, this->Target->GetProperty(defPropName.c_str()));
@ -464,8 +464,8 @@ cmMakefileTargetGenerator
} }
std::string configUpper = std::string configUpper =
cmSystemTools::UpperCase(this->LocalGenerator->ConfigurationName); cmSystemTools::UpperCase(this->LocalGenerator->ConfigurationName);
std::string defPropName = configUpper; std::string defPropName = "COMPILE_DEFINITIONS_";
defPropName += "_COMPILE_DEFINITIONS"; defPropName += configUpper;
if(const char* config_compile_defs = if(const char* config_compile_defs =
source.GetProperty(defPropName.c_str())) source.GetProperty(defPropName.c_str()))
{ {

View File

@ -345,15 +345,15 @@ void cmSourceFile::DefineProperties(cmake *cm)
cm->DefineProperty cm->DefineProperty
("COMPILE_DEFINITIONS", cmProperty::SOURCE_FILE, ("COMPILE_DEFINITIONS", cmProperty::SOURCE_FILE,
"Preprocessor definitions for compiling this source file.", "Preprocessor definitions for compiling a source file.",
"The COMPILE_DEFINITIONS property may be set to a list of preprocessor " "The COMPILE_DEFINITIONS property may be set to a list of preprocessor "
"definitions using the syntax VAR or VAR=value. Function-style " "definitions using the syntax VAR or VAR=value. Function-style "
"definitions are not supported. CMake will automatically escape " "definitions are not supported. CMake will automatically escape "
"the value correctly for the native build system (note that CMake " "the value correctly for the native build system (note that CMake "
"language syntax may require escapes to specify some values). " "language syntax may require escapes to specify some values). "
"This property may be set on a per-configuration basis using the name " "This property may be set on a per-configuration basis using the name "
"<CONFIG>_COMPILE_DEFINITIONS where <CONFIG> is an upper-case name " "COMPILE_DEFINITIONS_<CONFIG> where <CONFIG> is an upper-case name "
"(ex. \"DEBUG_COMPILE_DEFINITIONS\").\n" "(ex. \"COMPILE_DEFINITIONS_DEBUG\").\n"
"CMake will automatically drop some definitions that " "CMake will automatically drop some definitions that "
"are not supported by the native build tool. " "are not supported by the native build tool. "
"The VS6 IDE does not support definitions with values " "The VS6 IDE does not support definitions with values "
@ -370,12 +370,12 @@ void cmSourceFile::DefineProperties(cmake *cm)
cm->DefineProperty cm->DefineProperty
("<CONFIG>_COMPILE_DEFINITIONS", cmProperty::SOURCE_FILE, ("COMPILE_DEFINITIONS_<CONFIG>", cmProperty::SOURCE_FILE,
"Per-configuration preprocessor definitions on a source file.", "Per-configuration preprocessor definitions on a source file.",
"This is the configuration-specific version of " "This is the configuration-specific version of "
"COMPILE_DEFINITIONS. Note that Xcode does not support " "COMPILE_DEFINITIONS. Note that Xcode does not support "
"per-configuration source file flags so this property will " "per-configuration source file flags so this property will "
"be ignored by the Xcode generator."); "be ignored by the Xcode generator.");
cm->DefineProperty cm->DefineProperty
("EXTERNAL_OBJECT", cmProperty::SOURCE_FILE, ("EXTERNAL_OBJECT", cmProperty::SOURCE_FILE,

View File

@ -72,15 +72,15 @@ void cmTarget::DefineProperties(cmake *cm)
cm->DefineProperty cm->DefineProperty
("COMPILE_DEFINITIONS", cmProperty::TARGET, ("COMPILE_DEFINITIONS", cmProperty::TARGET,
"Preprocessor definitions for compiling this target's sources.", "Preprocessor definitions for compiling a target's sources.",
"The COMPILE_DEFINITIONS property may be set to a list of preprocessor " "The COMPILE_DEFINITIONS property may be set to a list of preprocessor "
"definitions using the syntax VAR or VAR=value. Function-style " "definitions using the syntax VAR or VAR=value. Function-style "
"definitions are not supported. CMake will automatically escape " "definitions are not supported. CMake will automatically escape "
"the value correctly for the native build system (note that CMake " "the value correctly for the native build system (note that CMake "
"language syntax may require escapes to specify some values). " "language syntax may require escapes to specify some values). "
"This property may be set on a per-configuration basis using the name " "This property may be set on a per-configuration basis using the name "
"<CONFIG>_COMPILE_DEFINITIONS where <CONFIG> is an upper-case name " "COMPILE_DEFINITIONS_<CONFIG> where <CONFIG> is an upper-case name "
"(ex. \"DEBUG_COMPILE_DEFINITIONS\").\n" "(ex. \"COMPILE_DEFINITIONS_DEBUG\").\n"
"CMake will automatically drop some definitions that " "CMake will automatically drop some definitions that "
"are not supported by the native build tool. " "are not supported by the native build tool. "
"The VS6 IDE does not support definitions with values " "The VS6 IDE does not support definitions with values "
@ -95,7 +95,7 @@ void cmTarget::DefineProperties(cmake *cm)
"in a (configured) header file. Then report the limitation."); "in a (configured) header file. Then report the limitation.");
cm->DefineProperty cm->DefineProperty
("<CONFIG>_COMPILE_DEFINITIONS", cmProperty::TARGET, ("COMPILE_DEFINITIONS_<CONFIG>", cmProperty::TARGET,
"Per-configuration preprocessor definitions on a target.", "Per-configuration preprocessor definitions on a target.",
"This is the configuration-specific version of COMPILE_DEFINITIONS."); "This is the configuration-specific version of COMPILE_DEFINITIONS.");

View File

@ -168,13 +168,13 @@ endif(NOT PREPROCESS_VS6)
add_executable(Preprocess preprocess.c preprocess${VS6}.cxx) add_executable(Preprocess preprocess.c preprocess${VS6}.cxx)
set_target_properties(Preprocess PROPERTIES set_target_properties(Preprocess PROPERTIES
COMPILE_DEFINITIONS "${TARGET_DEFS}" COMPILE_DEFINITIONS "${TARGET_DEFS}"
DEBUG_COMPILE_DEFINITIONS "TARGET_DEF_DEBUG" COMPILE_DEFINITIONS_DEBUG "TARGET_DEF_DEBUG"
RELEASE_COMPILE_DEFINITIONS "TARGET_DEF_RELEASE" COMPILE_DEFINITIONS_RELEASE "TARGET_DEF_RELEASE"
) )
set_source_files_properties(preprocess.c preprocess${VS6}.cxx PROPERTIES set_source_files_properties(preprocess.c preprocess${VS6}.cxx PROPERTIES
COMPILE_DEFINITIONS "${FILE_DEFS}" COMPILE_DEFINITIONS "${FILE_DEFS}"
DEBUG_COMPILE_DEFINITIONS "FILE_DEF_DEBUG" COMPILE_DEFINITIONS_DEBUG "FILE_DEF_DEBUG"
RELEASE_COMPILE_DEFINITIONS "FILE_DEF_RELEASE" COMPILE_DEFINITIONS_RELEASE "FILE_DEF_RELEASE"
) )
# Helper target for running test manually in build tree. # Helper target for running test manually in build tree.