Skip to content

Latest commit

 

History

History
233 lines (180 loc) · 8.13 KB

BuildDCCPlugins.md

File metadata and controls

233 lines (180 loc) · 8.13 KB

Building Plugins

  1. Windows
  2. Mac OSX
  3. Linux
  4. Installation
  5. Tips
  6. Creating a Github Release

Building on Windows

Prerequisites (Win)

  1. Install cmake version 3.18 or later.
    Make sure to choose one of the "Add CMake to the System PATH ..." options as shown below.
    CMakeInstallation

  2. Install Visual Studio 2017, together with the following components:

    • Windows 8.1 SDK
    • Windows Universal CRT SDK
  3. Install git. For example: SourceTree

  4. Build Poco (static libraries).

    • Download Poco 1.10.1 and extract the file in a folder.
    • Start "Developer Command Prompt for VS 2017" and go to where Poco was extracted.
    • Execute the following in the command prompt:
    $ mkdir cmake-build
    $ cd cmake-build
    $ cmake .. -DBUILD_SHARED_LIBS=OFF -G "Visual Studio 15 2017" -A x64
    $ cmake --build . --config Release && cmake --build . --config Debug
    

    To build Poco libraries with other configurations, see Poco's Getting Started.

  5. Add Poco_DIR environment variable to point to the Poco root folder above.

  6. Setup DCC tools for building.

  7. On Windows 10, allow regular users to create symbolic links.

Build Steps (Win)

Start "Developer Command Prompt for VS 2017" and execute the following:

$ git clone https://github.com/Unity-Technologies/MeshSyncDCCPlugins
$ cd MeshSyncDCCPlugins\Plugins~\Build
$ make_meshsync_dcc_plugin.bat <meshsync_version> [optional_arguments]
$ msbuild MeshSyncDCCPlugins.sln /t:Build /p:Configuration=Release /p:Platform=x64 /m /nologo
$ cmake -DBUILD_TYPE=Release -P cmake_install.cmake

make_meshsync_dcc_plugin.bat has two parameters:

  • <meshsync_version>
    The MeshSync package version that we want the DCC plugins to work with.
  • [optional_arguments]
    See MakeOptionalArguments for more details.

For a regular "Command Prompt", there is a script: VsDevCmd_2017.bat under the Build folder, which if executed, will turn the prompt into a "Developer Command Prompt for VS 2017".

Notes

The build process will try to link againts Poco's release libraries in the following order:

  1. Release
  2. MinSizeRel
  3. RelWithDebInfo

Building on Mac OSX

Prerequisites (Mac)

  1. Install XCode.

  2. Install XCode Command Line tools.

    xcode-select --install
    
  3. Install Homebrew.

  4. Install cmake version 3.18 or later.

    brew install cmake
    
  5. Install git. For example: SourceTree

  6. Build Poco (static libraries).

    • Download Poco 1.10.1 and extract the file in a folder.
    • Open a terminal and go to where Poco was extracted.
    • Execute the following in the command prompt:
    $ mkdir cmake-build
    $ cd cmake-build
    $ cmake .. -DBUILD_SHARED_LIBS=OFF -DCMAKE_BUILD_TYPE=Release && cmake --build . 
    $ cmake .. -DBUILD_SHARED_LIBS=OFF -DCMAKE_BUILD_TYPE=Debug && cmake --build . 
    

    For other types of Poco configurations, see Poco's Getting Started.

  7. Add Poco_DIR environment variable to point to the Poco root folder above. For example:

    export Poco_DIR=~/MySDK/poco
    

    It might also be good to add this command to ~/.bash_profile

  8. Install tbb via Homebrew

    $ brew install tbb
    

    Currently, the used version is stable 2020_U1.

  9. Setup DCC tools for building.

Build Steps (Mac)

Open a terminal and execute the following:

$ git clone https://github.com/Unity-Technologies/MeshSyncDCCPlugins
$ cd MeshSyncDCCPlugins/Plugins~/Build
$ ./make_meshsync_dcc_plugin <meshsync_version> [Custom Arguments]
$ xcodebuild -alltargets -configuration Release build

make_meshsync_dcc_plugin has two parameters:

  • <meshsync_version>
    The MeshSync package version that we want the DCC plugins to work with.
  • [optional_arguments]
    See MakeOptionalArguments for more details.

Building on Linux

Prerequisites (Linux)

  1. Make sure C++14 development is supported, and define CC and CXX environment variables to point to C++14 dev tools.
    For example, by installing devtoolset-7 in in CentOS 7, and then defining CC and CXX environment variables as follows:

    export CC=/opt/rh/devtoolset-7/root/usr/bin/gcc
    export CXX=/opt/rh/devtoolset-7/root/usr/bin/g++
    

    Note: If you are compiling for Blender 3.2+, ensure that you are using gcc-8 or above and g++8 or above.

  2. Install cmake version 3.18 or later.
    Example:

    wget https://github.com/Kitware/CMake/releases/download/v3.18.4/cmake-3.18.4.tar.gz    
    tar zxvf cmake-3.18.4.tar.gz
    cd cmake-3.18.4
    ./bootstrap --prefix=/usr/local
    make -j$(nproc)
    make install    
    
  3. Install git.

  4. Build Poco (static libraries).

    • Download Poco 1.10.1 and extract the file in a folder.
    • Open a terminal and go to where Poco was extracted.
    • Execute the following in the command prompt:
    $ mkdir cmake-build
    $ cd cmake-build
    $ cmake .. -DBUILD_SHARED_LIBS=OFF -DCMAKE_BUILD_TYPE=Release -DCMAKE_POSITION_INDEPENDENT_CODE=ON && cmake --build . 
    $ cmake .. -DBUILD_SHARED_LIBS=OFF -DCMAKE_BUILD_TYPE=Debug -DCMAKE_POSITION_INDEPENDENT_CODE=ON && cmake --build . 
    

    For other types of Poco configurations, see Poco's Getting Started.

  5. Add Poco_DIR environment variable to point to the Poco root folder above. For example:

    export Poco_DIR=~/MySDK/poco
    

    It might be convenient to add this command to ~/.bash_profile.

  6. Setup DCC tools for building.

Build Steps (Linux)

Open a terminal and execute the following:

$ git clone https://github.com/Unity-Technologies/MeshSyncDCCPlugins
$ cd MeshSyncDCCPlugins/Plugins~/Build
$ ./make_meshsync_dcc_plugin <meshsync_version> [Custom Arguments]
$ cmake --build . 
$ cmake -DBUILD_TYPE=Release -P cmake_install.cmake

make_meshsync_dcc_plugin has two parameters:

  • <meshsync_version>
    The MeshSync package version that we want the DCC plugins to work with.
  • [optional_arguments]
    See MakeOptionalArguments for more details.

Installation

If the build is successful, the generated binary files will be located in this folder:

Dist/MeshSyncClient_<meshsync_version>_<DCC_Tool>

Refer to the installation guide to install the plugin for each DCC tool.

Tips

If the build process fails, try removing CMakeCache.txt and return to execute make_meshsync_dcc_plugin again.
For example on Mac:

$ rm CMakeCache.txt
$ ./make_meshsync_dcc_plugin <meshsync_version> [Custom Arguments]
$ xcodebuild -alltargets -configuration Release build

Creating a Github Release

When creating a new release, please do the following, either via CI or manually.

  1. Go to the Dist folder and build files for distribution (zip) on all supported platforms:

    $ cd Plugins~/Dist
    $ ./clean_and_build_dist
    
  2. Gather all the zip files for distribution in the Dist folder and generate the meta file of the release.

    $ ./create_meta > meta.txt
    
  3. Upload all the zip files and the meta file to Github