# CASA - Common Astronomy Software Applications
# Copyright (C) 2010 by ESO (in the framework of the ALMA collaboration)
# This file is part of CASA.
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
# Macros related to CASA's user interface
# Rule for handling task XML
# source1.xml [source2.xml ...] )
# - Generates python bindings
# - Generates tasks.py taskinfo.py
# - Defines install rules
macro( casa_add_tasks module _target )
get_filename_component( _base ${_x} NAME_WE )
get_filename_component( _xml ${_x} ABSOLUTE )
list( APPEND _all_tasks ${_base} )
set( _cli ${CMAKE_CURRENT_BINARY_DIR}/${_base}_cli.py )
set( _pg ${CMAKE_CURRENT_BINARY_DIR}/${_base}_pg.py )
set( _py ${CMAKE_CURRENT_BINARY_DIR}/${_base}.py )
set( _xsl ${CMAKE_SOURCE_DIR}/xmlcasa/install/casa2pycli.xsl )
COMMAND ${SAXON} -o ${_cli} ${_xml} ${_xsl}