Browse Source

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

Brad King 18 years ago
parent
commit
80c2be45e0

+ 2 - 2
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

+ 8 - 8
Source/cmLocalVisualStudio6Generator.cxx

@@ -417,21 +417,21 @@ void cmLocalVisualStudio6Generator
     std::map<cmStdString, cmStdString> 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

+ 4 - 4
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;

+ 4 - 4
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()))
     {

+ 5 - 5
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 "
-     "<CONFIG>_COMPILE_DEFINITIONS where <CONFIG> is an upper-case name "
-     "(ex. \"DEBUG_COMPILE_DEFINITIONS\").\n"
+     "COMPILE_DEFINITIONS_<CONFIG> where <CONFIG> 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
-    ("<CONFIG>_COMPILE_DEFINITIONS", cmProperty::SOURCE_FILE,
+    ("COMPILE_DEFINITIONS_<CONFIG>", 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, 

+ 4 - 4
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 "
-     "<CONFIG>_COMPILE_DEFINITIONS where <CONFIG> is an upper-case name "
-     "(ex. \"DEBUG_COMPILE_DEFINITIONS\").\n"
+     "COMPILE_DEFINITIONS_<CONFIG> where <CONFIG> 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
-    ("<CONFIG>_COMPILE_DEFINITIONS", cmProperty::TARGET,
+    ("COMPILE_DEFINITIONS_<CONFIG>", cmProperty::TARGET,
      "Per-configuration preprocessor definitions on a target.",
      "This is the configuration-specific version of COMPILE_DEFINITIONS.");
 

+ 4 - 4
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.