cmake_minimum_required(VERSION 3.22)

project(Phoenix)

find_package(PhoenixCMake REQUIRED)

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

phoenix_base_project("PhoenixOptionParser" "${PROJECT_VERSION}"
		"Set of tools to ease option parsing"
		"https://gitlab.in2p3.fr/CTA-LAPP/PHOENIX_LIBS2/config/PhoenixOptionParser")

pull_extra_module("PhoenixCore" "https://gitlab.in2p3.fr/CTA-LAPP/PHOENIX_LIBS2/system/PhoenixCore.git")

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

set(RELATIVE_BASH_COMPLETION_SCRIPT ${CMAKE_CURRENT_SOURCE_DIR}/phoenix_bash_completion.cmake CACHE PATH "Path to the relative position of the bash completion script generator" FORCE)

phoenix_create_find(PhoenixOptionParser phoenix_option_parser OptionParser.h "phoenix_bash_completion.cmake" PhoenixCore)

message(STATUS "PHOENIXCMAKE_INSTALL_DIR = '${PHOENIXCMAKE_INSTALL_DIR}'")
install(FILES phoenix_bash_completion.cmake DESTINATION share/cmake/Modules)
include(phoenix_bash_completion.cmake)

phoenix_add_subdirectory(src)

phoenix_tests()

phoenix_add_subdirectory(share)

