file(GLOB ZSHELL_CLI_WHEEL "@ZSHELL_CLI_DIST_DIR@/*.whl")
if(NOT ZSHELL_CLI_WHEEL)
	message(FATAL_ERROR "No zshell-cli wheel found in @ZSHELL_CLI_DIST_DIR@")
endif()

set(_zshell_installer_args "--prefix=@CMAKE_INSTALL_PREFIX@")
if(DEFINED ENV{DESTDIR} AND NOT "$ENV{DESTDIR}" STREQUAL "")
	list(APPEND _zshell_installer_args "--destdir=$ENV{DESTDIR}")
endif()

execute_process(
	COMMAND "@Python3_EXECUTABLE@" -m installer
		${_zshell_installer_args}
		${ZSHELL_CLI_WHEEL}
	RESULT_VARIABLE ZSHELL_CLI_INSTALL_RESULT
)
if(NOT ZSHELL_CLI_INSTALL_RESULT EQUAL 0)
	message(FATAL_ERROR "zshell-cli wheel install failed")
endif()
