MythTV on Windows using Visual Studio
As of MythTV version 0.28, you can use Microsoft Visual Studio 2010 or greater to build a native Win32 version of all main components (plugins are still not available as of writing this).
This guide will provide you with the steps needed to install all required tools and to perform a full compile of the Mythtv source code.
Tip: The version of Visual Studio referenced in this guild is 2010, however we will try to make sure any newer version also works.
Contents
Requirements
The following tools must be installed in order to build the source. Some of the tools require specific settings or post install steps to be successfully used. Please follow each link to see detailed instructions that that component.
- Visual Studio 2010 or greater
- Qt 4.8 or greater
- MySQL client library
- Git for Windows
- CMake
- MSYS/MinGW
- YASM & NASM
- c99wrap
Get the Source
You will need to clone the git source tree.
Open a "Visual Studio Command Prompt (2010)" and navigate to where you want the source located. This guild will assume it's located in c:\source.
To clone the source from github execute the following:
git clone git://github.com/MythTV/mythtv.git
This should place the source code in c:\source\mythtv
Information about Configure
There is a PowerShell script (configure.ps1) that is used to make sure your build environment is setup correctly. It also compiles third party dependencies that are needed for MythTV.
Configure can produce two types of output
- Makefiles
- Visual Studio Solution/Project files (mostly used for debugging with Visual Studio)
Makefiles
- This is the best choice if you are looking for a simple way to quickly compile all code. It is completely command line driven and when finished, you will have all needed dll's & exe's.
Visual Studio Solution/Projects
- Best used if you want to debug or develop code. It creates a set of solution and project files. You can then open the solution file in Visual Studio and use the full features of the tool.
Tip: You can run configure multiple times to produce both the makefiles and the Visual Studio Solution. You can then run the build on the command line at any time and switch to the IDE if you need to debug something.
Command Line Options
-BuildType
- debug
- release
- clean
-OutputType
- nmake
- sln
Running Configure
To prepare to run configure, perform the following steps:
- Open a Visual Studio Command Prompt (2010)
- Change to the MythTV source directory which contains configure.ps1 (c:\source\mythtv\mythtv)
- execute: Powershell (this will allow you to run the script directly)
The above should leave you in a powershell command prompt in the source directory. Now you want to run configure.
Makefiles
.\configure -BuildType debug -OutputType nmake
Visual Studio Solution
.\configure -BuildType debug -OutputType sln
Warning: First time running configure will cause dependencies to be compiled, including FFmpeg. This will take some time.
If all is going well the output should look something like the following the fist time running configure:
When Completed you should see:
Building MythTV
At this point, if you generated a Visual Studio Solution file, it is located in the same directory as the configure script. Just open it in Visual Studio.
C:\Source\mythtv\mythtv\mythtv.sln
If you choose to generate makefiles, all you need to do is execute:
PS C:\source\mythtv\mythtv> nmake
Problems You May Encounter
Incomplete, needs to be expanded. Please help to fill the gaps or discuss the issue on the talk page
Some potential topics:
- Permission issues in Powershell (Set-ExecutionPolicy)