diff options
Diffstat (limited to 'Tests')
-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) |