File tree Expand file tree Collapse file tree 8 files changed +31
-23
lines changed
Expand file tree Collapse file tree 8 files changed +31
-23
lines changed Original file line number Diff line number Diff line change 1+ find_package (PkgConfig)
2+ if (PKG_CONFIG_FOUND)
3+ pkg_check_modules(RAPIDJSON RapidJSON)
4+ endif ()
5+
6+ if (NOT RAPIDJSON_FOUND)
7+ if (NOT rapidjson_POPULATED)
8+ FetchContent_Populate(
9+ rapidjson
10+ GIT_REPOSITORY https://github.com/Tencent/rapidjson.git
11+ GIT_TAG 80b6d1c83402a5785c486603c5611923159d0894
12+ GIT_SUBMODULES ""
13+ )
14+ endif ()
15+ FetchContent_GetProperties(rapidjson)
16+ set (RAPIDJSON_INCLUDE_DIRS "${rapidjson_SOURCE_DIR} /include" )
17+ endif ()
18+
19+ add_definitions ("-DRAPIDJSON_HAS_STDSTRING=1" )
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 11find_package (CURL REQUIRED)
22find_package (OpenSSL REQUIRED)
33find_package (aio REQUIRED)
4- find_package (rapidjson REQUIRED)
4+ find_package (RapidJSON REQUIRED MODULE )
55
66link_libraries (rt pthread resolv)
77
@@ -19,7 +19,7 @@ add_library(overlaybd_image_lib
1919target_include_directories (overlaybd_image_lib PUBLIC
2020 ${CURL_INCLUDE_DIRS}
2121 ${OPENSSL_INCLUDE_DIR}
22- ${rapidjson_SOURCE_DIR} / include
22+ ${RAPIDJSON_INCLUDE_DIRS}
2323 ${PHOTON_INCLUDE_DIR}
2424)
2525
@@ -39,7 +39,7 @@ target_include_directories(overlaybd-tcmu PUBLIC
3939 ${TCMU_INCLUDE_DIR}
4040 ${CURL_INCLUDE_DIRS}
4141 ${OPENSSL_INCLUDE_DIR}
42- ${rapidjson_SOURCE_DIR} / include
42+ ${RAPIDJSON_INCLUDE_DIRS}
4343 ${PHOTON_INCLUDE_DIR}
4444)
4545target_link_libraries (overlaybd-tcmu
Original file line number Diff line number Diff line change @@ -5,6 +5,6 @@ find_package(CURL REQUIRED)
55add_library (registryfs_lib STATIC ${SOURCE_REGISTRYFS} )
66target_include_directories (registryfs_lib PUBLIC
77 ${CURL_INCLUDE_DIRS}
8- ${rapidjson_SOURCE_DIR} / include
8+ ${RAPIDJSON_INCLUDE_DIRS}
99 ${PHOTON_INCLUDE_DIR}
1010)
Original file line number Diff line number Diff line change @@ -3,7 +3,7 @@ file(GLOB SOURCE_SERV "*.cpp")
33add_executable (overlaybd-streamConv ${SOURCE_SERV} )
44target_include_directories (overlaybd-streamConv PUBLIC
55 ${PHOTON_INCLUDE_DIR}
6- ${rapidjson_SOURCE_DIR} / include
6+ ${RAPIDJSON_INCLUDE_DIRS}
77)
88target_link_libraries (overlaybd-streamConv
99 photon_static
Original file line number Diff line number Diff line change @@ -12,7 +12,7 @@ target_link_libraries(erofs_simple_test gtest gtest_main pthread photon_static
1212
1313target_include_directories (erofs_simple_test PUBLIC
1414 ${PHOTON_INCLUDE_DIR}
15- ${rapidjson_SOURCE_DIR} / include
15+ ${RAPIDJSON_INCLUDE_DIRS}
1616)
1717
1818add_test (
@@ -28,7 +28,7 @@ target_link_libraries(erofs_stress_test gtest gtest_main pthread photon_static
2828
2929target_include_directories (erofs_stress_test PUBLIC
3030 ${PHOTON_INCLUDE_DIR}
31- ${rapidjson_SOURCE_DIR} / include
31+ ${RAPIDJSON_INCLUDE_DIRS}
3232)
3333
3434add_test (
Original file line number Diff line number Diff line change @@ -7,7 +7,7 @@ link_directories($ENV{GTEST}/lib)
77add_executable (image_service_test image_service_test.cpp)
88target_include_directories (image_service_test PUBLIC
99 ${PHOTON_INCLUDE_DIR}
10- ${rapidjson_SOURCE_DIR} / include
10+ ${RAPIDJSON_INCLUDE_DIRS}
1111)
1212target_link_libraries (image_service_test gtest gtest_main gflags pthread photon_static overlaybd_lib overlaybd_image_lib)
1313
@@ -34,14 +34,14 @@ gtest
3434
3535target_include_directories (simple_credsrv_test PUBLIC
3636 ${PHOTON_INCLUDE_DIR}
37- ${rapidjson_SOURCE_DIR} / include
37+ ${RAPIDJSON_INCLUDE_DIRS}
3838 $ENV{GTEST} /googletest/include
3939)
4040
4141add_executable (trace_test trace_test.cpp ../tools/comm_func.cpp)
4242target_include_directories (trace_test PUBLIC
4343 ${PHOTON_INCLUDE_DIR}
44- ${rapidjson_SOURCE_DIR} / include
44+ ${RAPIDJSON_INCLUDE_DIRS}
4545)
4646target_link_libraries (trace_test gtest gtest_main gflags pthread photon_static overlaybd_lib overlaybd_image_lib)
4747
Original file line number Diff line number Diff line change @@ -17,12 +17,12 @@ target_include_directories(overlaybd-zfile PUBLIC ${PHOTON_INCLUDE_DIR})
1717target_link_libraries (overlaybd-zfile photon_static overlaybd_lib)
1818
1919add_executable (overlaybd-apply overlaybd-apply.cpp)
20- target_include_directories (overlaybd-apply PUBLIC ${PHOTON_INCLUDE_DIR} ${rapidjson_SOURCE_DIR} / include )
20+ target_include_directories (overlaybd-apply PUBLIC ${PHOTON_INCLUDE_DIR} ${RAPIDJSON_INCLUDE_DIRS} )
2121target_link_libraries (overlaybd-apply photon_static overlaybd_lib overlaybd_image_lib checksum_lib)
2222set_target_properties (overlaybd-apply PROPERTIES INSTALL_RPATH "/opt/overlaybd/lib" )
2323
2424add_executable (turboOCI-apply turboOCI-apply.cpp)
25- target_include_directories (turboOCI-apply PUBLIC ${PHOTON_INCLUDE_DIR} ${rapidjson_SOURCE_DIR} / include )
25+ target_include_directories (turboOCI-apply PUBLIC ${PHOTON_INCLUDE_DIR} ${RAPIDJSON_INCLUDE_DIRS} )
2626target_link_libraries (turboOCI-apply photon_static overlaybd_lib overlaybd_image_lib)
2727set_target_properties (turboOCI-apply PROPERTIES INSTALL_RPATH "/opt/overlaybd/lib" )
2828
You can’t perform that action at this time.
0 commit comments