From 6ab8d75da010d7cce3e976b1512d9aa24ff2d436 Mon Sep 17 00:00:00 2001 From: jp9000 Date: Thu, 16 Jul 2015 16:05:08 -0700 Subject: [PATCH] cmake: Add helper to include -isystem directories This is mostly just a helper to prevent warnings with system includes in XCode. --- cmake/external/ObsPluginHelpers.cmake | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/cmake/external/ObsPluginHelpers.cmake b/cmake/external/ObsPluginHelpers.cmake index 82b00f086..d157b4bb1 100644 --- a/cmake/external/ObsPluginHelpers.cmake +++ b/cmake/external/ObsPluginHelpers.cmake @@ -2,6 +2,21 @@ set(EXTERNAL_PLUGIN_OUTPUT_DIR "${CMAKE_BINARY_DIR}/rundir") +# Fix XCode includes to ignore warnings on system includes +function(target_include_directories_system _target) + if(XCODE) + foreach(_arg ${ARGN}) + if("${_arg}" STREQUAL "PRIVATE" OR "${_arg}" STREQUAL "PUBLIC" OR "${_arg}" STREQUAL "INTERFACE") + set(_scope ${_arg}) + else() + target_compile_options(${_target} ${_scope} -isystem${_arg}) + endif() + endforeach() + else() + target_include_directories(${_target} SYSTEM ${_scope} ${ARGN}) + endif() +endfunction() + function(install_external_plugin_data_internal target source_dir target_dir) install(DIRECTORY ${source_dir}/ DESTINATION "${target}/${target_dir}"