File tree Expand file tree Collapse file tree 15 files changed +58
-50
lines changed
Expand file tree Collapse file tree 15 files changed +58
-50
lines changed Original file line number Diff line number Diff line change @@ -14,10 +14,8 @@ if(${BUILD_CURL_FROM_SOURCE})
1414 # In libcurl, CMakeLists build static lib is broken add build command via
1515 # make
1616 if (NOT TARGET libcurl_static_build)
17- if (NOT curl_bundle_POPULATED)
18- FetchContent_Populate(curl_bundle)
19- endif ()
20- find_package (openssl)
17+ FetchContent_MakeAvailable(curl_bundle)
18+ find_package (OpenSSL)
2119 add_custom_command (
2220 OUTPUT ${curl_bundle_BINARY_DIR} /lib/libcurl.a
2321 WORKING_DIRECTORY ${curl_bundle_SOURCE_DIR}
Original file line number Diff line number Diff line change @@ -14,9 +14,7 @@ if(${BUILD_CURL_FROM_SOURCE})
1414 FetchContent_GetProperties(openssl102)
1515
1616 if (NOT TARGET openssl102_static_build)
17- if (NOT openssl102_POPULATED)
18- FetchContent_Populate(openssl102)
19- endif ()
17+ FetchContent_MakeAvailable(openssl102)
2018 add_custom_command (
2119 OUTPUT ${openssl102_BINARY_DIR} /lib/libssl.a
2220 WORKING_DIRECTORY ${openssl102_SOURCE_DIR}
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" )
Original file line number Diff line number Diff line change @@ -9,9 +9,7 @@ if(NOT ORIGIN_EXT2FS)
99 FetchContent_GetProperties(e2fsprogs)
1010
1111 if (NOT TARGET libext2fs_build)
12- if (NOT e2fsprogs_POPULATED)
13- FetchContent_Populate(e2fsprogs)
14- endif ()
12+ FetchContent_MakeAvailable(e2fsprogs)
1513 set (LIBEXT2FS_INSTALL_DIR ${e2fsprogs_SOURCE_DIR} /build /libext2fs CACHE STRING "" )
1614
1715 add_custom_command (
Original file line number Diff line number Diff line change 1717endif ()
1818
1919if (BUILD_CURL_FROM_SOURCE)
20- find_package (openssl REQUIRED)
21- find_package (curl REQUIRED)
20+ find_package (OpenSSL REQUIRED)
21+ find_package (CURL REQUIRED)
2222 add_dependencies (photon_obj CURL::libcurl OpenSSL::SSL OpenSSL::Crypto)
2323endif ()
2424
Load Diff This file was deleted.
Original file line number Diff line number Diff line change @@ -44,19 +44,23 @@ set(CMAKE_CXX_STANDARD_REQUIRED on)
4444set (ENABLE_MIMIC_VDSO off )
4545
4646option (BUILD_CURL_FROM_SOURCE "Compile static libcurl" off )
47+ option (BUILD_STREAM_CONVERTOR "Build the stream convertor" on )
4748option (ORIGIN_EXT2FS "Use original libext2fs" off )
49+
4850find_package (photon REQUIRED)
4951find_package (tcmu REQUIRED)
50- find_package (yaml-cpp)
51- if (NOT yaml-cpp_FOUND)
52- FetchContent_Declare(
53- yaml-cpp
54- GIT_REPOSITORY https://github.com/jbeder/yaml-cpp.git
55- GIT_TAG 0.8.0
56- )
57- FetchContent_MakeAvailable(yaml-cpp)
58- endif ()
5952
53+ if (BUILD_STREAM_CONVERTOR)
54+ find_package (yaml-cpp)
55+ if (NOT yaml-cpp_FOUND)
56+ FetchContent_Declare(
57+ yaml-cpp
58+ GIT_REPOSITORY https://github.com/jbeder/yaml-cpp.git
59+ GIT_TAG 0.8.0
60+ )
61+ FetchContent_MakeAvailable(yaml-cpp)
62+ endif ()
63+ endif ()
6064
6165if (BUILD_TESTING)
6266 enable_testing ()
Original file line number Diff line number Diff line change 1- find_package (curl REQUIRED)
2- find_package (openssl REQUIRED)
1+ find_package (CURL REQUIRED)
2+ find_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 @@ -6,7 +6,10 @@ add_subdirectory(cache)
66add_subdirectory (tar)
77add_subdirectory (gzip)
88add_subdirectory (gzindex)
9- add_subdirectory (stream_convertor)
9+
10+ if (BUILD_STREAM_CONVERTOR)
11+ add_subdirectory (stream_convertor)
12+ endif ()
1013
1114add_library (overlaybd_lib INTERFACE )
1215target_include_directories (overlaybd_lib INTERFACE
Original file line number Diff line number Diff line change 11include_directories ($ENV{GFLAGS} /include )
22link_directories ($ENV{GFLAGS} /lib)
33
4- find_package (curl REQUIRED)
4+ find_package (CURL REQUIRED)
55
66add_executable (ocf_perf_test ocf_perf_test.cpp)
77target_include_directories (
You can’t perform that action at this time.
0 commit comments