[Cmake-commits] [cmake-commits] martink committed CMakeLists.txt 1.7 1.8

cmake-commits at cmake.org cmake-commits at cmake.org
Tue Apr 1 14:22:13 EDT 2008


Update of /cvsroot/CMake/CMake/Tests/Properties
In directory public:/mounts/ram/cvs-serv30886/Tests/Properties

Modified Files:
	CMakeLists.txt 
Log Message:
ENH: support unset of properties


Index: CMakeLists.txt
===================================================================
RCS file: /cvsroot/CMake/CMake/Tests/Properties/CMakeLists.txt,v
retrieving revision 1.7
retrieving revision 1.8
diff -C 2 -d -r1.7 -r1.8
*** CMakeLists.txt	25 Mar 2008 15:27:03 -0000	1.7
--- CMakeLists.txt	1 Apr 2008 18:22:09 -0000	1.8
***************
*** 24,31 ****
--- 24,44 ----
  
  # test generic property interfaces
+ get_property(GLOBALRESULT GLOBAL PROPERTY GLOBALTEST DEFINED)
+ if (GLOBALRESULT)
+     message(SEND_ERROR "Error: global prop defined when it should not be, "
+             "result is GLOBALRESULT=${GLOBALRESULT}")
+ endif (GLOBALRESULT)
+ 
  define_property(GLOBAL PROPERTY GLOBALTEST
    BRIEF_DOCS "A test property"
    FULL_DOCS "A long description of this test property"
    )
+ 
+ get_property(GLOBALRESULT GLOBAL PROPERTY GLOBALTEST DEFINED)
+ if (NOT GLOBALRESULT)
+     message(SEND_ERROR "Error: global prop not defined "
+             "result is GLOBALRESULT=${GLOBALRESULT}")
+ endif (NOT GLOBALRESULT)
+   
  set_property(GLOBAL PROPERTY GLOBALTEST 1)
  set_property(DIRECTORY PROPERTY DIRECTORYTEST 1)
***************
*** 43,47 ****
  else (RESULT1 AND RESULT2 AND RESULT3 AND GLOBALRESULT AND 
      DIRECTORYRESULT AND SOURCERESULT)
!   message("Error: test results are RESULT1=${RESULT1} RESULT2=${RESULT2} "
      "RESULT3=${RESULT3} GLOBALRESULT=${GLOBALRESULT} "
      "DIRECTORYRESULT=${DIRECTORYRESULT} "
--- 56,61 ----
  else (RESULT1 AND RESULT2 AND RESULT3 AND GLOBALRESULT AND 
      DIRECTORYRESULT AND SOURCERESULT)
!   message(SEND_ERROR 
!     "Error: test results are RESULT1=${RESULT1} RESULT2=${RESULT2} "
      "RESULT3=${RESULT3} GLOBALRESULT=${GLOBALRESULT} "
      "DIRECTORYRESULT=${DIRECTORYRESULT} "
***************
*** 54,60 ****
  get_property(TARGETRESULT TARGET Properties PROPERTY TARGETTEST)
  if (NOT TARGETRESULT)
!     message("Error: target result is TARGETRESULT=${TARGETRESULT}")
  endif (NOT TARGETRESULT)
  
  # test the target SOURCES property
  get_property(Properties_SOURCES TARGET Properties PROPERTY SOURCES)
--- 68,92 ----
  get_property(TARGETRESULT TARGET Properties PROPERTY TARGETTEST)
  if (NOT TARGETRESULT)
!     message(SEND_ERROR 
!       "Error: target result is TARGETRESULT=${TARGETRESULT}")
  endif (NOT TARGETRESULT)
  
+ # test get_property SET
+ get_property(TARGETRESULT TARGET Properties PROPERTY TARGETTEST SET)
+ if (NOT TARGETRESULT)
+     message(SEND_ERROR 
+       "Error: target prop not set, result is TARGETRESULT=${TARGETRESULT}")
+ endif (NOT TARGETRESULT)
+ 
+ # test unsetting a property
+ set_property(TARGET Properties PROPERTY TARGETTEST)
+ get_property(TARGETRESULT TARGET Properties PROPERTY TARGETTEST SET)
+ if (TARGETRESULT)
+     message(SEND_ERROR "Error: target prop not unset, "
+             "result is TARGETRESULT=${TARGETRESULT}")
+ endif (TARGETRESULT)
+ 
+ 
+ 
  # test the target SOURCES property
  get_property(Properties_SOURCES TARGET Properties PROPERTY SOURCES)
***************
*** 62,66 ****
  get_source_file_property(RESULT4 properties.h TEST4)
  if(NOT RESULT4)
!   message("Error: target result is"
      " RESULT4=${RESULT4}"
      " Properties_SOURCES=[${Properties_SOURCES}]")
--- 94,98 ----
  get_source_file_property(RESULT4 properties.h TEST4)
  if(NOT RESULT4)
!   message(SEND_ERROR "Error: target result is"
      " RESULT4=${RESULT4}"
      " Properties_SOURCES=[${Properties_SOURCES}]")



More information about the Cmake-commits mailing list