-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathcpp-bencoding.cmake
More file actions
19 lines (17 loc) · 917 Bytes
/
Copy pathcpp-bencoding.cmake
File metadata and controls
19 lines (17 loc) · 917 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
message(STATUS "Fetching dependency s3rvac/cpp-bencoding ...")
FetchContent_Declare(
cpp-bencoding
GIT_REPOSITORY https://github.com/s3rvac/cpp-bencoding.git
GIT_TAG master
)
FetchContent_MakeAvailable(cpp-bencoding)
# cpp-bencoding does not make a cmake 3 target available so define it here
add_library(cpp-bencoding STATIC)
target_include_directories(cpp-bencoding PUBLIC ${cpp-bencoding_SOURCE_DIR}/include)
file(GLOB cpp-bencoding_SOURCES "${cpp-bencoding_SOURCE_DIR}/src/*.cpp")
target_sources(cpp-bencoding PRIVATE ${cpp-bencoding_SOURCES})
file(READ "${cpp-bencoding_SOURCE_DIR}/include/Decoder.h" CPP_BENCODING_DECODING_HEADER)
string(REPLACE "#include <exception>" "#include <stdexcept>"
CPP_BENCODING_DECODING_HEADER_FIXED
"${CPP_BENCODING_DECODING_HEADER}")
file(WRITE "${cpp-bencoding_SOURCE_DIR}/include/Decoder.h" "${CPP_BENCODING_DECODING_HEADER_FIXED}")