mirror of
https://github.com/Tencent/rapidjson.git
synced 2025-03-09 19:24:23 +01:00

* 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`)
23 lines
614 B
CMake
23 lines
614 B
CMake
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)
|