Fix error when finding the jsoncpp library (#356)

This commit is contained in:
An Tao 2020-02-22 11:34:05 +08:00 committed by GitHub
parent c9dd14bde5
commit 978bd7c32f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 16 deletions

View File

@ -3,7 +3,7 @@ matrix:
- os: linux
dist: xenial
- os: osx
osx_image: xcode11
osx_image: xcode11.3
sudo: required
@ -38,6 +38,7 @@ addons:
- lz4
- mariadb
- sqlite3
update: true
before_install:
- wget https://github.com/google/googletest/archive/release-1.10.0.tar.gz
- tar xf release-1.10.0.tar.gz

View File

@ -13,8 +13,9 @@
# only look in default directories
find_path(
JSONCPP_INCLUDE_DIR
NAMES jsoncpp/json/json.h json/json.h
NAMES json/json.h
DOC "jsoncpp include dir"
PATH_SUFFIXES jsoncpp
)
find_library(
@ -43,20 +44,6 @@ if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "MSVC")
endif()
# find JSONCPP_INCLUDE_PREFIX
find_path(
JSONCPP_INCLUDE_PREFIX
NAMES json.h
PATH_SUFFIXES jsoncpp/json json
)
if (${JSONCPP_INCLUDE_PREFIX} MATCHES "jsoncpp")
set(JSONCPP_INCLUDE_PREFIX "jsoncpp")
set(JSONCPP_INCLUDE_DIRS "${JSONCPP_INCLUDE_DIRS}/jsoncpp")
else()
set(JSONCPP_INCLUDE_PREFIX "")
endif()
# handle the QUIETLY and REQUIRED arguments and set JSONCPP_FOUND to TRUE
# if all listed variables are TRUE, hide their existence from configuration view