Separate C and C++ libraries and CMake fixes #6
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
CMake: version sofiles and respect libdir
Version the libraries like libnsync.so.1.20.0 and set the symlinks
properly. The version is taken from the VERSION file in the root, it
should be updated with new releases. The versioning requires CMake 3.0
so the minimum version is updated.
64bit distros use /usr/lib64 not /usr/lib so this needs to be
configurable as well.
The source properties for C++ are set outside of enabling the tests
otherwise building the C++ library with tests disabled fails.
CMake: add separate libnsync_cpp library target so C/C++ do not conflict
The libraries should be named differently otherwise they cannot be
installed together on the system. libnsync.so is the C library.
libnsync_cpp.so is the C++ library. The header files for both are
identical.
Both are built from the same source files so the C++ source files must
be copied so that the source file property LANGUAGE can be set. The copy
is done during build so the configure step does not need to be re-done
after any code changes. Per-OS settings are now all done together and
then two functions set the C / C++ properties on the build targets.
The C library is the recommended one and the C++ library takes
significantly longer to build and test so it is possible to only build
and install only the C library.
$ mkdir build; cd build
$ cmake ..
$ make nsync
$ make test_c
$ make install
Will build and install only the C library. make all will still build
both libraries like normal. There are also test_c / test_cpp targets
to run only C/C++ tests.
Signed-off-by: Jason Zaman jason@perfinion.com