Findflex.cmake 742 B

1234567891011121314151617181920212223242526272829
  1. # Find flex installation
  2. #
  3. # This module defines
  4. # flex_EXECUTABLE
  5. # flex_FOUND
  6. set(flex_INSTALL_DIRS ${PROJECT_SOURCE_DIR}/../Dependencies/tools/flex CACHE PATH "")
  7. message(STATUS "Looking for flex installation...")
  8. find_program(flex_EXECUTABLE NAMES flex bin/flex PATHS ${flex_INSTALL_DIRS})
  9. if(flex_EXECUTABLE)
  10. set(flex_FOUND TRUE)
  11. else()
  12. set(flex_FOUND FALSE)
  13. endif()
  14. if(NOT flex_FOUND)
  15. if(flex_FIND_REQUIRED)
  16. message(FATAL_ERROR "Cannot find flex installation. Try modifying the flex_INSTALL_DIRS path.")
  17. return()
  18. else()
  19. message(WARNING "Cannot find flex installation. Try modifying the flex_INSTALL_DIRS path.")
  20. endif()
  21. else()
  22. message(STATUS "...flex OK.")
  23. endif()
  24. mark_as_advanced(flex_INSTALL_DIRS flex_EXECUTABLE)