lgogdownloader/cmake/FindJsoncpp.cmake
Sandy Carter a5cc950192 CMake: Convert Makefile build to CMake
Find libraries using cmake/Find*.cmake scripts
Replace Version String with CMake implementation based on CMake Version and
git ref-parse.
Compile manpages in man/CMakeLists.txt to build:
    cmake .
    make manpage
Set debug and release versions with
    cmake -DCMAKE_BUILD_TYPE=Debug
and
    cmake -DCMAKE_BUILD_TYPE=Release
Build and install process can be:
    cmake -DCMAKE_BUILD_TYPE=Release .
    make
    make install
More build options can be found with
    cmake .
    make help
Codeblocks project can be generated using
    cmake -G "CodeBlocks - Unix Makefiles" .
2016-01-03 16:50:29 -05:00

35 lines
771 B
CMake

# - Try to find Jsoncpp
#
# Once done, this will define
# Jsoncpp_FOUND - system has Jsoncpp
# Jsoncpp_INCLUDE_DIRS - the Jsoncpp include directories
# Jsoncpp_LIBRARIES - link these to use Jsoncpp
find_package(PkgConfig)
pkg_check_modules(PC_JSONCPP REQUIRED jsoncpp)
find_path(JSONCPP_INCLUDE_DIR
NAMES
json/features.h
HINTS
${PC_JSONCPP_INCLUDEDIR}
${PC_JSONCPP_INCLUDEDIRS}
PATH_SUFFIXES
jsoncpp
PATHS
${PC_JSONCPP_INCLUDE_DIRS}
)
find_library(JSONCPP_LIBRARY jsoncpp
PATHS
${PC_JSONCPP_LIBRARY_DIRS}
)
mark_as_advanced(JSONCPP_INCLUDE_DIR JSONCPP_LIBRARY)
if(PC_JSONCPP_FOUND)
set(Jsoncpp_FOUND ON)
set(Jsoncpp_INCLUDE_DIRS ${JSONCPP_INCLUDE_DIR})
set(Jsoncpp_LIBRARIES ${JSONCPP_LIBRARY})
endif(PC_JSONCPP_FOUND)