-
Install a recent version of CMake
-
Install Visual Studio 14 2015 or Visual Studio 15 2017 with the C/C++ components
-
Prepare a directory structure for DLite and 3rd party libraries:
-
Select a root folder to create the directory structure. Ex:
"C:\Users\{username}\Documents\"
-
Create the following directory:
{root}\local
-
Clone the DLite repository in the root folder, creating the folder
{root}\dlite
-
-
Download hdf5 library archive from https://support.hdfgroup.org/ftp/HDF5/current/src/
-
Copy of the file
{root}\dlite\bootstrap-win.sh
into the root folder and edit it as follows:
- Modify the variable CMAKE_PATH to the path of cmake directory
- Modify the variable ROOT_PATH to your root folder
- Modify the variable PYTHON_EXECUTABLE to Python version 3.x executable
- Check the version number of hdf5 library
- To build in Win64 mode, add '-G "Visual Studio 15 Win64"' after cmake command when generating the solution (not building)
-
Open a git-bash window:
- Change the directory to your root folder
- Type
sh bootstrap-win.sh
and press enter
-
Open the file
{root}\dlite\build\dlite.sln
in Visual Studio
-
In Visual Studio:
- Select the solution configuration "Debug", then build the solution (Menu Build -> Build solution)
- Select the solution configuration "Release", then build the solution (Menu Build -> Build solution)
To run the tests, do
ctest -C Debug
Summary to build and install DLite when hdf5 and jansson lib are installed in the given path LOCAL_DIR
LOCAL_DIR=/C/Users/tco/Documents/Programs/philib/local
PATH=$PATH:$LOCAL_DIR/bin
cd dlite
mkdir build && cd build
cmake -G "Visual Studio 14 2015 Win64" -DHDF5_DIR=$LOCAL_DIR/cmake/hdf5 -DJANSSON_ROOT=$LOCAL_DIR/ -DCMAKE_INSTALL_PREFIX=$LOCAL_DIR/ ..
cmake --build . --config Debug --target doc
cmake --build . --config Debug --target install
cmake --build . --config Release --target install
ctest -C Debug
ctest -C Release