Add initial CMake support

* Support for both in-source and out-of-source builds
 * Set library version to 0.12 to map Debian package
 * Add separate options to build tests, examples and documentation
 * Add pkgconfig lookup support (if installed with `make install`)
 * Add CMake lookup support (if isntalled with `make install`)
 * Add Google Test Source lookup
 * Add CTest support for running tests (use `make test` or `ctest -V`)
This commit is contained in:
Andriy Senkovych
2014-11-04 00:36:24 +02:00
parent 8d4405cf63
commit 8ae1c971ea
11 changed files with 212 additions and 1 deletions

19
example/CMakeLists.txt Normal file
View File

@@ -0,0 +1,19 @@
# Copyright (c) 2011 Milo Yip (miloyip@gmail.com)
# Copyright (c) 2013 Rafal Jeczalik (rjeczalik@gmail.com)
# Distributed under the MIT License (see license.txt file)
set(EXAMPLES
capitalize
condense
messagereader
pretty
prettyauto
serialize
simpledom
simplereader
simplewriter
tutorial)
foreach (example ${EXAMPLES})
add_executable(${example}_ ${example}/${example}.cpp)
endforeach()