Findflex.cmake 836 B

12345678910111213141516171819202122232425262728293031
  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} NO_DEFAULT_PATH)
  9. find_program(flex_EXECUTABLE NAMES flex bin/flex PATHS ${flex_INSTALL_DIRS})
  10. if(flex_EXECUTABLE)
  11. set(flex_FOUND TRUE)
  12. else()
  13. set(flex_FOUND FALSE)
  14. endif()
  15. if(NOT flex_FOUND)
  16. if(flex_FIND_REQUIRED)
  17. message(FATAL_ERROR "Cannot find flex installation. Try modifying the flex_INSTALL_DIRS path.")
  18. return()
  19. else()
  20. message(WARNING "Cannot find flex installation. Try modifying the flex_INSTALL_DIRS path.")
  21. endif()
  22. else()
  23. message(STATUS "...flex OK.")
  24. endif()
  25. mark_as_advanced(flex_INSTALL_DIRS flex_EXECUTABLE)