aboutsummaryrefslogtreecommitdiff
path: root/src/mock/CMakeLists.txt
diff options
context:
space:
mode:
authorJan200101 <sentrycraft123@gmail.com>2021-05-18 11:42:27 +0200
committerJan200101 <sentrycraft123@gmail.com>2021-05-18 11:44:22 +0200
commit8e7d62f14bd401e4cc8737c06f16e6978b0b9e57 (patch)
tree94a3352969e287e5ac6040d2d2829e9656f4d492 /src/mock/CMakeLists.txt
parent52f8abc09b0d97608ba9d5b57ea96c48a1390384 (diff)
downloadpolecat-8e7d62f14bd401e4cc8737c06f16e6978b0b9e57.tar.gz
polecat-8e7d62f14bd401e4cc8737c06f16e6978b0b9e57.zip
improve cmake files, add simple curl mock, clean up on download error
Diffstat (limited to 'src/mock/CMakeLists.txt')
-rw-r--r--src/mock/CMakeLists.txt19
1 files changed, 19 insertions, 0 deletions
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