############################################################################
# CMakeLists.txt file for building ROOT net/netxng package
# @author Lukasz Janyst <ljanyst@cern.ch>
############################################################################

ROOT_STANDARD_LIBRARY_PACKAGE(NetxNG
  HEADERS
    TNetXNGFile.h
    TNetXNGFileStager.h
    TNetXNGSystem.h
  SOURCES
    src/TNetXNGFile.cxx
    src/TNetXNGFileStager.cxx
    src/TNetXNGSystem.cxx
  LIBRARIES
    ${XROOTD_LIBRARIES}
  DEPENDENCIES
    Net
    RIO
    Thread
  BUILTINS
    XROOTD
)

target_compile_options(NetxNG PRIVATE -Wno-shadow)
target_include_directories(NetxNG PUBLIC ${XROOTD_INCLUDE_DIRS})

############################################################################
# CMakeLists.txt file for building ROOT net/netxng package
# @author Lukasz Janyst <ljanyst@cern.ch>
############################################################################

include_directories(${XROOTD_INCLUDE_DIRS})

ROOT_STANDARD_LIBRARY_PACKAGE(NetxNG
  HEADERS
    TNetXNGFile.h
    TNetXNGFileStager.h
    TNetXNGSystem.h
  SOURCES
    src/TNetXNGFile.cxx
    src/TNetXNGFileStager.cxx
    src/TNetXNGSystem.cxx
  LIBRARIES
    ${XROOTD_LIBRARIES}
  DEPENDENCIES
    Net
    RIO
    Thread
  BUILTINS
    XROOTD
)

target_compile_options(NetxNG PRIVATE -Wno-shadow)

Revert back to include_directories() for net/netxng
Revert back to include_directories() for net/netxng

NetxNG needs the include directory for XRootD, but when XRootD is
enabled as a builtin, the include directory points to the build
directory and causes CMake to fail with an error like the one below:

CMake Error in net/netxng/CMakeLists.txt:
  Target "NetxNG" INTERFACE_INCLUDE_DIRECTORIES property contains path:

    "${BUILDDIR}/include/xrootd"

which is prefixed in the build directory.

This is a blocker to move to modern CMake constructs (using targets
and properties) for targets that use headers of builtins in their own
headers, as we cannot create imported or exported targets with proper
dependencies.
