TargetIncludeSystemDirectories_supported.cmake 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. #
  2. # Copyright (c) Contributors to the Open 3D Engine Project.
  3. # For complete copyright and license terms please see the LICENSE at the root of this distribution.
  4. #
  5. # SPDX-License-Identifier: Apache-2.0 OR MIT
  6. #
  7. #
  8. # ly_target_include_system_directories: adds a system include to the target.
  9. # This allows for platform-specific handling of how system includes are added
  10. # to the target. This common implementation just calls
  11. #
  12. # target_include_directories(<TARGET> SYSTEM <ARGS>)
  13. #
  14. # \arg:TARGET name of the target
  15. # All other unrecognized arguments are passed unchanged to
  16. # target_include_directories
  17. #
  18. function(ly_target_include_system_directories)
  19. set(options)
  20. set(oneValueArgs TARGET)
  21. set(multiValueArgs)
  22. cmake_parse_arguments(ly_target_include_system_directories "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN})
  23. if(NOT ly_target_include_system_directories_TARGET)
  24. message(FATAL_ERROR "Target not provided")
  25. endif()
  26. target_compile_options(${ly_target_include_system_directories_TARGET}
  27. INTERFACE
  28. ${LY_CXX_SYSTEM_INCLUDE_CONFIGURATION_FLAG}
  29. )
  30. target_include_directories(${ly_target_include_system_directories_TARGET} SYSTEM ${ly_target_include_system_directories_UNPARSED_ARGUMENTS})
  31. endfunction()