[cmake-commits] king committed CMakeLists.txt 1.5 1.6 preprocess.c 1.1 1.2 preprocess.cxx 1.1 1.2

cmake-commits at cmake.org cmake-commits at cmake.org
Thu Jan 17 19:29:46 EST 2008


Update of /cvsroot/CMake/CMake/Tests/Preprocess
In directory public:/mounts/ram/cvs-serv29578/Tests/Preprocess

Modified Files:
	CMakeLists.txt preprocess.c preprocess.cxx 
Log Message:
ENH: Converted cmMakefile DefineFlags added by ADD_DEFINITIONS command into a COMPILE_DEFINITIONS directory property.


Index: CMakeLists.txt
===================================================================
RCS file: /cvsroot/CMake/CMake/Tests/Preprocess/CMakeLists.txt,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -d -r1.5 -r1.6
--- CMakeLists.txt	17 Jan 2008 22:34:56 -0000	1.5
+++ CMakeLists.txt	18 Jan 2008 00:29:43 -0000	1.6
@@ -144,6 +144,17 @@
 # Test old-style definitions.
 add_definitions(-DOLD_DEF -DOLD_EXPR=2)
 
+# Make sure old-style definitions are converted to directory property.
+if(PREPROCESS_VS6)
+  set(OLD_DEFS_EXPECTED "OLD_DEF")
+else(PREPROCESS_VS6)
+  set(OLD_DEFS_EXPECTED "OLD_DEF;OLD_EXPR=2")
+endif(PREPROCESS_VS6)
+get_property(OLD_DEFS DIRECTORY PROPERTY COMPILE_DEFINITIONS)
+if(NOT "${OLD_DEFS}" STREQUAL "${OLD_DEFS_EXPECTED}")
+  message(SEND_ERROR "add_definitions not converted to directory property!")
+endif(NOT "${OLD_DEFS}" STREQUAL "${OLD_DEFS_EXPECTED}")
+
 add_executable(Preprocess preprocess.c preprocess${VS6}.cxx)
 
 set(FILE_PATH "${Preprocess_SOURCE_DIR}/file_def.h")
@@ -152,6 +163,10 @@
 # Set some definition properties.
 foreach(c "" "_DEBUG" "_RELEASE")
   set_property(
+    DIRECTORY .
+    APPEND PROPERTY COMPILE_DEFINITIONS${c} "DIRECTORY_DEF${c}"
+    )
+  set_property(
     TARGET Preprocess
     PROPERTY COMPILE_DEFINITIONS${c} "TARGET_DEF${c}"
     )

Index: preprocess.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Tests/Preprocess/preprocess.cxx,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- preprocess.cxx	14 Jan 2008 14:20:58 -0000	1.1
+++ preprocess.cxx	18 Jan 2008 00:29:43 -0000	1.2
@@ -54,6 +54,12 @@
   result = 0;
   }
 # endif
+# ifdef DIRECTORY_DEF_DEBUG
+  {
+  fprintf(stderr, "DIRECTORY_DEF_DEBUG should not be defined in CXX\n");
+  result = 0;
+  }
+# endif
 # ifndef FILE_DEF_RELEASE
 #  ifndef PREPROCESS_XCODE
   {
@@ -68,6 +74,12 @@
   result = 0;
   }
 # endif
+# ifndef DIRECTORY_DEF_RELEASE
+  {
+  fprintf(stderr, "DIRECTORY_DEF_RELEASE should be defined in CXX\n");
+  result = 0;
+  }
+# endif
 #endif
 #ifdef PREPROCESS_DEBUG
 # ifndef FILE_DEF_DEBUG
@@ -84,6 +96,12 @@
   result = 0;
   }
 # endif
+# ifndef DIRECTORY_DEF_DEBUG
+  {
+  fprintf(stderr, "DIRECTORY_DEF_DEBUG should be defined in CXX\n");
+  result = 0;
+  }
+# endif
 # ifdef FILE_DEF_RELEASE
   {
   fprintf(stderr, "FILE_DEF_RELEASE should not be defined in CXX\n");
@@ -96,6 +114,12 @@
   result = 0;
   }
 # endif
+# ifdef DIRECTORY_DEF_RELEASE
+  {
+  fprintf(stderr, "DIRECTORY_DEF_RELEASE should not be defined in CXX\n");
+  result = 0;
+  }
+# endif
 #endif
 #if defined(FILE_DEF_DEBUG) || defined(TARGET_DEF_DEBUG)
 # if !defined(FILE_DEF_DEBUG) || !defined(TARGET_DEF_DEBUG)
@@ -155,6 +179,12 @@
   result = 0;
   }
 #endif
+#ifndef DIRECTORY_DEF
+  {
+  fprintf(stderr, "DIRECTORY_DEF not defined in CXX\n");
+  result = 0;
+  }
+#endif
 #ifndef OLD_DEF
   {
   fprintf(stderr, "OLD_DEF not defined in CXX\n");

Index: preprocess.c
===================================================================
RCS file: /cvsroot/CMake/CMake/Tests/Preprocess/preprocess.c,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- preprocess.c	14 Jan 2008 14:20:58 -0000	1.1
+++ preprocess.c	18 Jan 2008 00:29:43 -0000	1.2
@@ -52,6 +52,12 @@
   result = 0;
   }
 # endif
+# ifdef DIRECTORY_DEF_DEBUG
+  {
+  fprintf(stderr, "DIRECTORY_DEF_DEBUG should not be defined in C\n");
+  result = 0;
+  }
+# endif
 # ifndef FILE_DEF_RELEASE
 #  ifndef PREPROCESS_XCODE
   {
@@ -66,6 +72,12 @@
   result = 0;
   }
 # endif
+# ifndef DIRECTORY_DEF_RELEASE
+  {
+  fprintf(stderr, "DIRECTORY_DEF_RELEASE should be defined in C\n");
+  result = 0;
+  }
+# endif
 #endif
 #ifdef PREPROCESS_DEBUG
 # ifndef FILE_DEF_DEBUG
@@ -82,6 +94,12 @@
   result = 0;
   }
 # endif
+# ifndef DIRECTORY_DEF_DEBUG
+  {
+  fprintf(stderr, "DIRECTORY_DEF_DEBUG should be defined in C\n");
+  result = 0;
+  }
+# endif
 # ifdef FILE_DEF_RELEASE
   {
   fprintf(stderr, "FILE_DEF_RELEASE should not be defined in C\n");
@@ -94,6 +112,12 @@
   result = 0;
   }
 # endif
+# ifdef DIRECTORY_DEF_RELEASE
+  {
+  fprintf(stderr, "DIRECTORY_DEF_RELEASE should not be defined in C\n");
+  result = 0;
+  }
+# endif
 #endif
 #if defined(FILE_DEF_DEBUG) || defined(TARGET_DEF_DEBUG)
 # if !defined(FILE_DEF_DEBUG) || !defined(TARGET_DEF_DEBUG)
@@ -153,6 +177,12 @@
   result = 0;
   }
 #endif
+#ifndef DIRECTORY_DEF
+  {
+  fprintf(stderr, "DIRECTORY_DEF not defined in C\n");
+  result = 0;
+  }
+#endif
 #ifndef OLD_DEF
   {
   fprintf(stderr, "OLD_DEF not defined in C\n");



More information about the Cmake-commits mailing list