Allow building with external jsoncpp
Tested-by: Build Bot
@@ -309,7 +309,14 @@ ADD_SUBDIRECTORY(src/vbucket)
ADD_SUBDIRECTORY(contrib/cbsasl)
ADD_SUBDIRECTORY(contrib/cliopts)
ADD_SUBDIRECTORY(src/ssl)
+IF(NOT LCB_JSONCPP_LIB)
ADD_SUBDIRECTORY(contrib/lcb-jsoncpp)
+ENDIF()
+IF(NOT LCB_JSONCPP_INCLUDE_DIR)
+ INCLUDE_DIRECTORIES(contrib/lcb-jsoncpp)
+ELSE()
+ INCLUDE_DIRECTORIES(${LCB_JSONCPP_INCLUDE_DIR})
+ENDIF()
IF(NOT LCB_SNAPPY_LIB)
ADD_SUBDIRECTORY(contrib/snappy)
ENDIF()
@@ -354,11 +361,13 @@ SET(LCB_CORE_OBJS
$<TARGET_OBJECTS:lcbcore>
$<TARGET_OBJECTS:lcbcore-cxx>
$<TARGET_OBJECTS:lcb_jsparse>
- $<TARGET_OBJECTS:lcb_jsoncpp>
${LCB_DTRACE_OBJECT}
${lcb_plat_objs}
${lcb_ssl_objs})
+IF(NOT LCB_JSONCPP_LIB)
+ LIST (APPEND LCB_CORE_OBJS $<TARGET_OBJECTS:lcb_jsoncpp>)
+ENDIF()
IF(NOT LCB_SNAPPY_LIB)
LIST (APPEND LCB_CORE_OBJS $<TARGET_OBJECTS:lcb_snappy>)
ENDIF()
@@ -410,6 +419,9 @@ ENDIF()
IF(LIBPROFILER)
SET(LCB_LINK_DEPS ${LCB_LINK_DEPS} ${LIBPROFILER})
ENDIF()
+IF(LCB_JSONCPP_LIB)
+ SET(LCB_LINK_DEPS ${LCB_LINK_DEPS} ${LCB_JSONCPP_LIB})
+ENDIF()
IF(LCB_SNAPPY_LIB)
SET(LCB_LINK_DEPS ${LCB_LINK_DEPS} ${LCB_SNAPPY_LIB})
ENDIF()
