Collection of DPF-based plugins for packaging
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

27 lines
759B

  1. include_guard()
  2. include(CheckCSourceCompiles)
  3. macro(check_enum_value_exists enum_value include variable)
  4. if(NOT DEFINED ${variable})
  5. message(STATUS "Looking for enum value ${enum_value}")
  6. set(_CMAKE_REQUIRED_QUIET_tmp "${CMAKE_REQUIRED_QUIET}")
  7. set(CMAKE_REQUIRED_QUIET ON)
  8. check_c_source_compiles("
  9. #include <${include}>
  10. int main() {
  11. int tmp = ${enum_value};
  12. return 0;
  13. }
  14. "
  15. ${variable}
  16. )
  17. if(${variable})
  18. message(STATUS "Looking for enum value ${enum_value} - found")
  19. else()
  20. message(STATUS "Looking for enum value ${enum_value} - not found")
  21. endif()
  22. set(CMAKE_REQUIRED_QUIET "${_CMAKE_REQUIRED_QUIET_tmp}")
  23. endif()
  24. endmacro()