InterfaceProperties-check.cmake 1.1 KB

123456789101112131415161718192021222324
  1. include(${CMAKE_CURRENT_LIST_DIR}/Assertions.cmake)
  2. set(out_dir "${RunCMake_BINARY_DIR}/InterfaceProperties-build/CMakeFiles/Export/510c5684a4a8a792eadfb55bc9744983")
  3. file(READ "${out_dir}/foo.cps" content)
  4. expect_value("${content}" "foo" "name")
  5. string(JSON component GET "${content}" "components" "foo")
  6. expect_value("${component}" "interface" "type")
  7. expect_array("${component}" 1 "includes")
  8. expect_value("${component}" "@prefix@/include/foo" "includes" 0)
  9. expect_array("${component}" 1 "compile_features")
  10. expect_value("${component}" "c++23" "compile_features" 0)
  11. expect_array("${component}" 1 "compile_flags")
  12. expect_value("${component}" "-ffast-math" "compile_flags" 0)
  13. expect_null("${component}" "compile_definitions" "*" "FOO")
  14. expect_value("${component}" "BAR" "compile_definitions" "*" "BAR")
  15. expect_array("${component}" 1 "link_directories")
  16. expect_value("${component}" "/opt/foo/lib" "link_directories" 0)
  17. expect_array("${component}" 1 "link_flags")
  18. expect_value("${component}" "--needed" "link_flags" 0)
  19. expect_array("${component}" 1 "link_libraries")
  20. expect_value("${component}" "/usr/lib/libm.so" "link_libraries" 0)