#******************************************************************************
#
#       Copyright:      2005-2022 Paul Obermeier (obermeier@tcl3d.org)
#
#                       See the file "Tcl3D_License.txt" for information on
#                       usage and redistribution of this file, and for a
#                       DISCLAIMER OF ALL WARRANTIES.
#
#       Module:         Tcl3D -> tcl3dGauges
#       Filename:       CMakeLists.txt
#
#       Author:         Paul Obermeier
#
#       Description:    Makefile for the tcl3dGauges subpackage.
#
#******************************************************************************

IF( TCL3D_BUILD_GAUGES )

    SET( TARGET tcl3dGauges )

    ADD_CUSTOM_TARGET(
        ${TARGET} ALL
        COMMENT "Handling target ${TARGET} ..."
    )
  
    ADD_CUSTOM_COMMAND(
        TARGET ${TARGET}
        WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
        COMMAND ${TCL_TCLSH} ${CMAKE_CURRENT_SOURCE_DIR}/img2pkg.tcl imgs > tclfiles/gaugeImgs.tcl
        COMMENT "Generate image package of ${TARGET} ..."
    )

    # Install the configuration specific Tcl package index file and all other Tcl files.
    INSTALL_TCL_PACKAGE( ${TARGET} "tclfiles/pkgIndex.tcl.in" "tclfiles/" "*.tcl" )

ENDIF( TCL3D_BUILD_GAUGES )
