@@ -2115,18 +2115,21 @@ function(ROOT_APPEND_LIBDIR_TO_INSTALL_RPATH target install_dir)
21152115endfunction ()
21162116
21172117#----------------------------------------------------------------------------
2118- # If path is a system path, set the return variable is_system_path to true.
2118+ # If path is a system include path, set the return variable
2119+ # is_system_include_path to true.
21192120# The 1st argument is the path that should be checked
21202121# The 2nd argument is the return value
21212122#----------------------------------------------------------------------------
2122- function (IS_SYSTEM_PATH path is_system_path)
2123- foreach (dir ${CMAKE_SYSTEM_PATH} )
2124- if ("${path} " STREQUALS "$dir" )
2125- set (${is_system_path} TRUE PARENT_SCOPE)
2123+ function (IS_SYSTEM_INCLUDE_PATH path is_system_include_path)
2124+ message ("CMAKE_SYSTEM_INCLUDE_PATH: ${CMAKE_SYSTEM_INCLUDE_PATH} " )
2125+ foreach (dir ${CMAKE_SYSTEM_INCLUDE_PATH} )
2126+ message ("SYSTEM_INCLUDE_DIR: ${dir} " )
2127+ if ("${path} " STREQUAL "${dir} " )
2128+ set (${is_system_include_path} TRUE PARENT_SCOPE)
21262129 return ()
21272130 endif ()
21282131 endforeach ()
2129- set (${is_system_path } FALSE PARENT_SCOPE)
2132+ set (${is_system_include_path } FALSE PARENT_SCOPE)
21302133endfunction ()
21312134
21322135#----------------------------------------------------------------------------
@@ -2142,8 +2145,8 @@ function (BUILD_ROOT_INCLUDE_PATH path)
21422145 (${path} MATCHES "${CMAKE_INSTALL_PREFIX} (/.*)?" ))
21432146 return ()
21442147 endif ()
2145- IS_SYSTEM_PATH ("${path} " is_system_path )
2146- if (NOT is_system_path )
2148+ IS_SYSTEM_INCLUDE_PATH ("${path} " is_system_include_path )
2149+ if (NOT is_system_include_path )
21472150 if ("${DEFAULT_ROOT_INCLUDE_PATH} " STREQUAL "" )
21482151 set (DEFAULT_ROOT_INCLUDE_PATH "${path} " PARENT_SCOPE)
21492152 else ()
0 commit comments