if (ENABLE_UI)

    add_subdirectory(style_previews)
    add_subdirectory(scripts)

    set(files layers.json layers_mars.json styles.json)

    # at configure time we can just copy most of the files across to the build directory
    foreach( f ${files} )
        configure_file(${f} ${CMAKE_BINARY_DIR}/share/metview/eccharts/ COPYONLY)
    endforeach()

    foreach( f ${files} )

        # ensure file is installed at install time
        install( FILES ${CMAKE_BINARY_DIR}/share/metview/eccharts/${f}
                 DESTINATION share/metview/eccharts
                 PERMISSIONS OWNER_WRITE OWNER_READ GROUP_READ WORLD_READ)
    endforeach()


    # install contour style preview images
    install(DIRECTORY "${CMAKE_BINARY_DIR}/share/metview/eccharts/style_previews"
            DESTINATION "share/metview/eccharts"
            PATTERN *.tar.gz EXCLUDE)

endif()
