ADSP-Determine.cmake 974 B

1234567891011121314151617181920212223242526
  1. if(IS_DIRECTORY "$ENV{ADSP_ROOT}")
  2. file(TO_CMAKE_PATH "$ENV{ADSP_ROOT}" CMAKE_ADSP_ROOT)
  3. endif()
  4. macro(_find_adsp_root path_pattern)
  5. set(CMAKE_ADSP_ROOT "")
  6. set(_adsp_root_version "0")
  7. file(GLOB _adsp_root_paths "${path_pattern}")
  8. foreach(_current_adsp_root_path IN LISTS _adsp_root_paths)
  9. string(REGEX MATCH "([0-9\\.]+)/?$" _current_adsp_root_version "${_current_adsp_root_path}")
  10. if(_current_adsp_root_version VERSION_GREATER _adsp_root_version)
  11. set(CMAKE_ADSP_ROOT "${_current_adsp_root_path}")
  12. set(_adsp_root_version "${_current_adsp_root_version}")
  13. endif()
  14. endforeach()
  15. endmacro()
  16. if(NOT CMAKE_ADSP_ROOT)
  17. _find_adsp_root("C:/Analog Devices/CrossCore Embedded Studio *")
  18. endif()
  19. if(NOT CMAKE_ADSP_ROOT)
  20. _find_adsp_root("C:/Program Files (x86)/Analog Devices/VisualDSP *")
  21. endif()
  22. if(NOT IS_DIRECTORY "${CMAKE_ADSP_ROOT}")
  23. message(FATAL_ERROR "ADSP: could not find CCES/VDSP++ install directory ${CMAKE_ADSP_ROOT}")
  24. endif()