Building on Windows
Contents |
How to build With Visual Studio 2012
What follows is how BibleTime can be built on Windows using the free version of Visual Studio Express 2012.
Install Build Tools and Binary Libraries
Visual Studio
Install Visual Studio Express 2012 for Windows Desktop(C++ version).
Install Visual Studio Update 4
http://www.microsoft.com/en-us/download/details.aspx?id=30679
Download and place inttypes.h into C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\include
http://code.google.com/p/msinttypes/
NOTE: Use v110_xp option in each project for compatibility with Windows XP. Set instructions below.
CMake
CMake is a build tool used by both BibleTime and some of the libraries below. Make sure you have version 2.8.12 or later.
Qt
Qt is a library needed by BibleTime. I installed Qt 5.2 for Visual Studio 2012.
NSIS
If you want to be able to build an installable version of BibleTime, install NSIS. I installed version 2.46.
Git
Downloading git
There are several git tools available for Windows. I choose to use "gitextensions".
7 zip
Download and install 7 zip.
pkg-config
Download pkg-config-lite from:
http://sourceforge.net/projects/pkgconfiglite/
Unzip and copy the directory into c:\Program Files (x86)\
In the Control Panel, search for "env" and add "C:\Program Files (x86)\pkg-config-lite-0.28-1\bin" to the PATH
Also add the env variable PKG_CONFIG_PATH with the value "C:\bt".
Install Source Libraries
The C:\bt directory will be used as the parent directory for these libraries. Choose another directory if desired.
zlib
- Download and unpack zlib to C:\bt from http://www.zlib.net/. I used zlib.1.2.8.
- Rename the directory to C:\bt\zlib
- Open cmake-gui
- Point its source directory to C:\bt\zlib
- Point its binary directory to C:\bt\zlib
- Click Configure and choose Visual Studio 11.
- Click Configure again.
- Click Generate on the main CMake window.
- Open the c:\bt\zlib\zlib.sln project in Visual Studio
- Right click on zlibstatic -> Properties
- Set the Configuration to All
- Under Configuration Properties -> General
- Set the Character Set to Unicode
- Set the Platform Toolset property to Visual Studio 2012 – Windows XP (v110_xp).
- Set "Release" in the toolbar as the build type
- Compile the zlibstatic project by right clicking on zlibstatic and "Build"
- Set "Debug" in the toolbar as the build type (optional)
- Compile the zlibstatic project by right clicking on zlibstatic and "Build"
- Right click on zlibstatic -> Properties
Clucene
- Download and unpack clucene-core to C:\bt from https://sourceforge.net/projects/clucene/. I used clucene-core.2.3.3.4.
- Rename the directory to C:\bt\clucene-core
- Open cmake-gui
- Point its source directory to C:\bt\clucene-core
- Point its binary directory to C:\bt\clucene-core
- Add Entry for ZLIB_INCLUDE_DIR=C:\bt\zlib
- Add Entry for ZLIB_LIBRARY=C:\bt\zlib\Release\zlibstatic.lib
- Click Configure and choose Visual Studio 11.
- Click Configure again.
- Click Generate on the main CMake window.
- Compile clucene
- Open the c:\bt\clucene-core\clucene.sln in Visual Studio
- Right click on clucene-core -> Properties
- Set the Configuration to All
- Under Configuration Properties -> General
- Set the Platform Toolset property to Visual Studio 2012 – Windows XP (v110_xp).
- Set "Release" in the toolbar as the build type
- Compile the clucene-core project by right clicking on ALL_BUILD and "Build"
- Set "Debug" in the toolbar as the build type (optional)
- Compile the clucene-core project by right clicking on ALL_BUILD and "Build"
Curl
- Download and unpack curl into C:\bt from http://curl.haxx.se/download/ I used 7.33.0.tar.gz
- Rename the directory to C:\bt\curl
- Open cmake-gui
- Point to the Source Code in C:\bt\curl
- Build the binaries in C:\bt\curl
- Click Configure and select Visual Studio 11 project files. Ignore the warnings.
- After the configure finishes:
- turn off BUILD_CURL_EXE
- turn off BUILD_CURL_TESTS
- Click Configure again.
- Click Generate on the main CMake window.
- Open Visual Studio
- Open solution c:/bt/curl/CURL.sln
- Ensure "Using Unicode Character Set" and "v110_xp" on libcurl project set as in projects above.
- Right click libcurl and open properties
- Set to "Release" and build the libcurl project.
- Set to "Debug" and build the libcurl project. (optional)
Sword
- Download Sword (v.1.7.0 or later) from ftp://ftp.crosswire.org/pub/sword/source/
- unpack it into C:\bt.
- Rename the directory to C:\bt\sword
- Copy c:/bt/sword/src/utilfuns/win32/dirent.h to c:/bt/sword/include
- Open cmake-gui
- Point to the Source Code in C:\bt\sword
- Build the binaries in C:\bt\sword-build
- Click Configure and select Visual Studio 11 project files. Ignore the warnings.
- If asked to create C:\bt\sword-build, say OK.
- If not already defined, define the following in cmake-gui.
- CLUCENE_INCLUDE_DIR:PATH=C:/bt/clucene-core/src/core
- CLUCENE_LIBRARY:FILEPATH=C:/bt/clucene-core/bin/Release/clucene-core.lib
- CLUCENE_LIBRARY_DIR:PATH=C:/bt/clucene-core/src/shared
- CURL_CONFIG:PATH:C:/bt/curl/lib/curl_config.h
- CURL_INCLUDE_DIR:PATH=C:/bt/curl/include
- CURL_LIBRARY:FILEPATH=C:/bt/curl/lib/Release/libcurl_imp.lib
- ZLIB_INCLUDE_DIR:PATH=C:/bt/zlib
- ZLIB_LIBRARY:FILEPATH=C:/bt/zlib/Release/zlibstatic.lib
- Add "/DUNICODE /D_UNICODE /DREGEX_MALLOC" to:
- CMAKE_CXX_FLAGS
- CMAKE_C_FLAGS
- Add LIBSWORD_LIBRARY_TYPE=Static
- Click Configure again.
- Click Generate on the main CMake window.
- Open Visual Studio
- Open solution c:/bt/sword-build/libsword.sln
- Add "v110_xp" to sword_static as in projects above.
- Set the build to "Release" in the toolbar of studio.
- Right click on the sword_static project and build it.
Create BibleTime, debug and release builds
Install Microsoft Redistributable Library
- Download the Visual C++ 2012 Redistributable Package from Microsoft Visual C++ 2012 (x86)
- Put the file in C:\bt\vcredist_x86.exe
Create BibleTime Solution
- Using git, clone the BibleTime project into c:\bt\bibletime and select the desired branch.
- Do the following procedure steps once for debug and separately for release.
- Add sword package config file
- Create text file C:\bt\sword.pc with the following lines
- Add sword package config file
prefix=C:/bt exec_prefix=${prefix} libdir=${prefix}/sword-build/Release includedir=${prefix}/sword/include curllib=${prefix}/curl/lib/Release/libcurl_imp zliblib=${prefix}/zlib/Release/zlibstatic Name: SWORD Description: Biblical Text Research Engine Version: 1.7.1 Libs: ${libdir}/sword.lib ${curllib}.lib ${zliblib}.lib Libs.private: -L${libdir}/sword -L${curllib} Cflags: -I${includedir}
- Open Cmake-gui
- Tell it the source is in the c:\bt\bibletime folder
- Tell it to build in c:\bt\bibletime-release (or bibletime-debug)
- Click Configure and select Visual Studio 11
- Tell it to create the build directory, if it asks
- Add an entry CMAKE_BUILD_TYPE with a value of "Release" (or Debug).
- Change the CMAKE_INSTALL_PREFIX variable to C:\bt\bibletime-release\install (or bibletime-debug\install)
- (Release only) Add an entry MSVC_REDIST with a value of "c:\bt\vcredist_x86.exe".
- If not already defined, define the following in cmake-gui.
- CLucene_INCLUDE_DIR:PATH=C:/bt/clucene-core/src/core
- CLucene_LIBRARY:FILEPATH=C:/b/clucene-core/bin/Release/clucene-core.lib
- CLucene_SHARED_LIB:FILEPATH=C:/b/clucene-core/bin/Release/clucene-shared.lib
- CLucene_LIBRARY_DIR:PATH=C:/bt/clucene-core/src/shared
- CURL_INCLUDE_DIR:PATH=C:/bt/curl/include
- CURL_LIBRARY:FILEPATH=C:/bt/curl/lib/Release/libcurl_imp.lib
- CURL_CONFIG:FILEPATH-C:/bt/curl/lib/curl_config.h
- ZLIB_INCLUDE_DIR:PATH=C:/bt/zlib
- ZLIB_LIBRARY:FILEPATH=C:/bt/zlib/Release/zlibstatic.lib
- Click Configure
- Click Generate on the main CMake window.
- Open Visual Studio
- Open c:/bt/bibletime-release/bibletime.sln (or bibletime-debug)
- Add "v110_xp" to the bibletime project as in projects above.
- Right click Bibletime project and build
- Right click INSTALL project and build
- (Release only) Right click PACKAGE and build
- Open Cmake-gui