From 80c2be45e0b1701406e3739bb8a0a8fcad949f69 Mon Sep 17 00:00:00 2001 From: Brad King Date: Tue, 15 Jan 2008 21:02:00 -0500 Subject: ENH: Renamed _COMPILE_DEFINITIONS to COMPILE_DEFINITIONS_ for better documentation clarity. --- Source/cmGlobalXCodeGenerator.cxx | 4 ++-- Source/cmLocalVisualStudio6Generator.cxx | 16 ++++++++-------- Source/cmLocalVisualStudio7Generator.cxx | 8 ++++---- Source/cmMakefileTargetGenerator.cxx | 8 ++++---- Source/cmSourceFile.cxx | 10 +++++----- Source/cmTarget.cxx | 8 ++++---- Tests/Preprocess/CMakeLists.txt | 8 ++++---- 7 files changed, 31 insertions(+), 31 deletions(-) diff --git a/Source/cmGlobalXCodeGenerator.cxx b/Source/cmGlobalXCodeGenerator.cxx index d161480..35bc40e 100644 --- a/Source/cmGlobalXCodeGenerator.cxx +++ b/Source/cmGlobalXCodeGenerator.cxx @@ -1303,8 +1303,8 @@ void cmGlobalXCodeGenerator::CreateBuildSettings(cmTarget& target, this->AppendDefines(ppDefs, target.GetProperty("COMPILE_DEFINITIONS")); if(configName) { - std::string defVarName = cmSystemTools::UpperCase(configName); - defVarName += "_COMPILE_DEFINITIONS"; + std::string defVarName = "COMPILE_DEFINITIONS_"; + defVarName += cmSystemTools::UpperCase(configName); this->AppendDefines(ppDefs, target.GetProperty(defVarName.c_str())); } buildSettings->AddAttribute diff --git a/Source/cmLocalVisualStudio6Generator.cxx b/Source/cmLocalVisualStudio6Generator.cxx index 0f67bf1..9465275 100644 --- a/Source/cmLocalVisualStudio6Generator.cxx +++ b/Source/cmLocalVisualStudio6Generator.cxx @@ -417,21 +417,21 @@ void cmLocalVisualStudio6Generator std::map cdmap; this->AppendDefines(compileFlags, (*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); } - if(const char* cdefs = (*sf)->GetProperty("RELEASE_COMPILE_DEFINITIONS")) + if(const char* cdefs = (*sf)->GetProperty("COMPILE_DEFINITIONS_RELEASE")) { this->AppendDefines(cdmap["RELEASE"], cdefs); } if(const char* cdefs = - (*sf)->GetProperty("MINSIZEREL_COMPILE_DEFINITIONS")) + (*sf)->GetProperty("COMPILE_DEFINITIONS_MINSIZEREL")) { this->AppendDefines(cdmap["MINSIZEREL"], cdefs); } if(const char* cdefs = - (*sf)->GetProperty("RELWITHDEBINFO_COMPILE_DEFINITIONS")) + (*sf)->GetProperty("COMPILE_DEFINITIONS_RELWITHDEBINFO")) { this->AppendDefines(cdmap["RELWITHDEBINFO"], cdefs); } @@ -1505,15 +1505,15 @@ void cmLocalVisualStudio6Generator // Add per-target and per-configuration preprocessor definitions. this->AppendDefines(flags, target.GetProperty("COMPILE_DEFINITIONS")); this->AppendDefines(flagsDebug, - target.GetProperty("DEBUG_COMPILE_DEFINITIONS")); + target.GetProperty("COMPILE_DEFINITIONS_DEBUG")); this->AppendDefines(flagsRelease, - target.GetProperty("RELEASE_COMPILE_DEFINITIONS")); + target.GetProperty("COMPILE_DEFINITIONS_RELEASE")); this->AppendDefines (flagsMinSize, - target.GetProperty("MINSIZEREL_COMPILE_DEFINITIONS")); + target.GetProperty("COMPILE_DEFINITIONS_MINSIZEREL")); this->AppendDefines (flagsDebugRel, - target.GetProperty("RELWITHDEBINFO_COMPILE_DEFINITIONS")); + target.GetProperty("COMPILE_DEFINITIONS_RELWITHDEBINFO")); // 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 diff --git a/Source/cmLocalVisualStudio7Generator.cxx b/Source/cmLocalVisualStudio7Generator.cxx index ab3d024..2480622 100644 --- a/Source/cmLocalVisualStudio7Generator.cxx +++ b/Source/cmLocalVisualStudio7Generator.cxx @@ -521,8 +521,8 @@ void cmLocalVisualStudio7Generator::WriteConfiguration(std::ostream& fout, } std::string configUpper = cmSystemTools::UpperCase(configName); - std::string defPropName = configUpper; - defPropName += "_COMPILE_DEFINITIONS"; + std::string defPropName = "COMPILE_DEFINITIONS_"; + defPropName += configUpper; // Get preprocessor definitions for this directory. std::string defineFlags = this->Makefile->GetDefineFlags(); @@ -1093,8 +1093,8 @@ cmLocalVisualStudio7GeneratorFCInfo fc.CompileDefs = cdefs; needfc = true; } - std::string defPropName = configUpper; - defPropName += "_COMPILE_DEFINITIONS"; + std::string defPropName = "COMPILE_DEFINITIONS_"; + defPropName += configUpper; if(const char* ccdefs = sf.GetProperty(defPropName.c_str())) { fc.CompileDefsConfig = ccdefs; diff --git a/Source/cmMakefileTargetGenerator.cxx b/Source/cmMakefileTargetGenerator.cxx index 86c567d..e529ef7 100644 --- a/Source/cmMakefileTargetGenerator.cxx +++ b/Source/cmMakefileTargetGenerator.cxx @@ -268,9 +268,9 @@ void cmMakefileTargetGenerator::WriteTargetLanguageFlags() // Add preprocessor definitions for this target and configuration. this->LocalGenerator->AppendDefines (defines, this->Target->GetProperty("COMPILE_DEFINITIONS")); - std::string defPropName = + std::string defPropName = "COMPILE_DEFINITIONS_"; + defPropName += cmSystemTools::UpperCase(this->LocalGenerator->ConfigurationName); - defPropName += "_COMPILE_DEFINITIONS"; this->LocalGenerator->AppendDefines (defines, this->Target->GetProperty(defPropName.c_str())); @@ -464,8 +464,8 @@ cmMakefileTargetGenerator } std::string configUpper = cmSystemTools::UpperCase(this->LocalGenerator->ConfigurationName); - std::string defPropName = configUpper; - defPropName += "_COMPILE_DEFINITIONS"; + std::string defPropName = "COMPILE_DEFINITIONS_"; + defPropName += configUpper; if(const char* config_compile_defs = source.GetProperty(defPropName.c_str())) { diff --git a/Source/cmSourceFile.cxx b/Source/cmSourceFile.cxx index 8905b0c..f0dbd98 100644 --- a/Source/cmSourceFile.cxx +++ b/Source/cmSourceFile.cxx @@ -345,15 +345,15 @@ void cmSourceFile::DefineProperties(cmake *cm) cm->DefineProperty ("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 " "definitions using the syntax VAR or VAR=value. Function-style " "definitions are not supported. CMake will automatically escape " "the value correctly for the native build system (note that CMake " "language syntax may require escapes to specify some values). " "This property may be set on a per-configuration basis using the name " - "_COMPILE_DEFINITIONS where is an upper-case name " - "(ex. \"DEBUG_COMPILE_DEFINITIONS\").\n" + "COMPILE_DEFINITIONS_ where is an upper-case name " + "(ex. \"COMPILE_DEFINITIONS_DEBUG\").\n" "CMake will automatically drop some definitions that " "are not supported by the native build tool. " "The VS6 IDE does not support definitions with values " @@ -370,12 +370,12 @@ void cmSourceFile::DefineProperties(cmake *cm) cm->DefineProperty - ("_COMPILE_DEFINITIONS", cmProperty::SOURCE_FILE, + ("COMPILE_DEFINITIONS_", cmProperty::SOURCE_FILE, "Per-configuration preprocessor definitions on a source file.", "This is the configuration-specific version of " "COMPILE_DEFINITIONS. Note that Xcode does not support " "per-configuration source file flags so this property will " - "be ignored by the Xcode generator."); + "be ignored by the Xcode generator."); cm->DefineProperty ("EXTERNAL_OBJECT", cmProperty::SOURCE_FILE, diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx index eaf8f70..981ba3f 100644 --- a/Source/cmTarget.cxx +++ b/Source/cmTarget.cxx @@ -72,15 +72,15 @@ void cmTarget::DefineProperties(cmake *cm) cm->DefineProperty ("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 " "definitions using the syntax VAR or VAR=value. Function-style " "definitions are not supported. CMake will automatically escape " "the value correctly for the native build system (note that CMake " "language syntax may require escapes to specify some values). " "This property may be set on a per-configuration basis using the name " - "_COMPILE_DEFINITIONS where is an upper-case name " - "(ex. \"DEBUG_COMPILE_DEFINITIONS\").\n" + "COMPILE_DEFINITIONS_ where is an upper-case name " + "(ex. \"COMPILE_DEFINITIONS_DEBUG\").\n" "CMake will automatically drop some definitions that " "are not supported by the native build tool. " "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."); cm->DefineProperty - ("_COMPILE_DEFINITIONS", cmProperty::TARGET, + ("COMPILE_DEFINITIONS_", cmProperty::TARGET, "Per-configuration preprocessor definitions on a target.", "This is the configuration-specific version of COMPILE_DEFINITIONS."); diff --git a/Tests/Preprocess/CMakeLists.txt b/Tests/Preprocess/CMakeLists.txt index d6d9535..2983c96 100644 --- a/Tests/Preprocess/CMakeLists.txt +++ b/Tests/Preprocess/CMakeLists.txt @@ -168,13 +168,13 @@ endif(NOT PREPROCESS_VS6) add_executable(Preprocess preprocess.c preprocess${VS6}.cxx) set_target_properties(Preprocess PROPERTIES COMPILE_DEFINITIONS "${TARGET_DEFS}" - DEBUG_COMPILE_DEFINITIONS "TARGET_DEF_DEBUG" - RELEASE_COMPILE_DEFINITIONS "TARGET_DEF_RELEASE" + COMPILE_DEFINITIONS_DEBUG "TARGET_DEF_DEBUG" + COMPILE_DEFINITIONS_RELEASE "TARGET_DEF_RELEASE" ) set_source_files_properties(preprocess.c preprocess${VS6}.cxx PROPERTIES COMPILE_DEFINITIONS "${FILE_DEFS}" - DEBUG_COMPILE_DEFINITIONS "FILE_DEF_DEBUG" - RELEASE_COMPILE_DEFINITIONS "FILE_DEF_RELEASE" + COMPILE_DEFINITIONS_DEBUG "FILE_DEF_DEBUG" + COMPILE_DEFINITIONS_RELEASE "FILE_DEF_RELEASE" ) # Helper target for running test manually in build tree. -- cgit v0.12