#  Copyright (C) GridGain Systems. All Rights Reserved.
#  _________        _____ __________________        _____
#  __  ____/___________(_)______  /__  ____/______ ____(_)_______
#  _  / __  __  ___/__  / _  __  / _  / __  _  __ `/__  / __  __ \
#  / /_/ /  _  /    _  /  / /_/ /  / /_/ /  / /_/ / _  /  _  / / /
#  \____/   /_/     /_/   \_,__/   \____/   \__,_/  /_/   /_/ /_/

cmake_minimum_required(VERSION 3.18)

project(gridgain_subdirectory)

set(CMAKE_CXX_STANDARD 17)

option(ENABLE_CLIENT "Build GridGain.C++ Client module" OFF)
option(ENABLE_ODBC "Build GridGain ODBC driver module" OFF)

set(IGNITE_DIR ${CMAKE_CURRENT_LIST_DIR}/../../../)

add_subdirectory(${IGNITE_DIR} build)

if(ENABLE_CLIENT)
    if(NOT TARGET gridgain::client)
        message(FATAL_ERROR "gridgain::client target is not found!")
    endif()
    add_executable(test_client ${CMAKE_CURRENT_LIST_DIR}/../test_client.cpp)
    target_link_libraries(test_client gridgain::client)
endif()

if(ENABLE_ODBC)
    if(NOT TARGET gridgain::odbc)
        message(FATAL_ERROR "gridgain::odbc target is not found!")
    endif()
    add_executable(test_odbc ${CMAKE_CURRENT_LIST_DIR}/../test_odbc.cpp)
    target_link_libraries(test_odbc gridgain::odbc)
endif()
