macros.cmake 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  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 source file to the architecture group
  20. FUNCTION(ua_add_architecture_file)
  21. FOREACH(ARG ${ARGV})
  22. set_property(GLOBAL APPEND PROPERTY UA_ARCHITECTURE_SOURCES ${ARG})
  23. ENDFOREACH(ARG)
  24. ENDFUNCTION(ua_add_architecture_file)
  25. #Add definitions to the compilations that are exclusive for the selected architecture
  26. FUNCTION(ua_architecture_add_definitions)
  27. FOREACH(ARG ${ARGV})
  28. set_property(GLOBAL APPEND PROPERTY UA_ARCHITECTURE_ADD_DEFINITIONS ${ARG})
  29. ENDFOREACH(ARG)
  30. ENDFUNCTION(ua_architecture_add_definitions)
  31. #Remove definitions from the compilations that are exclusive for the selected architecture
  32. FUNCTION(ua_architecture_remove_definitions)
  33. FOREACH(ARG ${ARGV})
  34. set_property(GLOBAL APPEND PROPERTY UA_ARCHITECTURE_REMOVE_DEFINITIONS ${ARG})
  35. ENDFOREACH(ARG)
  36. ENDFUNCTION(ua_architecture_remove_definitions)
  37. #Add libraries to be linked to the comnpilation that are exclusive for the selected architecture
  38. FUNCTION(ua_architecture_append_to_library)
  39. FOREACH(ARG ${ARGV})
  40. set_property(GLOBAL APPEND PROPERTY UA_ARCHITECTURE_APPEND_TO_LIBRARY ${ARG})
  41. ENDFOREACH(ARG)
  42. ENDFUNCTION(ua_architecture_append_to_library)