cmake_minimum_required(VERSION 3.22)

project(Phoenix)

find_package(PhoenixCMake REQUIRED)

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

phoenix_base_project("PhoenixFileGenerator" "0.2.0"
		"Set of tools to generate code"
		"https://gitlab.in2p3.fr/CTA-LAPP/PHOENIX_LIBS2/code-generator/PhoenixFileGenerator")

pull_extra_module("PhoenixGenerator" "https://gitlab.in2p3.fr/CTA-LAPP/PHOENIX_LIBS2/code-generator/PhoenixGenerator.git")
pull_extra_module("PhoenixOptionParser" "https://gitlab.in2p3.fr/CTA-LAPP/PHOENIX_LIBS2/config/PhoenixOptionParser.git")

phoenix_include_directories(
	${CMAKE_CURRENT_SOURCE_DIR}
	${CMAKE_CURRENT_BINARY_DIR}
	${CMAKE_CURRENT_SOURCE_DIR}/src
	${PHOENIXGENERATOR_INCLUDE_DIR}/Representation
	${PHOENIXGENERATOR_INCLUDE_DIR}/FrontEnd
	${PHOENIXGENERATOR_INCLUDE_DIR}/BackEnd
	${PHOENIXGENERATOR_INCLUDE_DIR}/TraitBackEnd/CPP/CppTraitCheckStream
	${PHOENIXGENERATOR_INCLUDE_DIR}/TraitBackEnd/CPP/CppTraitConfigStream
	${PHOENIXGENERATOR_INCLUDE_DIR}/TraitBackEnd/CPP/CppTraitCopy
	${PHOENIXGENERATOR_INCLUDE_DIR}/TraitBackEnd/CPP/CppTraitDataStream
	${PHOENIXGENERATOR_INCLUDE_DIR}/TraitBackEnd/CPP/CppTraitEmpty
	${PHOENIXGENERATOR_INCLUDE_DIR}/TraitBackEnd/CPP/CppTraitFromString
	${PHOENIXGENERATOR_INCLUDE_DIR}/TraitBackEnd/CPP/CppTraitGetter
	${PHOENIXGENERATOR_INCLUDE_DIR}/TraitBackEnd/CPP/CppTraitSetter
	${PHOENIXGENERATOR_INCLUDE_DIR}/TraitBackEnd/CPP/CppTraitTypeStream
)

if(NOT DOC_ONLY)
	phoenix_create_bash_completion("phoenix_filegenerator")
endif()
phoenix_create_find_program(PhoenixFileGenerator phoenix_filegenerator "" PhoenixGenerator PhoenixOptionParser)

set(FILE_GENERATOR_PROGRAM ${CMAKE_CURRENT_BINARY_DIR}/src/phoenix_filegenerator)
phoenix_add_subdirectory(src)
phoenix_tests()
