Skip to content
Snippets Groups Projects
Commit c7734598 authored by Florian Loitsch's avatar Florian Loitsch
Browse files

Support shared libraries with Cmake. Improve README.

parent 2fb03de5
No related branches found
No related tags found
No related merge requests found
......@@ -2,8 +2,12 @@ cmake_minimum_required(VERSION 2.8)
project(double-conversion)
# pick a version #
set(double-conversion_VERSION
1.1.1)
set(double-conversion_VERSION 2.0.1)
set(double-conversion_SOVERSION_MAJOR 1)
set(double-conversion_SOVERSION_MINOR 0)
set(double-conversion_SOVERSION_PATCH 0)
set(double-conversion_SOVERSION
${double-conversion_SOVERSION_MAJOR}.${double-conversion_SOVERSION_MINOR}.${double-conversion_SOVERSION_PATCH})
# set paths for install -- empty initially
# Offer the user the choice of overriding the installation directories
......
2014-03-08:
Update version number for cmake.
Support shared libraries with cmake.
Add build instructions to the README.
2014-01-12:
Tagged v2.0.1.
Fix compilation for ARMv8 64bit (used wrong define).
......
......@@ -9,3 +9,46 @@ it can be used more easily in other projects.
There is extensive documentation in src/double-conversion.h. Other examples can
be found in test/cctest/test-conversions.cc.
Building
========
This library can be built with scons [0] or cmake [1].
The checked-in Makefile simply forwards to scons, and provides a
shortcut to run all tests:
make
make test
Scons
-----
The easiest way to install this library is to use `scons`. It builds
the static and shared library, and is set up to install those at the
correct locations:
scons install
Use the `DESTDIR` option to change the target directory:
scons DESTDIR=alternative_directory install
Cmake
-----
To use cmake run `cmake .` in the root directory. This overwrites the
existing Makefile.
Use `-DBUILD_SHARED_LIBS=ON` to enable the compilation of shared libraries.
Note that this disables static libraries. There is currently no way to
build both libraries at the same time with cmake.
Use `-DBUILD_TESTING=ON` to build the test executable.
cmake . -DBUILD_TESTING=ON
make
test/cctest/cctest --list | tr -d '<' | xargs test/cctest/cctest
[0]: http://www.scons.org
[1]: http://www.cmake.org
......@@ -29,6 +29,12 @@ ${headers}
set_target_properties(double-conversion
PROPERTIES PUBLIC_HEADER "${headers}")
if (BUILD_SHARED_LIBS)
set_target_properties(double-conversion
PROPERTIES VERSION ${double-conversion_SOVERSION}
SOVERSION ${double-conversion_SOVERSION_MAJOR})
endif()
#
# install command to set up library install
# given the above PUBLIC_HEADER property set, this
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment