diff --git a/cmake/FindJSONCPP.cmake b/cmake/FindJSONCPP.cmake new file mode 100644 index 0000000..ef9ae7c --- /dev/null +++ b/cmake/FindJSONCPP.cmake @@ -0,0 +1,30 @@ +#ckwg +4 +# Copyright 2010 by Kitware, Inc. All Rights Reserved. Please refer to +# KITWARE_LICENSE.TXT for licensing information, or contact General Counsel, +# Kitware, Inc., 28 Corporate Drive, Clifton Park, NY 12065. + +# Locate the system installed JSONCPP +# The following variables will be set: +# +# JSONCPP_FOUND - Set to true if JSONCPP can be found +# JSONCPP_INCLUDE_DIR - The path to the JSONCPP header files +# JSONCPP_LIBRARY - The full path to the JSONCPP library + +if( JSONCPP_DIR ) + if( JSONCPP_FIND_VERSION ) + find_package( JSCONCPP ${JSONCPP_FIND_VERSION} NO_MODULE) + else() + find_package( JSONCPP NO_MODULE) + endif() +elseif( NOT JSONCPP_FOUND ) + message(STATUS "Searching for json.h") + find_path( JSONCPP_INCLUDE_DIR json ) + message(STATUS "Searching for json.h - ${JSONCPP_INCLUDE_DIR}") + + message(STATUS "Searching for libJSONCPP") + find_library( JSONCPP_LIBRARY jsoncpp ) + message(STATUS "Searching for libJSONCPP - ${JSCONPP_LIBRARY}") + + include( FindPackageHandleStandardArgs ) + FIND_PACKAGE_HANDLE_STANDARD_ARGS( JSONDPP JSONCPP_INCLUDE_DIR JSONCPP_LIBRARY ) +endif() diff --git a/src/core/CMakeLists.txt b/src/core/CMakeLists.txt index 8708072..7a6b004 100644 --- a/src/core/CMakeLists.txt +++ b/src/core/CMakeLists.txt @@ -2,10 +2,11 @@ set(Boost_USE_STATIC_LIBS ON) find_package(Boost 1.62 COMPONENTS date_time REQUIRED) find_package(SQLite3 REQUIRED) -find_package(PkgConfig REQUIRED) +#find_package(PkgConfig REQUIRED) find_package(XLNT REQUIRED) +find_package(JSONCPP REQUIRED) #pkg_check_modules(XLNT REQUIRED xlnt>=1.3) -pkg_check_modules(JSONCPP REQUIRED jsoncpp) +#pkg_check_modules(JSONCPP REQUIRED jsoncpp) set(CORE_SOURCES database.cpp