
Introduction:
--------------------------------------------------------------------------------
The C# bindings for AGX has previously been built via generate.bat. The file is
currently still shipped in the AGX installer, but using it is deprecated. The new
way to re-build the C# bindings if needed, is to use CMake.
The move to CMake is to simplify adding support for more operating systems.



CMake instructions for AGX/C# bindings:
--------------------------------------------------------------------------------
* Launch a command window (cmd) or terminal
* Make sure the AGX environment variables are set (setup_env)
* Navigate to <agx-installed-dir>/swig and have it as working directory
* Make sure you have write permission in the current directory
* Run a CMake, eg: "cmake-gui ."
  * Select Compiler and format for project files if needed.
               Make sure platform for the generator is the same as the platform
               of the installed AGX. Default is sometimes Win32, but x64 should
               most often be used.
  * Enable AGX_BUILD_DOTNET
  * (Optional) Disable bindings for some AGX modules using the AGX_SWIG_XXX
               options. This can be handy if you want to make the bindings
               module as small as possible. Disabling a module will also
               avoid linking its corresponding library file.
  * (Optional) Set the CMAKE_INSTALL_PREFIX to the path you want the bindings
               to be installed relative to. See "Install the bindings" below
               for the output path of the specific files. If you set this
               directory to be the AGX root directory, the bindings will
               replace the ones installed with AGX.
  * Generate project files
* Build the bindings (Windows)
  * Run "devenv /useenv agxSWIG.sln" to start Visual Studio
  * Build the "CSharp/Bindings Library/agxDotNet" project
  * Output consists of the following files, relative to the CMake binary directory,
    where CONFIG is the build configuration (Debug, Release, etc):
    - bin/[CONFIG]/agxDotNet.dll
    - bin/[CONFIG]/agxMathDotNet.dll
    - bin/[CONFIG]/agxDotNetRuntime.dll
    - lib/[CONFIG]/agxDotNetRuntime.lib
* Install the bindings (Windows)
  * Build the CMakePredefinedTargets/INSTALL project
  * Output consists of the following files, relative to CMAKE_INSTALL_PREFIX:
    - bin/[ARCHITECTURE]/agxDotNet.dll
    - bin/[ARCHITECTURE]/agxMathDotNet.dll
    - bin/[ARCHITECTURE]/agxDotNetRuntime.dll
    - lib/[ARCHITECTURE]/agxDotNetRuntime.lib
* Build the bindings (Linux or OSX)
  * Run "make"
  * Output consists of the following files, relative to the CMake binary directory:
    - bin/agxDotNet.dll
    - bin/agxMathDotNet.dll
    - lib/libagxDotNetRuntime.so (Linux)
    - lib/libagxDotNetRuntime.dylib (OSX)
* Install the bindings (Linux or OSX)
  * Run "make install"
  * Output consists of the following files, relative to CMAKE_INSTALL_PREFIX:
    - bin/agxDotNet.dll
    - bin/agxMathDotNet.dll
    - lib/libagxDotNetRuntime.so (Linux)
    - lib/libagxDotNetRuntime.dylib (OSX)



Old generate.bat instructions:
--------------------------------------------------------------------------------

***  swig\generate.bat - Build script for SWIG bindings of AGX Dynamics (Windows)

-- USAGE

  Usage: generate /VS[2017|2019|VS2022] [/WITHDOTNET] [/WITHJAVA] [/USEIB] [/REBUILD]
          OR
         generate [/INSTALL] [/WITHDOTNET] [/WITHJAVA]

-- REQUIREMENTS

  * GENERAL REQUIREMENTS

  Requires the script to be run from the swig directory of the target
  AGX source tree or binary installation, with the paths set up by its
  setup_env.bat beforehand. If run from another script, this require
  changing current working directory to %AGX_DIR%\swig before calling
  this script.

  * AGXJAVA REQUIREMENTS

  In addition to the requirement above, ant must be on your PATH in
  addition to JAVA_HOME being set to the path of your JDK 1.8 root


-- COMMAND LINE OPTIONS



  /VS2017     - Generate Visual Studio 15 2017 solution and project files.
                Note: Will not produce compatible binaries if AGX was built
                      using another version of Visual Studio!


  /VS2019     - Generate Visual Studio 16 2019 solution and project files.
                Note: Will not produce compatible binaries if AGX was built
                      using another version of Visual Studio!

  /VS2019     - Generate Visual Studio 17 2022 solution and project files.
                Note: Will not produce compatible binaries if AGX was built
                      using another version of Visual Studio!


  /WITHDOTNET - Will generate, build and install AGX C# .NET wrappers to the
                current AGX installation referred to by the environment variables
                AGX_DIR for binary distributions and AGX_INSTALLED_DIR for source
                distributions.


  /WITHJAVA   - Will generate, build and install AGX Java JNI wrappers to the
                current AGX installation referred to by the environment variables
                AGX_DIR for binary distributions and AGX_INSTALLED_DIR for source
                distributions.

                REQUIREMENTS: The required build files for AGX must exist and
                              only x64 versions of AGX is supported.

  /WITHOUTXXX - Where XXX is the name of an AGX module in capitalized letters, will
                disable creating bindings for that module. This can be handy if it
                is important to keep the size of the bundle small, since the bindings
                dll will only be linked to the AGX libraries corresponding to the
                bindings created.

                Example: Specifying /WITHOUTCABLE /WITHOUTHYDRAULICS will avoid
                creating bindings for the agxCable and agxHydraulics modules, which
                will also avoid dependencies to the agxCable.dll and agxHydraulics.dll
                libraries.

                Below is a list of accepted /WITHOUTXXX commands:
                    /WITHOUTCABLE
                    /WITHOUTHYDRAULICS
                    /WITHOUTOSG
                    /WITHOUTSENSOR
                    /WITHOUTTERRAIN
                    /WITHOUTVEHICLE

  /REBUILD    - Instructs the build script to perform a clean rebuild, deleting
                any files generated from previous builds, CMake caches and project
                files.


  /INSTALL    - Instructs the build script to only install the required runtime
                DLL (and LIB for Java) to the appropriate AGX installation directories.

                The /INSTALL flag exists so generation and build steps may be skipped
                so one may install prebuilt binaries for a language binding to an
                already installed distribution of AGX.

                AGXJava is distributed with prebuilt binaries in addition to the
                required build files and "sources", but building agxJava is rarely
                required so this flag may be used in man cases to simplify setup
                of agxJava.

                The INSTALL step is only applied to the bindings specified
                by either /WITHJAVA and/or /WITHDOTNET,
