# FreeRDP: A Remote Desktop Protocol Implementation
# FreeRDP out-of-process xdg-open-based AAD auth helper
#
# Copyright 2026 David Fort <contact@hardening-consulting.com>
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

set(MODULE_NAME "freerdp-xdg-aad-helper")
set(HANDLER_NAME "freerdp-aad-handler")

# nothing here gets compiled - this just installs the two python scripts. The .desktop file
# that dispatches ms-appx-web:// back to freerdp-aad-handler is generated by xdg-aad-helper.py
# with its own ensure_handler_installed() that generates and (re-)installs it under the
# user's own applications directory at runtime instead, so there's a single source of truth for
# its Exec= path (the handler actually running) rather than a build-time copy that can drift out
# of sync with it.
install(PROGRAMS xdg-aad-helper.py DESTINATION ${CMAKE_INSTALL_BINDIR} RENAME ${MODULE_NAME} COMPONENT client)
install(PROGRAMS freerdp_aad_handler.py DESTINATION ${CMAKE_INSTALL_BINDIR} RENAME ${HANDLER_NAME} COMPONENT client)
