diff options
author | Ken Martin <ken.martin@kitware.com> | 2007-06-25 13:51:37 (GMT) |
---|---|---|
committer | Ken Martin <ken.martin@kitware.com> | 2007-06-25 13:51:37 (GMT) |
commit | 509f1fb9cb2d23938f4f4217a7f51597fa4af18a (patch) | |
tree | fcaaa9a18d57d26b72b108859ebd6844055170f6 /Tests/Properties/CMakeLists.txt | |
parent | 2d1c85ade3f7824eeb3f342f4a96a8843ee7b7b8 (diff) | |
download | CMake-509f1fb9cb2d23938f4f4217a7f51597fa4af18a.zip CMake-509f1fb9cb2d23938f4f4217a7f51597fa4af18a.tar.gz CMake-509f1fb9cb2d23938f4f4217a7f51597fa4af18a.tar.bz2 |
ENH: some property cleanup and added GetProperty
Diffstat (limited to 'Tests/Properties/CMakeLists.txt')
-rw-r--r-- | Tests/Properties/CMakeLists.txt | 34 |
1 files changed, 30 insertions, 4 deletions
diff --git a/Tests/Properties/CMakeLists.txt b/Tests/Properties/CMakeLists.txt index d67f3ee..cb2ca7b 100644 --- a/Tests/Properties/CMakeLists.txt +++ b/Tests/Properties/CMakeLists.txt @@ -20,8 +20,34 @@ get_source_file_property(RESULT3 SubDir/properties3.cxx TEST3) include_directories("${Properties_SOURCE_DIR}" "${Properties_BINARY_DIR}") -if (RESULT1 AND RESULT2 AND RESULT3) + +# test generic property interfaces +define_property(GLOBALTEST GLOBAL "A test property" + "A long description of this test property" 0) +set_properties(GLOBAL PROPERTIES GLOBALTEST 1) +set_properties(DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}" + PROPERTIES DIRECTORYTEST 1) +set_properties(SOURCE_FILE SubDir/properties3.cxx PROPERTIES SOURCETEST 1) +get_property(GLOBALRESULT GLOBAL GLOBALTEST) +get_property(DIRECTORYRESULT DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}" + DIRECTORYTEST) +get_property(SOURCE_FILERESULT SOURCE_FILE SubDir/properties3.cxx SOURCETEST) + +if (RESULT1 AND RESULT2 AND RESULT3 AND GLOBALRESULT AND + DIRECTORYRESULT AND SOURCE_FILERESULT) add_executable (Properties SubDir/properties3.cxx) -else (RESULT1 AND RESULT2 AND RESULT3) - message("Error: test results are TEST1=${TEST1} TEST2=${TEST2} TEST3=${TEST3}") -endif (RESULT1 AND RESULT2 AND RESULT3) +else (RESULT1 AND RESULT2 AND RESULT3 AND GLOBALRESULT AND + DIRECTORYRESULT AND SOURCE_FILERESULT) + message("Error: test results are RESULT1=${RESULT1} RESULT2=${RESULT2} " + "RESULT3=${RESULT3} GLOBALRESULT=${GLOBALRESULT} " + "DIRECTORYRESULT=${DIRECTORYRESULT} " + "SOURCE_FILERESULT=${SOURCE_FILERESULT}") +endif (RESULT1 AND RESULT2 AND RESULT3 AND GLOBALRESULT AND + DIRECTORYRESULT AND SOURCE_FILERESULT) + +# test the target property +set_properties(TARGET Properties PROPERTIES TARGETTEST 1) +get_property(TARGETRESULT TARGET Properties TARGETTEST) +if (NOT TARGETRESULT) + message("Error: target result is TARGETRESULT=${TARGETRESULT}") +endif (NOT TARGETRESULT) |