File: findjsoncpp.patch

package info (click to toggle)
openvr 1.23.7~ds1-2
  • links: PTS, VCS
  • area: contrib
  • in suites: bookworm
  • size: 9,980 kB
  • sloc: cpp: 14,644; cs: 7,754; ansic: 2,920; python: 1,692; makefile: 7
file content (31 lines) | stat: -rw-r--r-- 800 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
Description: Find jsoncpp lib
Author: Andrew Lee (李健秋) <ajqlee@debian.org>

---
Origin: Debian
Forwarded: not-needed
Reviewed-By: Andrew Lee (李健秋) <ajqlee@debian.org>
Last-Update: 2019-08-19

--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -100,7 +100,18 @@ if(USE_CUSTOM_LIBCXX)
 endif()
 
 if(USE_SYSTEM_JSONCPP)
-	list(APPEND EXTRA_LIBS jsoncpp)
+	find_package(PkgConfig)
+	if(PKG_CONFIG_FOUND)
+	  pkg_check_modules (JSONCPP jsoncpp)
+	endif()
+
+	if(NOT JSONCPP_FOUND)
+	  find_path(JSONCPP_INCLUDE_DIRS json/json.h
+	            PATH_SUFFIXES jsoncpp)
+	  find_library(JSONCPP_LIBRARIES jsoncpp)
+	endif()
+	include_directories(${JSONCPP_INCLUDE_DIRS})
+	list(APPEND EXTRA_LIBS ${JSONCPP_LIBRARIES})
 endif()
 
 target_link_libraries(${LIBNAME} ${EXTRA_LIBS} ${CMAKE_DL_LIBS})