Jump to Windows | Linux | macOS instructions.
-
Install free Microsoft Visual Studio Community 2017. Select following components during install:
- Windows: Desktop development with C++
- Visual Studio Core Editor
- Desktop development with C++ options
- VC++ 2017 v141 toolset (x86,x64)
- Windows 10 SDK (10.0.x.x) for Desktop C++ x86 and x64
- Visual C++ tools for CMake
Older versions of Visual Studio should work but some settings must be adjusted. Please remember different VS versions uses different toolsets.
Name Version Toolset Visual Studio 2013 12.0 120 Visual Studio 2015 14.0 140 Visual Studio 2017 15.x 141 Visual Studio 2019 16.x 142 - Windows: Desktop development with C++
-
If you use Visual Studio older then 2013 Update 1 download and install Git for Windows with default options.
-
Download and install gettext pre-compiled binaries with default options.
-
Download wxWidgets 3.x binaries:
wxWidgets-3.*.*_Headers.7z
- one of
wxMSW-3.*.*-vc14x_Dev.7z
orwxMSW-3.*.*-vc14x_x64_Dev.7z
- one of
wxMSW-3.*.*-vc14x_ReleaseDLL.7z
orwxMSW-3.*.*-vc14x_x64_ReleaseDLL.7z
Unpack archives to
c:\wxWidgets\
orc:\Program Files\wxWidgets\
.You may select different directory but then
wxwin
environment variable must be set:setx wxwin c:\path\to\unpacked\wxwidgets\files
-
Developer Command Prompt
Start it from Start Menu using VS2017 x64 Native Tools Command Prompt or VS2017 x86 Native Tools Command Prompt (names my vary in different VS versions).
Or start the following command from start menu:
%comspec% /k "%ProgramFiles(x86)%\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\vcvarsall.bat" x86
Following command can be used with older VS versions (change 14.0 for correct version number):
%comspec% /k "%ProgramFiles(x86)%\Microsoft Visual Studio 14.0\VC\vcvarsall.bat" x86
Change
x86
parameter toamd64
for native 64-bit build.
IMPORTANT
All following commands must be run from this command prompt!
-
Clone MMEX official Git repository with submodules using command-line:
git clone --recursive https://github.com/moneymanagerex/moneymanagerex c:\projects\mmex
You can select MMEX version by adding
--branch v1.4.0
parameter.If git command is not recognized and you want to use git installed with VS you should find
git.exe
file and add its directory to thePATH
variabledir /n/b/s c:\%ProgramFiles(x86)%\git.exe set "PATH=%PATH%;c:\path\to\git\dir"
Or use build-in Visual Studio IDE Team Services to clone:
- Open Team Explorer using
Team
->Manage Connections...
- Select
Clone
underLocal Git Repositories
- Put
https://github.com/moneymanagerex/moneymanagerex.git
into URL field - Select
c:\projects\mmex
directory in field below URL - Select
Recursively Clone Submodule
check-box - Click
Clone
button below
- Open Team Explorer using
-
Apply patches from
util
directory to CMake modulescd "%DevEnvDir%CommonExtensions\Microsoft\CMake\CMake\share\cmake-3.8\Modules" for %p in (c:\projects\mmex\util\*.cmake-*.patch) do git apply --ignore-space-change --ignore-whitespace --whitespace=nowarn %p
See previous step for instructions if git command is not recognized.
-
Download sources of curl, unpack them to
c:\
and build libcurl library with following commands:mkdir c:\curl-<version>\build cd c:\curl-<version>\build set "PATH=%PATH%;%DevEnvDir%CommonExtensions\Microsoft\CMake\CMake\bin" cmake -G "Visual Studio 15 2017" -DBUILD_CURL_EXE=OFF -DCURL_DISABLE_LDAP=ON ^ -DCURL_DISABLE_LDAPS=ON -DCURL_DISABLE_TELNET=ON -DCURL_DISABLE_DICT=ON ^ -DCURL_DISABLE_FILE=ON -DCURL_DISABLE_TFTP=ON -DCURL_DISABLE_RTSP=ON ^ -DCURL_DISABLE_POP3=ON -DCURL_DISABLE_IMAP=ON -DCURL_DISABLE_SMTP=ON ^ -DCURL_DISABLE_GOPHER=ON -DENABLE_MANUAL=OFF -DBUILD_TESTING=OFF ^ -DBUILD_SHARED_LIBS=OFF -DCMAKE_USE_WINSSL=ON ^ -DCMAKE_INSTALL_PREFIX=c:\libcurl .. set "CL=/MP" cmake --build . --target install --config Release --clean-first ^ -- /maxcpucount /verbosity:minimal /nologo /p:PreferredToolArchitecture=x64
Replace
Visual Studio 15 2017
withVisual Studio 15 2017 Win64
for 64-bit. -
Then you should follow one of
Visual Studio project | Visual Studio CLI | Visual Studio CMake
This should work with different versions of Visual Studio and uses native tools to manage projects in VS IDE.
-
Generate build environment using CMake
mkdir c:\projects\mmex\build cd c:\projects\mmex\build set "PATH=%PATH%;%DevEnvDir%CommonExtensions\Microsoft\CMake\CMake\bin" cmake -G "Visual Studio 15 2017" -DCMAKE_PREFIX_PATH=c:\libcurl ..
Replace
Visual Studio 15 2017
withVisual Studio 15 2017 Win64
for 64-bit.This produce
c:\projects\mmex\build\MMEX.sln
file ready to be loaded into Visual Studio GUI. -
Open above solution file with
File
->Open
->Project/Solution...
menu command (orCtrl+Shift+O
). -
Run
Build
->Build Solution
menu command (orCtrl+Shift+B
). This will compile MMEX and propagate support files into right directories. -
Now you can run MMEX with
Debug
->Start Without Debugging
menu command (Ctrl+F5
) or start debugging session withDebug
->Start Debugging
(F5
). -
To create binary package (you need to have NSIS installed for this) build
PACKAGE
project.
Use this method if you don't want to use Visual Studio GUI at all. It's very similar to Unix compile methods and can be useful for batch builds, CI etc.
Look at .appveyor.yml file for more complicated command line builds scenarios examples (debug builds, using different toolset version, Windows XP/2003 compatible builds, compile wxWidgets from sources, shared DLL or static linking).
-
Execute step 1 from Visual Studio project above
-
Compile with
set "CL=/MP" cmake --build . --target install --config Release -- /maxcpucount /verbosity:minimal /nologo /p:PreferredToolArchitecture=x64
Now you can run MMEX starting
c:\projects\mmex\build\install\bin\mmex.exe
file.c:\projects\mmex\build\install
directory contains portable version. -
Build binary package (you need to have NSIS installed for this)
cpack .
Windows installer and zip archive with portable package should be produced.
This will work in Visual Studio 2017 or newer with Visual C++ tools for CMake option installed.
-
Open
c:\projects\mmex
withFile
->Open
->Folder...
menu command (orCtrl+Shift+Alt+O
). -
Select target like
x64-Debug
in project settings drop-down. -
Set path to libcurl library using
CMake
->Change CMake Settings
then adding following variables into CMakeSettings.json:"variables": [ { "name": "CMAKE_PREFIX_PATH", "value": "c:\libcurl" }
See detailed instructions for configuring CMake projects from Microsoft Visual C++ Team Blog.
-
Run
CMake
->Install
->Project MMEX
menu command before debugging session start withCMake
->Debug
->src\mmex.exe
. -
Select
src\mmex.exe
inSelect Startup Item
drop-down to unlock commands in Debug menu.
-
First verify, if you have installed Xcode Command Line Tools. Open terminal and type
git --version
if it shows something likegit version 2.11.0 (Apple Git-81)
you are fine. If not, you will be prompted to Install them via your operating system. Alternatively, you can install those tools via command:xcode-select --install
-
After that, for comfortable installing software we use Homebrew. Run the command:
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
-
Install required packages. You can choose which compiler you want to use:
brew update && brew install wxmac gettext cmake brew link --force gettext
git clone --recursive https://github.com/moneymanagerex/moneymanagerex
You can select MMEX version by adding --branch v1.4.0
parameter.
mkdir moneymanagerex/build
cd moneymanagerex/build
export MAKEFLAGS=-j4
cmake -DCMAKE_BUILD_TYPE=Release ..
cmake --build . --target package
If you want build the project with for debugging proposes replace CMake flag
-DCMAKE_BUILD_TYPE=Release
with -DCMAKE_BUILD_TYPE=Debug
.
You could tune -j4
option to different number to use all processor cores
during build phase.
All required packages should be installed from official distribution using native package manager:
Distribution | Update packages list | Install package |
---|---|---|
Debian, Ubuntu, Mint | sudo apt update |
sudo apt install <pkg> |
openSUSE | sudo zypper refresh |
sudo zypper install <pkg> |
Fedora | sudo dnf --refresh repolist |
sudo dnf install <pkg> |
CentOS | sudo yum clean expire-cache |
sudo yum install <pkg> |
Arch | sudo pacman -Syy |
sudo pacman -Syu <pkg> |
Slackware | sudo slackpkg update |
sudo slackpkg install <pkg> |
It is good practise to update packages list before installing new packages. This allows install or update required dependencies to the latest versions.
List of required packages for each distribution is available in dockerfiles
in dockers subdirectory. Look for file
dockers/<distribution>.<codename>/Dockerfile
- i.e. Dockerfile for Ubuntu
zesty.
Sometimes additional steps / workarounds are needed for specific distribution or version - they are included in above mentioned dockerfiles. Please run them before next steps.
You can choose which compiler you want to use: GCC (default in most Linux distributions) or CLang (optional). If you want use CLang you should install additional package and select it as default compiler:
Distribution | CLang pkg | Change compiler to CLang |
---|---|---|
Debian, Ubuntu, Mint | clang | sudo update-alternatives --set cc /usr/bin/clang sudo update-alternatives --set c++ /usr/bin/clang++ |
openSUSE | llvm-clang | sudo ln -sf /usr/bin/clang /usr/bin/cc sudo ln -sf /usr/bin/clang++ /usr/bin/c++ |
Fedora, CentOS | clang | sudo ln -sf /usr/bin/clang /usr/bin/cc sudo ln -sf /usr/bin/clang++ /usr/bin/c++ |
Arch | clang | export CC=clang CXX=clang++ |
Slackware | llvm | export CC=clang CXX=clang++ |
Same as for macOS
Same as for macOS
Distribution | Install package from local file |
---|---|
Debian, Ubuntu, Mint | sudo apt install ./mmex-<version>.deb |
openSUSE | sudo zypper install ./mmex-<version>.rpm |
Fedora | sudo dnf install ./mmex-<version>.rpm |
CentOS | sudo yum install ./mmex-<version>.rpm |
Arch | sudo pacman -U ./mmex-<version>.pkg.tar.xz |
Slackware | sudo installpkg ./mmex-<version>.txz |