cmake_minimum_required(VERSION 3.22)
project(Phoenix)

find_package(PhoenixCMake REQUIRED)

set(PROJECT_VERSION "1.2.1") # this line is updated by semantic release using regex

phoenix_base_project("PhoenixCallgrind" "${PROJECT_VERSION}"
		"Tool to handle valgrind callgrind and make reports compatible with PhoenixShredder"
		"https://gitlab.in2p3.fr/CTA-LAPP/PHOENIX_LIBS2/test-benchmark/PhoenixCallgrind")

pull_extra_module("PhoenixCore" "https://gitlab.in2p3.fr/CTA-LAPP/PHOENIX_LIBS2/system/PhoenixCore.git")
pull_extra_module("PhoenixOptionParser" "https://gitlab.in2p3.fr/CTA-LAPP/PHOENIX_LIBS2/config/PhoenixOptionParser.git")
pull_extra_module("PhoenixFileParser" "https://gitlab.in2p3.fr/CTA-LAPP/PHOENIX_LIBS2/config/PhoenixFileParser.git")
pull_extra_module("PhoenixToml" "https://gitlab.in2p3.fr/CTA-LAPP/PHOENIX_LIBS2/config/PhoenixToml.git")
pull_extra_module("PhoenixShredderConfig" "https://gitlab.in2p3.fr/CTA-LAPP/PHOENIX_LIBS2/test-benchmark/PhoenixShredderConfig")

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

phoenix_create_find_full(PhoenixCallgrind
	"shredder_callgrind"
	"phoenix_callgrind_config"
	"phoenix_callgrind"
	""
	PhoenixCore PhoenixOptionParser PhoenixFileParser PhoenixToml PhoenixShredderConfig
)

set(PHOENIX_CALLGRIND_EXECUTABLE "${CMAKE_CURRENT_BINARY_DIR}/program/phoenix_callgrind" CACHE STRING " executable phoenix_callgrind")
set(PHOENIXCALLGRIND_TEST_DEPENDENCIES phoenix_callgrind_config phoenix_shredder_config phoenix_toml phoenix_file_parser phoenix_option_parser phoenix_core)

phoenix_add_subdirectory(src)
phoenix_add_subdirectory(program)
phoenix_tests()
