Skip to content

Latest commit

 

History

History
143 lines (104 loc) · 4.38 KB

BuildPlugins.md

File metadata and controls

143 lines (104 loc) · 4.38 KB

Building Plugins

  1. Windows
  2. Mac OSX
  3. Linux
  4. Running Unit Tests

Building on Windows

Prerequisites (Win)

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

  2. Install Visual Studio 2019.

  3. Install git. For example: SourceTree

Build Steps (Win)

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

``` 
$ git clone https://github.com/unity3d-jp/StreamingImageSequence.git
$ cd StreamingImageSequence\Plugins~\Build 
$ cmake -G "Visual Studio 16 2019" -A x64 ..
$ msbuild StreamingImageSequencePlugin.sln /t:Build /p:Configuration=Release /p:Platform=x64 /m /nologo
```  

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

Building on Mac OSX

Prerequisites (Mac)

  1. Install cmake version 3.15 or later, if not already installed.
  2. Install XCode.
  3. Install XCode Command Line tools.
    xcode-select --install
    
  4. Install git. For example: SourceTree

Build Steps (Mac)

Open a terminal and execute the following

$ git clone https://github.com/unity3d-jp/StreamingImageSequence.git
$ cd StreamingImageSequence/Plugins~/Build 
$ cmake -GXcode ..
$ xcodebuild -scheme ALL_BUILD -configuration Release build

Building on Linux

Build Steps (Linux)

Open a terminal and execute the following

$ git clone https://github.com/unity3d-jp/StreamingImageSequence.git
$ cd StreamingImageSequence/Plugins~/Build 
$ cmake .. -DCMAKE_BUILD_TYPE=Release && cmake --build . 

Running Unit Tests

Unit Tests (Windows)

  1. Download GoogleTest
  2. Start "Developer Command Prompt for VS 2019" as administrator
  3. Execute the following inside the GoogleTest source directory.
    $ mkdir Build
    $ cd Build
    $ cmake .. 
    $ msbuild googletest-distribution.sln /t:Build /p:Configuration=Debug /p:Platform=x64 /m /nologo
    $ msbuild googletest-distribution.sln /t:Build /p:Configuration=Release /p:Platform=x64 /m /nologo
    $ cmake -DBUILD_TYPE=Debug -P cmake_install.cmake
    $ cmake -DBUILD_TYPE=Release -P cmake_install.cmake
    
  4. Add GTEST_ROOT environment variable to point to where GoogleTest was installed.
  5. Go inside the plugin folder of StreamingImageSequence and execute the following:
    $ cd StreamingImageSequence\Plugins~\Build 
    $ cmake -G "Visual Studio 16 2019" -A x64 .. -DBUILD_UNIT_TESTS=ON
    $ msbuild StreamingImageSequencePlugin.sln /t:Build /p:Configuration=Release /p:Platform=x64 /m /nologo && ctest -C Release --verbose
    

Unit Tests (Mac)

  1. Download GoogleTest
  2. Open a terminal
  3. Execute the following inside the GoogleTest source directory.
    $ mkdir Build
    $ cd Build
    $ cmake -GXcode ..
    $ xcodebuild -scheme ALL_BUILD -configuration Debug build
    $ xcodebuild -scheme ALL_BUILD -configuration Release build
    $ sudo cmake -DBUILD_TYPE=Debug -P cmake_install.cmake
    $ sudo cmake -DBUILD_TYPE=Release -P cmake_install.cmake
    
  4. Go inside the plugin folder of StreamingImageSequence and execute the following:
    $ cd StreamingImageSequence\Plugins~\Build 
    $ cmake -GXcode .. -DBUILD_UNIT_TESTS=ON
    $ xcodebuild -scheme ALL_BUILD -configuration Release build && ctest -C Release --verbose
    

Unit Tests (Linux)

  1. Open terminal
  2. Execute the following inside the GoogleTest source directory.
    $ mkdir Build
    $ cd Build
    $ cmake .. && cmake --build .
    $ sudo cmake -DBUILD_TYPE=Debug -P cmake_install.cmake
    $ sudo cmake -DBUILD_TYPE=Release -P cmake_install.cmake
    
  3. Go inside the plugin folder of StreamingImageSequence and execute the following:
    $ cd StreamingImageSequence\Plugins~\Build 
    $ cmake .. -DCMAKE_BUILD_TYPE=Release -DBUILD_UNIT_TESTS=ON 
    $ cmake --build . && ctest -C Release --verbose