Skip to content

For Windows

Jean-Michel DECORET edited this page May 6, 2019 · 59 revisions

Tools needed

Tool Version
Microsoft Visual Studio 2013 (v12) or 2015 (v14)

Libraries needed

Library Installation/Compilation
Boost BOOST_ROOT environment variable must point to Boost path. Some libraries must be compiled, see Cmake report
Poco POCO_ROOT environment variable must point to Boost path.
Protobuf PROTOBUF_ROOT environment variable must point to Protobuf path.
OpenSSL OPENSSL_ROOT environment variable must point to OpenSSL path.

Refer to the How to build from sources page to get official versions of dependencies.

CMake

For CMake versions before 3.9, override installed FindProtobuf.cmake file (located in {cmake_install_folder}/share/cmake-3.7/Modules) by this one .

Boost

Go to boost.org, download boost and extract it.

bootstrap.bat
b2.exe --with-atomic --with-chrono --with-date_time --with-filesystem --with-regex --with-thread --with-system link=static runtime-link=static

Output libraries should be found in stage folder.

Then, our cmake needs to know the BOOST_ROOT folder. There are two ways to do it:

  1. Either : create the BOOST_ROOT environment variable
  2. Or : edit/add the file "sources/CMakeListsUserConfig.txt" by adding such a line : set(BOOST_ROOT "D:/dev/boost_x_yy_z")

OpenSSL

OpenSSL must be installed before Poco.

warning only OpenSSL v1.0.xxx is supported. 1.1.xxx are not

  1. Install OpenSSL (full version) available here : https://slproweb.com/products/Win32OpenSSL.html .

  2. Build Poco (see below).

  3. Tell Yadoms where to find OpenSSL setting install folder into the Yadoms file "sources/CMakeListsUserConfig.txt", by adding such a line :

set(OPENSSL_ROOT "C:/OpenSSL")

Poco

CMake method

  1. Go to http://pocoproject.org/ , download the complete edition and extract it.

  2. Go to the extracted folder, and build Poco solution files :

cmake -DPOCO_STATIC=ON -DPOCO_MT=ON -DENABLE_MSVC_MP=ON .
  1. Open Poco.sln with VisualStudio and build Debug and Release configurations. Only these projects are needed :
  • Crypto
  • Foundation
  • JSON
  • Net
  • NetSSL
  • Util
  • Xml
  • Zip
  1. Tell Yadoms where to find Poco install folder into the Yadoms file "sources/CMakeListsUserConfig.txt", by adding such a line :
set(POCO_ROOT "D:/dev/poco-1.9.0-all")

Alternative method (windows users)

This build steps are preferred for Windows users. (really better support of yadoms cmake)

  1. Go to http://pocoproject.org/ , download the complete edition and extract it.

  2. Go to the extracted folder, and build Poco solution files :

  3. Edit buildwin.cmd and define OpenSSL root directory

  4. Edit build_vsXXX.cmd (build_vs150.cmd if using vs2017) and replace the line with this one

buildwin 150 build static_mt both Win32 nosamples notests
  1. Run build_vsXXX.cmd

Protobuf

Download ProtoBuf sources here : https://github.com/google/protobuf/releases

Unzip it and build :

md vsprojects
cd vsprojects
cmake ..\cmake
cmake --build .
cmake --build . --config Release

note : you will have to specify potentially "-Dprotobuf_BUILD_TESTS=OFF" to the cmake command line if you have the error "Cannot find gmock directory".

Tell Yadoms where to find Protobuf install folder into the Yadoms file "sources/CMakeListsUserConfig.txt", by adding such a line :

set(PROTOBUF_ROOT "D:/dev/protobuf-3.6.1")

Python (optional, needed by python script interpreter)

  1. Download the latest 2.7.x version of python 32bits only (2.7.15 at the document redaction) https://www.python.org/downloads/

  2. Install python

  3. Tell Yadoms where to find python setting install folder into the Yadoms file "sources/CMakeListsUserConfig.txt", by adding such a line :

set(PYTHON_ROOT "C:\Python27\")

Swig (optional, needed by python script interpreter)

  1. Download the last version of swig (3.0.12 at the document redaction)

  2. Extract the package into a directory

  3. Tell Yadoms where to find Swig setting install folder into the Yadoms file "sources/CMakeListsUserConfig.txt", by adding such a line :

set(SWIG_ROOT "D:/dev/swigwin/")

PostgreSQL (optional, if you want use PostgreSQL instead of SQLite as database engine)

  1. Download the last version of PostgreSQL (9.6.1 at the document redaction). Choose the 32-bits version.

  2. Extract the package into a directory

  3. Tell Yadoms where to find PostgreSQL setting install folder into the Yadoms file "sources/CMakeListsUserConfig.txt", by adding such a line :

set(PostgreSQL_ROOT "D:/dev/pgsql")
  1. Set PostgreSQL parameters in yadoms.ini file (in the Yadoms binary folder after Yadoms build)

Build

First build the Visual Studio solution, by running our batch file :

cmake_windows.cmd

The projects and solution are generated in the projects folder. To build, you can open projects/yadoms.sln with your IDE, or use this command line (from projects folder) :

cmake --build . --config Release

Replace Release by Debug to build debug version.

Binaries will be written into builds folder.

Debug

Change the working directory in the debugger properties of the project yadoms by :

$(TargetDir)
Clone this wiki locally