Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/miloyip/rapidjson.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndriy Senkovych <jolly_roger@itblog.org.ua>2014-11-04 01:36:24 +0300
committerAndriy Senkovych <jolly_roger@itblog.org.ua>2014-11-11 18:26:59 +0300
commit8ae1c971ea833fed0640dd87abdeb3374ce890e7 (patch)
tree4edb218eeb3a4776e6fdb1f8b9a11bece86540dd /CMakeModules
parent8d4405cf6309acb89c2cffad4bd5c19ff23b3584 (diff)
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`)
Diffstat (limited to 'CMakeModules')
-rw-r--r--CMakeModules/FindGTestSrc.cmake22
1 files changed, 22 insertions, 0 deletions
diff --git a/CMakeModules/FindGTestSrc.cmake b/CMakeModules/FindGTestSrc.cmake
new file mode 100644
index 00000000..89f132e5
--- /dev/null
+++ b/CMakeModules/FindGTestSrc.cmake
@@ -0,0 +1,22 @@
+SET(GTEST_SEARCH_PATH
+ "${GTEST_SOURCE_DIR}"
+ "${CMAKE_SOURCE_DIR}/thirdparty/gtest")
+
+IF(UNIX)
+ LIST(INSERT GTEST_SEARCH_PATH 1 "/usr/src/gtest")
+ENDIF()
+
+FIND_PATH(GTEST_SOURCE_DIR
+ NAMES CMakeLists.txt src/gtest_main.cc
+ PATHS ${GTEST_SEARCH_PATH})
+
+# Debian installs gtest include directory in /usr/include, thus need to look
+# for include directory separately from source directory.
+FIND_PATH(GTEST_INCLUDE_DIR
+ NAMES gtest/gtest.h
+ PATH_SUFFIXES include
+ PATHS ${GTEST_SEARCH_PATH})
+
+find_package_handle_standard_args(GTestSrc DEFAULT_MSG
+ GTEST_SOURCE_DIR
+ GTEST_INCLUDE_DIR)