macros.cmake 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. #Add a new architecture to to the lists of available architectures
  2. FUNCTION(ua_add_architecture)
  3. FOREACH(ARG ${ARGV})
  4. set_property(GLOBAL APPEND PROPERTY UA_ARCHITECTURES ${ARG})
  5. ENDFOREACH(ARG)
  6. ENDFUNCTION(ua_add_architecture)
  7. #Include folders to the compilation
  8. FUNCTION(ua_include_directories)
  9. FOREACH(ARG ${ARGV})
  10. set_property(GLOBAL APPEND PROPERTY UA_INCLUDE_DIRECTORIES ${ARG})
  11. ENDFOREACH(ARG)
  12. ENDFUNCTION(ua_include_directories)
  13. #Add a new header file to the architecture group
  14. FUNCTION(ua_add_architecture_header)
  15. FOREACH(ARG ${ARGV})
  16. set_property(GLOBAL APPEND PROPERTY UA_ARCHITECTURE_HEADERS ${ARG})
  17. ENDFOREACH(ARG)
  18. ENDFUNCTION(ua_add_architecture_header)
  19. #Add a new header file to the architecture group at the beginning of it
  20. FUNCTION(ua_add_architecture_header_beginning)
  21. FOREACH(ARG ${ARGV})
  22. set_property(GLOBAL APPEND PROPERTY UA_ARCHITECTURE_HEADERS_BEGINNING ${ARG})
  23. ENDFOREACH(ARG)
  24. ENDFUNCTION(ua_add_architecture_header_beginning)
  25. #Add a new source file to the architecture group
  26. FUNCTION(ua_add_architecture_file)
  27. FOREACH(ARG ${ARGV})
  28. set_property(GLOBAL APPEND PROPERTY UA_ARCHITECTURE_SOURCES ${ARG})
  29. ENDFOREACH(ARG)
  30. ENDFUNCTION(ua_add_architecture_file)
  31. #Add definitions to the compilations that are exclusive for the selected architecture
  32. FUNCTION(ua_architecture_add_definitions)
  33. FOREACH(ARG ${ARGV})
  34. set_property(GLOBAL APPEND PROPERTY UA_ARCHITECTURE_ADD_DEFINITIONS ${ARG})
  35. ENDFOREACH(ARG)
  36. ENDFUNCTION(ua_architecture_add_definitions)
  37. #Remove definitions from the compilations that are exclusive for the selected architecture
  38. FUNCTION(ua_architecture_remove_definitions)
  39. FOREACH(ARG ${ARGV})
  40. set_property(GLOBAL APPEND PROPERTY UA_ARCHITECTURE_REMOVE_DEFINITIONS ${ARG})
  41. ENDFOREACH(ARG)
  42. ENDFUNCTION(ua_architecture_remove_definitions)
  43. #Add libraries to be linked to the comnpilation that are exclusive for the selected architecture
  44. FUNCTION(ua_architecture_append_to_library)
  45. FOREACH(ARG ${ARGV})
  46. set_property(GLOBAL APPEND PROPERTY UA_ARCHITECTURE_APPEND_TO_LIBRARY ${ARG})
  47. ENDFOREACH(ARG)
  48. ENDFUNCTION(ua_architecture_append_to_library)