cmake_minimum_required(VERSION 3.4)
if("${CMAKE_CXX_COMPILER}" STREQUAL "")
       set(CMAKE_C_COMPILER "icx")
       set(CMAKE_CXX_COMPILER "icpx")
       set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fsycl")
endif()
project (oneCCL_Getting_Started)
if("$ENV{EXAMPLE_ROOT}" STREQUAL "")
        message(" - use default examples")
        if($ENV{CCL_CONFIGURATION} MATCHES "cpu_gpu_dpcpp")
                file(COPY $ENV{CCL_ROOT}/share/doc/ccl/examples/sycl DESTINATION src)
        endif()
        file(COPY $ENV{CCL_ROOT}/share/doc/ccl/examples/cpu DESTINATION src)
        file(COPY $ENV{CCL_ROOT}/share/doc/ccl/examples/common DESTINATION src)
        file(COPY $ENV{CCL_ROOT}/share/doc/ccl/examples/benchmark DESTINATION src)
        file(COPY $ENV{CCL_ROOT}/share/doc/ccl/examples/external_launcher DESTINATION src)
        file(COPY $ENV{CCL_ROOT}/share/doc/ccl/examples/include DESTINATION src)
        file(COPY $ENV{CCL_ROOT}/share/doc/ccl/examples/pt2pt DESTINATION src)
        file(COPY $ENV{CCL_ROOT}/share/doc/ccl/examples/CMakeLists.txt DESTINATION src)
        add_subdirectory (${PROJECT_BINARY_DIR}/src out)
else()
        add_subdirectory ($ENV{EXAMPLE_ROOT} out)
endif()
