Jump to Windows | Linux | macOS instructions.
-
Install free Microsoft Visual Studio Community 2022 (64-bit). Select following components during install:
- Windows: Desktop development with C++
- Visual Studio Core Editor
- Desktop development with C++ options
- MSVC v 143 - VS 2022 C++ x64/x86 build tools
- Windows 10 SDK (10.0.x.x) for Desktop C++ x86 and x64
- C++ CMake tools for Windows
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 2008 9.0 90 Visual Studio 2010 10.0 100 Visual Studio 2012 11.0 110 Visual Studio 2013 12.0 120 Visual Studio 2015 14.0 140 Visual Studio 2017 15.0 141 Visual Studio 2019 16.0 142 Visual Studio 2022 17.0 143 - Windows: Desktop development with C++
-
Download and install gettext pre-compiled binaries with default options.
-
Download wxWidgets 3.x binaries:
wxWidgets-3.*.*_Headers.7z
- one of
wxMSW-3.*.*-vc141_Dev.7z
orwxMSW-3.*.*-vc141_x64_Dev.7z
- one of
wxMSW-3.*.*-vc141_ReleaseDLL.7z
orwxMSW-3.*.*-vc141_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
-
Tools - Command Line - Developer Command Prompt
Start it from Main Menu
Or start the following command from start menu:
%comspec% /k "%ProgramFiles%\Microsoft Visual Studio\2022\Community\VC\Auxiliary\Build\vcvarsall.bat" amd64
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
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 17 2022" -A x64 -DBUILD_CURL_EXE=OFF -DHTTP_ONLY=ON ^ -DENABLE_MANUAL=OFF -DBUILD_TESTING=OFF -DCURL_STATICLIB=ON ^ -DCURL_USE_SCHANNEL=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
-A x64
with-A Win32
to remove 64-bit support. -
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 17 2022" -A x64 -DCMAKE_PREFIX_PATH=c:\libcurl ..
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:
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
-
Install required packages.
brew update && brew install ccache gettext cmake brew link --force gettext
Current stable version that has been tested with MMEX is v3.2.6
-
Download Sources
/bin/bash -c "$(curl -fsSL -O https://github.com/wxWidgets/wxWidgets/releases/download/v3.2.6/wxWidgets-3.2.6.tar.bz2)" tar xzf wxWidgets-*.tar.bz2
-
Build from source
cd wxWidgets-3.2.6 mkdir build-cocoa cd build-cocoa export MAKEFLAGS=-j4 ../configure --disable-shared --enable-cxx11 --with-cxx=11 \ --with-macosx-version-min=10.14 \ --without-libtiff \ --enable-universal-binary=arm64,x86_64 make
If you want to enable debug then include
--enable-debug
If you want to just build for the current architecture and don't require a universal build then you can omit
--enable-universal-binary=arm64,x86_64
You could tune
-j4
option to a different number to use all processor cores during build phase.
git clone --recursive https://github.com/moneymanagerex/moneymanagerex
mkdir moneymanagerex/build
cd moneymanagerex/build
export MAKEFLAGS=-j4
cmake -DCMAKE_CXX_FLAGS="-w" \
-DwxWidgets_CONFIG_EXECUTABLE={PATH-TO-wxWidgets}/wxWidgets-3.2.6/build-cocoa/wx-config \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_OSX_ARCHITECTURES="arm64;x86_64" \
-DCMAKE_OSX_DEPLOYMENT_TARGET=10.10 ..
cmake --build . --target package
Replace {PATH-TO-wxWidgets}
with the path to the directory in which you extracted the wxWidgets source in step 2.
If you want build the project for debugging purposes replace CMake flag
-DCMAKE_BUILD_TYPE=Release
with -DCMAKE_BUILD_TYPE=Debug
.
If you want to just build for the current architecture and don't require a universal build then you can omit -DCMAKE_OSX_ARCHITECTURES="arm64;x86_64"
You could tune -j4
option to a 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.
To use wxWidget 3.1.5 see: https://docs.codelite.org/wxWidgets/repo315/#ubuntu-and-debian or to build it from sources: https://docs.codelite.org/build/build_wx_widgets/
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++ |
You need git to download the sources, see prerequisites above.
If you want the stable 1.7.0 version of mmex:
git clone --recursive https://github.com/moneymanagerex/moneymanagerex --branch v1.7.0
If you want the latest (possibly unstable) version of the trunk:
git clone --recursive https://github.com/moneymanagerex/moneymanagerex
Got to the directory, where you downloaded the sources from github.
cd moneymanagerex/
mkdir build
cd build/
cmake ..
E.g. for the trunk version the output should be something like:
-- MMEX configuration summary
-- ==========================
-- Version : 1.7.1-Beta.1
-- Commit : 1edc0dfe2 (2024-01-16)
-- Branch : master
-- Host system : Linux x86_64
-- Target system : Linux x86_64
-- Build types :
-- Generator : Unix Makefiles
-- Install prefix : /usr/local
-- DB encryption : ON
--
-- Versions
-- --========--
-- Linux 6.1.38
-- Debian.12.bookworm
-- Debian.GNU/Linux.12.(bookworm)
-- CMake 3.25.1
-- GNU Make 4.3
-- ccache 4.7.5
-- GNU 12.2.0
-- wxWidgets 3.2.4
-- wxSQLite3 4.9.1
-- Lua 5.3.6
-- curl 7.88.1
-- gettext 0.21
-- ------------------ 8< -----------------
-- Configuring done
-- Generating done
-- Build files have been written to: <your $HOME >/<directory where you downloaded mmex>/moneymanagerex/build
Now build
export MAKEFLAGS=-j4 (to speed up the build)
cmake --build . --target package
If the build was ok the last message should be something like:
[...]
[100%] Built target mmex
Run CPack packaging tool...
CPack: Create package using DEB
CPack: Install projects
CPack: - Run preinstall target for: MMEX
CPack: - Install project: MMEX
CPack: Create package
CPackDeb: - Generating dependency list
CPack: - package: <directory where you saved the download from git>/moneymanagerex/mmex_1.7.1-Beta.1-Debian.12.bookworm_amd64.deb generated.
For testing without installing you can run
../_CPack_Packages/Linux/DEB/mmex-1.7.1-Beta.1-Linux/usr/bin/mmex
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 |