The libTML-c library is intended to be used on multiple platforms. CMake is used to simplify building, installing or creating project files for a preferred development environment and platform. All instructions in this section require to install CMake. You can download CMake here: http://www.cmake.org/download/
All instructions require the sources of the libTML-c library from GitHub. Download the ZIP archive and extract the files on your target or build system.
Currently the following target systems are tested:
It is optional to build the libTML TLS profile supporting library for TLS encoded connections.
To enable the libTML TLS build option you have to add the parameter BUILD_TLS=yes to the make file generation command line.
Example:
cmake .. -G "Unix Makefiles" -DTML_TARGET_PLATFORM=linux_x86-32 -DBUILD_TLS=yes
See also:
To build libTML various libraries need to be present. Refer to the documentation of the particular library for installation.
The AXL library is an XML 1.0 implementation. It is optimized for speed and a small memory footprint.
./configure --disable-py-axl make make install
Vortex is a BEEP core implementation.
To build the Vortex TLS module, the SSL development library is required.
On Debian, for example, you can install the libraries with using apt-get.
apt-get install libssl-dev
The normal sequence of commands to build Vortex from source:
./configure make make install
Building Vortex on OS X may show errors. Use the options to work around them.
./configure --disable-vortex-log --disable-vortex-client --disable-py-vortex --disable-sasl-support CFLAGS="-Qunused-arguments -Wno-deprecated" make make install
For Unicode and string encoding support, libTML is using the libiconv library.
./configure make make install
The libTML library can be used without the optional TLS support and installing openSSL can be skipped in that case. TLS profile will not be available in this case tough.
In order to use the optional libTML TLS profile support it is required to install libssl / openSSL library and binaries.
By default cmake finds the library and include paths automatically. If the libraries are not installed in the default location, the CMakeLists.txt in the root directory of libTML-c has to be modified. These modifications are usually necessary on Windows. Find the intended build target in the CMakeLists.txt file and modify the directories.
Set include directories:
set(AXLINCLUDE "C:\\Program Files (x86)\\AxlW32\\include\\axl") set(VORTEXINCLUDE "C:\\Program Files (x86)\\VortexLibrary-1.1-W32\\include\\vortex") set(ICONVINCLUDE usr/local/include/iconv)
Set library directories:
LINK_DIRECTORIES("C:\\Program Files (x86)\\AxlW32\\lib") LINK_DIRECTORIES("C:\\Program Files (x86)\\VortexLibrary-1.1-W32\\lib")
For multiple library directories add this line with a different path.
The libTML-c library API makes use of the char16_t data type. It is mandatory, to use a compiler, that supports char16_t data type (gcc >= 4.4 on Unix-like systems and MinGW).
To build libTML-c on Windows you can use either Visual Studio or MinGW.
The compiled libraries require the MinGW run time libraries.
Download the MinGW Installer from http://www.mingw.org/. After installation start the guimain.exe
and mark the required packages:
Apply changes to install the packages. Open the MSys console (<MinGW Installdir>\msys\1.0\msys.bat
) and go to the root directory of the libTML-c files.
To compile 64 bit libraries with MinGW a 64 bit compiler is required. After installing MinGW for 32 bit you need to download the 64 bit MinGW package from **here** Extract the package but do not overwrite the previous 32 bit MinGW installation.
Use the win_mingw64.cmake
tool chain to set the compiler path for win64 binary build. (see Build libTML-c win64 with MinGW)
To build libTML-c win32 binaries on Windows with MinGW, the settings for the tool chain have to be adjusted. CMake needs the information where to find win32 compiler. Edit the tool chain file win_mingw32.cmake
. The file is located in the sources root.
win_mingw32.cmake
.set(MINGW_BIN_DIRECTORY C:/mingw/bin)
<MinGW Installdir>\msys\1.0\msys.bat
) and go to the libTML directory.mkdir build
cd build
cmake .. -DCMAKE_TOOLCHAIN_FILE=win_mingw32.cmake -G "Unix Makefiles" -DTML_TARGET_PLATFORM=win_x86-32_mingw
The CMake cache file
CMakeCache.txt
is storing parameters from a previous build. If you create the binaries for different platform you need to deleteCMakeCache.txt
and theCMakeFiles
directory in order to create a clean new set of project files.
cmake --build . --clean-first
build\win_x86-32_mingw\sidex\sidex12.dll
build\win_x86-32_mingw\tml\tmlcore12.dll
build\win_x86-32_mingw\tml-tls\tml-tls12.dll
*)TLS build option enabledbuild\win_x86-32_mingw\test\libTmlTest.exe
See also:
To build libTML-c win64 binaries on Windows with MinGW, the settings for the tool chain have to be adjusted. CMake needs the information where to find win64 compiler. Edit the tool chain file win_mingw64.cmake
. The file is located in the sources root.
win_mingw64.cmake
.set(MINGW_BIN_DIRECTORY C:/mingw64/bin)
<MinGW Installdir>\msys\1.0\msys.bat
) and go to the libTML directory.mkdir build
cd build
cmake .. -DCMAKE_TOOLCHAIN_FILE=win_mingw64.cmake -G "Unix Makefiles" -DTML_TARGET_PLATFORM=win_x86-64_mingw
The CMake cache file
CMakeCache.txt
is storing parameters from a previous build. If you create the binaries for different platform you need to deleteCMakeCache.txt
and theCMakeFiles
directory in order to create a clean new set of project files.
cmake --build . --clean-first
build\win_x86-64_mingw\sidex\sidex12_64.dll
build\win_x86-64_mingw\tml\tmlcore12_64.dll
build\win_x86-64_mingw\tml-tls\tml-tls12_64.dll
*)TLS build option enabledbuild\win_x86-64_mingw\test\libTmlTest64.exe
See also:
mkdir build
cd build
cmake --help
and find the matching generator.cmake .. -G "Visual Studio 10 2010" -DTML_TARGET_PLATFORM=win_x86-32
cmake .. -G "Visual Studio 10 2010 Win64" -DTML_TARGET_PLATFORM=win_x86-64
The CMake cache file
CMakeCache.txt
is storing parameters from a previous build. If you create the binaries for different platform you need to deleteCMakeCache.txt
and theCMakeFiles
directory in order to create a clean new set of project files.
cmake --build . --clean-first --config Release
TML_TARGET_PLATFORM
parameter the binaries are located in:build\win_x86-32\sidex\Release\sidex12.dll
build\win_x86-32\sidex\Release\sidex12.lib
build\win_x86-32\tml\Release\tmlcore12.dll
build\win_x86-32\tml\Release\tmlcore12.lib
build\win_x86-32\tml-tls\Release\tml-tls12.dll
*)TLS build option enabledbuild\win_x86-32\tml-tls\Release\tml-tls12.lib
*)TLS build option enabledbuild\win_x86-32\test\Release\libTmlTest.exe
build\win_x86-64\sidex\Release\sidex12_64.dll
build\win_x86-64\sidex\Release\sidex12_64.lib
build\win_x86-64\tml\Release\tmlcore12_64.dll
build\win_x86-64\tml\Release\tmlcore12_64.lib
build\win_x86-64\tml-tls\Release\tml-tls12_64.dll
*)TLS build option enabledbuild\win_x86-64\tml-tls\Release\tml-tls12_64.lib
*)TLS build option enabledbuild\win_x86-64\test\Release\libTmlTest64.exe
See also:
mkdir build
cd build
cmake .. -G "Unix Makefiles" -DTML_TARGET_PLATFORM=linux_x86-32
cmake .. -G "Unix Makefiles" -DTML_TARGET_PLATFORM=linux_x86-64
The CMake cache file
CMakeCache.txt
is storing parameters from a previous build. If you create the binaries for different platform you need to deleteCMakeCache.txt
and theCMakeFiles
directory in order to create a clean new set of project files.
cmake --build . --clean-first
TML_TARGET_PLATFORM
parameter the binaries are located in:build\linux_x86-32\sidex\libsidex12.so
build\linux_x86-32\tml\libtmlcore12.so
build\linux_x86-32\tml-tls\libtml-tls12.so
*)TLS build option enabledbuild\linux_x86-32\test\libTmlTest
build\linux_x86-64\sidex\libsidex12_64.so
build\linux_x86-64\tml\libtmlcore12_64.so
build\linux_x86-64\tml-tls\libtml-tls12_64.so
*)TLS build option enabledbuild\linux_x86-64\test\libTmlTest64
make install
sudo make install
See also:
mkdir build
cd build
cmake .. -G "Unix Makefiles" -DTML_TARGET_PLATFORM=osx_x86-32
cmake .. -G "Unix Makefiles" -DTML_TARGET_PLATFORM=osx_x86-64
The CMake cache file
CMakeCache.txt
is storing parameters from a previous build. If you create the binaries for different platform you need to deleteCMakeCache.txt
and theCMakeFiles
directory in order to create a clean new set of project files.
cmake --build . --clean-first
TML_TARGET_PLATFORM
parameter the binaries are located in:build\osx_x86-32\sidex\libsidex12.dylib
build\osx_x86-32\tml\libtmlcore12.dylib
build\osx_x86-32\tml-tls\libtml-tls12.dylib
*)TLS build option enabledbuild\osx_x86-32\test\libTmlTest
build\osx_x86-64\sidex\libsidex12_64.dylib
build\osx_x86-64\tml\libtmlcore12_64.dylib
build\osx_x86-64\tml-tls\libtml-tls12_64.dylib
*)TLS build option enabledbuild\osx_x86-64\test\libTmlTest64
make install
sudo make install
See also:
mkdir build
cd build
cmake .. -G "Unix Makefiles" -DTML_TARGET_PLATFORM=linux_arm32
cmake --build . --clean-first
build\linux_arm32\sidex\libsidex12.so
build\linux_arm32\tml\libtmlcore12.so
build\linux_arm32\tml-tls\libtml-tls12.so
*)TLS build option enabledbuild\linux_arm32\test\libTmlTest
make install
sudo make install
See also:
To build libTML-c for Android with CMAKE, the settings for the tool chain have to be adjusted. CMake needs the information where to find the Android cross compiler. Edit the tool chain file android_arm32.cmake
. The file is located in the sources root.
The Android NDK is required for cross compilation. Depending on the intended target platform you need to download and install the matching version. The Android NDK can be downloaded from https://developer.android.com/ndk/downloads.
>The required libraries have to be build as well. Some of the libraries do not include instructions on how to build on Android. The 3rdParty
directory of the libTML source distribution contains additional files and instructions inAndroidBuild-ReadMe.md
to fill this gap. Depending on the version of the library additional modifications may be required.
A cross compile for Android on Windows requires MinGW with the MSYS packages.
android_arm32.cmake
.set(CMAKE_FIND_ROOT_PATH t:/android/standalone-20/arm-linux-androideabi-4.6/arm-linux-androideabi/bin )
set(CMAKE_C_COMPILER t:/android/standalone-20/arm-linux-androideabi-4.6/bin/arm-linux-androideabi-gcc.exe )
set(CMAKE_CXX_COMPILER t:/android/standalone-20/arm-linux-androideabi-4.6/bin/arm-linux-androideabi-g++.exe )
<MinGW Installdir>\msys\1.0\msys.bat
) and go to the libTML directory.mkdir build
cd build
cmake .. -DCMAKE_TOOLCHAIN_FILE=android_arm32.cmake -G "Unix Makefiles" -DTML_TARGET_PLATFORM=android_arm32
cmake --build . --clean-first
build\android_arm32\sidex\libsidex12.so
build\android_arm32\tml\libtmlcore12.so
build\android_arm32\tml-tls\libtml-tls12.so
\*)TLS build option enabledSee also:
mkdir build
cd build
cmake .. -G "Unix Makefiles" -DTML_TARGET_PLATFORM=freeBSD_x86-32
cmake .. -G "Unix Makefiles" -DTML_TARGET_PLATFORM=freeBSD_x86-64
The CMake cache file
CMakeCache.txt
is storing parameters from a previous build. If you create the binaries for different platform you need to deleteCMakeCache.txt
and theCMakeFiles
directory in order to create a clean new set of project files.
cmake --build . --clean-first
TML_TARGET_PLATFORM
parameter the binaries are located in:build\freeBSD_x86-32\sidex\libsidex12.so
build\freeBSD_x86-32\tml\libtmlcore12.so
build\freeBSD_x86-32\tml-tls\libtml-tls12.so
*)TLS build option enabledbuild\freeBSD_x86-32\test\libTmlTest
build\freeBSD_x86-64\sidex\libsidex12_64.so
build\freeBSD_x86-64\tml\libtmlcore12_64.so
build\freeBSD_x86-64\tml-tls\libtml-tls12_64.so
*)TLS build option enabledbuild\freeBSD_x86-64\test\libTmlTest64
make install
sudo make install
See also: