cmake_minimum_required(VERSION 3.22)
project(graph)

set(CMAKE_CXX_STANDARD 20)
set(CMAKE_CXX_STANDARD_REQUIRED ON)

set(CMAKE_EXPORT_COMPILE_COMMANDS true)

set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Wextra -Werror -Wno-unused-parameter -Wno-unused-variable -Wno-unused-private-field")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -Werror -Wno-unused-parameter -Wno-unused-variable -Wno-unused-private-field")

if(DEBUG)
  set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -g -DDEBUG")
  set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g -DDEBUG")
endif()

include_directories("${CMAKE_SOURCE_DIR}/inc")

option(ENABLE_PLUGINS "Enable plugins" ON)
option(ENABLE_SERVER "Enable server" ON)
option(ENABLE_PYTHON_CLIENT "Enable Python client" ON)

# build plugins
if(ENABLE_PLUGINS)
  add_subdirectory("${CMAKE_SOURCE_DIR}/src/graph/plugins")
endif()

# build gui server
if(ENABLE_SERVER)
  add_subdirectory("${CMAKE_SOURCE_DIR}/src/graph/server")
endif()

# build python package
if(ENABLE_PYTHON_CLIENT)
  add_subdirectory("${CMAKE_SOURCE_DIR}/src/python")
endif()