OpenSSL-CMake

The OpenSSL-CMake project provides a CMake build system on-top of the OpenSSL source code. The OpenSSL-CMake project only provides the CMake build system. This is particularly useful for building OpenSSL on Windows because it removes the PERL build dependency. You also don’t need to have MSYS install to build OpenSSL-CMake.

Toolchain files for mingw-w64 are also included so cross-compiling OpenSSL for Windows (At the moment the win64 build has pointer size issues!) 32 or 64-bit is easy from Linux.

The project is hosted on Launchpad.

Windows Build

To compile OpenSSL-CMake on a windows box:

(1) Get the code: bzr branch lp:openssl-cmake/1.0.1e openssl-cmake

(2) Make a build directory..

cd openssl-cmake
mkdir build
cd build

(3) Configure with cmake

cmake -G "CodeBlocks - MinGW Makefiles" -DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LIBS=ON ..\

(4) Make mingw32-make

Cross-Compile

To Cross-Compile OpenSSL on Linux (Assuming you have the mingw-w64 toolchain successfully installed and in your normal path):

(1) Get the code: bzr branch lp:openssl-cmake/1.0.1e openssl-cmake

(2) Make a build directory..

cd openssl-cmake
mkdir build
cd build

(3) Configure with cmake

cmake -G "CodeBlocks - MinGW Makefiles" -DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LIBS=ON -DCMAKE_TOOLCHAIN_FILE=../cmake/toolchain-mingw32.cmake ../

(4) Make make

Packaging

You can use the package target to generate a zip and tar.gz “install”:

make package

Leave a Reply