From 8e7d62f14bd401e4cc8737c06f16e6978b0b9e57 Mon Sep 17 00:00:00 2001 From: Jan200101 Date: Tue, 18 May 2021 11:42:27 +0200 Subject: improve cmake files, add simple curl mock, clean up on download error --- src/mock/CMakeLists.txt | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 src/mock/CMakeLists.txt (limited to 'src/mock/CMakeLists.txt') diff --git a/src/mock/CMakeLists.txt b/src/mock/CMakeLists.txt new file mode 100644 index 0000000..c2634d5 --- /dev/null +++ b/src/mock/CMakeLists.txt @@ -0,0 +1,19 @@ +SET(CURL_SOURCES + ${CMAKE_CURRENT_SOURCE_DIR}/libcurl/libcurl.c +) + +add_library(mockcurl STATIC ${CURL_SOURCES}) +target_include_directories(mockcurl PUBLIC ${LIBCURL_INCLUDE_DIRS}) + +set(NAME ${CMAKE_PROJECT_NAME}_mock) +add_executable(${NAME} ${SOURCES}) + +target_link_libraries(${NAME} LINK_PUBLIC ${JSONC_LIBRARIES}) +target_link_libraries(${NAME} LINK_PUBLIC ${LIBARCHIVE_LIBRARIES}) +target_link_libraries(${NAME} LINK_PUBLIC mockcurl) + +target_include_directories(${NAME} PUBLIC ${JSONC_INCLUDE_DIRS}) +target_include_directories(${NAME} PUBLIC ${LIBARCHIVE_INCLUDE_DIRS}) +target_include_directories(${NAME} PUBLIC ${LIBCURL_INCLUDE_DIRS}) + +target_compile_options(${NAME} PUBLIC ${CFLAGS}) \ No newline at end of file -- cgit v1.2.3