cmake_minimum_required(VERSION 3.16)
project(MoolBaseCustomerShowcase LANGUAGES CXX)
set(CMAKE_CXX_STANDARD 20)
find_package(Threads REQUIRED)
set(PLATFORM_SOURCE src/platform_posix.cpp)
if(WIN32)
  set(PLATFORM_SOURCE src/platform_windows.cpp)
endif()
add_library(graphenedb
  src/c_api.cpp
  src/db.cpp
  src/dialectic.cpp
  src/epistemic.cpp
  src/hyperedge.cpp
  src/hypokosh.cpp
  src/kosh_adapter.cpp
  src/lattice_placement.cpp
  src/learning.cpp
  src/entity_resolution.cpp
  src/epistemic_receipt.cpp
  src/epistemic_control.cpp
  src/escape.cpp
  src/fiber_bundle.cpp
  src/generic_relation.cpp
  src/hypokosh_runtime.cpp
  src/model_world.cpp
  src/path_verifier.cpp
  src/relation_ontology.cpp
  src/self_healing.cpp
  src/stability_critic.cpp
  ${PLATFORM_SOURCE})
target_include_directories(graphenedb PUBLIC include)
target_link_libraries(graphenedb PUBLIC Threads::Threads)
add_executable(moolbase_customer_showcase examples/customer_showcase/engine.cpp)
target_link_libraries(moolbase_customer_showcase PRIVATE graphenedb)
option(GRAPHENEDB_BUILD_SERVER "Build the POSIX HTTP example server" OFF)
if(GRAPHENEDB_BUILD_SERVER)
  if(WIN32)
    message(FATAL_ERROR "The HTTP server requires POSIX")
  endif()
  add_executable(graphenedb_server tools/graphenedb_server.cpp)
  target_link_libraries(graphenedb_server PRIVATE graphenedb)
endif()
