Primitives.cmake 804 B

1234567891011121314151617181920
  1. ##
  2. # Get the primitives for each operation.
  3. #
  4. # @param operations a list of operation names.
  5. # @param output the name of a variable which will be set to a list of all operations
  6. # and primitives, seperated by an underscore.
  7. # eg: crypto_sign_edwards25519sha512batch
  8. ##
  9. function(Primitives_get operations output)
  10. foreach(operation ${OPERATIONS})
  11. file(GLOB primitive_paths "${CMAKE_SOURCE_DIR}/${operation}/*")
  12. foreach(primitive_path ${primitive_paths})
  13. if(IS_DIRECTORY "${primitive_path}")
  14. string(REGEX REPLACE ".*/" "" primitive ${primitive_path})
  15. list(APPEND outList "${operation}_${primitive}")
  16. endif()
  17. endforeach()
  18. endforeach()
  19. set(${output} ${outList} PARENT_SCOPE)
  20. endfunction()