cmake_minimum_required(VERSION 3.29)
project(Phoenix)

find_package(PhoenixCMake REQUIRED)

set(PROJECT_VERSION "1.1.0")
phoenix_base_project("SagSwat" "${PROJECT_VERSION}"
		"SAG SWAT receives the trigger data of CTAO telescopes and propagates the information to SAG reconstruction pipelines"
		"https://gitlab.cta-observatory.org/cta-computing/acada/sag/sag-swat")

pull_extra_module("PhoenixCheckStream" "https://gitlab.in2p3.fr/CTA-LAPP/PHOENIX_LIBS2/serialize-io/PhoenixCheckStream.git")
pull_extra_module("PhoenixDataStream" "https://gitlab.in2p3.fr/CTA-LAPP/PHOENIX_LIBS2/serialize-io/PhoenixDataStream.git")
pull_extra_module("PhoenixPathStream" "https://gitlab.in2p3.fr/CTA-LAPP/PHOENIX_LIBS2/serialize-io/PhoenixPathStream.git")
pull_extra_module("PhoenixOptionParser" "https://gitlab.in2p3.fr/CTA-LAPP/PHOENIX_LIBS2/config/PhoenixOptionParser.git")
pull_extra_module("PhoenixProtocolBuffer" "https://gitlab.in2p3.fr/CTA-LAPP/PHOENIX_LIBS2/network/PhoenixProtocolBuffer.git")
pull_extra_module("PhoenixZMQ" "https://gitlab.in2p3.fr/CTA-LAPP/PHOENIX_LIBS2/network/PhoenixZMQ.git")
pull_extra_module("PhoenixSwarm" "https://gitlab.in2p3.fr/CTA-LAPP/PHOENIX_LIBS2/PhoenixSwarm.git")
pull_extra_module("PhoenixProtoBuffStreamToHdf5" "https://gitlab.in2p3.fr/CTA-LAPP/PHOENIX_LIBS2/network/PhoenixProtoBuffStreamToHdf5.git")

phoenix_include_directories(
	${CMAKE_CURRENT_SOURCE_DIR}
	${CMAKE_CURRENT_BINARY_DIR}
	${CMAKE_CURRENT_SOURCE_DIR}/src
	${CMAKE_CURRENT_BINARY_DIR}/src
)

phoenix_create_find(SagSwat sagswat sagswat.h "" PhoenixProtocolBuffer PhoenixZMQ PhoenixSwarm PhoenixOptionParser)

set(SAG_SWAT_LIB_DEPENDENCIES
	sagswat
	phoenix_swarm_daemon
	phoenix_swarm_function
	phoenix_zmq
	${ZMQ_LIBRARY}
	phoenix_protocol_buffer
	phoenix_swarm_representation
	phoenix_socket
	phoenix_clock
	phoenix_toml
	phoenix_yml
	phoenix_file_parser
	phoenix_option_parser
	phoenix_type_stream
	phoenix_path_stream
	phoenix_data_stream
	phoenix_check_stream
	phoenix_core
)

phoenix_add_subdirectory(src)
phoenix_add_subdirectory(program)

phoenix_tests()
