From 0b87c70d3387a76dcecc994c801d0ecad259f0e5 Mon Sep 17 00:00:00 2001 From: nekobit Date: Tue, 6 Dec 2022 02:47:14 +0000 Subject: [PATCH] CMake FossilOrigin-Name: 54a80af32b1632c011476138cb702c2ac25316620b13fa4fade5187c4c502044 --- .fossil-settings/ignore-glob | 1 + CMakeLists.txt | 50 ++++++++++++++++++++++++++++++++++++ cmake/FindMastodont.cmake | 18 +++++++++++++ 3 files changed, 69 insertions(+) create mode 100644 CMakeLists.txt create mode 100644 cmake/FindMastodont.cmake diff --git a/.fossil-settings/ignore-glob b/.fossil-settings/ignore-glob index 2089a51..9710c2d 100644 --- a/.fossil-settings/ignore-glob +++ b/.fossil-settings/ignore-glob @@ -3,3 +3,4 @@ src/*.o *.a docs/html/ docs/latex/ +build/ diff --git a/CMakeLists.txt b/CMakeLists.txt new file mode 100644 index 0000000..3f06376 --- /dev/null +++ b/CMakeLists.txt @@ -0,0 +1,50 @@ +cmake_minimum_required(VERSION 3.14) +project(mastodont-c + VERSION 0.0 + DESCRIPTION "Terrible library for Mastodon and Pleroma 'n Friends" + LANGUAGES C) + +find_package(CURL REQUIRED) +add_library(mastodont-c STATIC) + +target_sources(mastodont-c PUBLIC + account.c + application.c + attachment.c + chats.c + emoji.c + error.c + fetch.c + history.c + hooks.c + instance.c + json_helper.c + list.c + mastodont.c + nodeinfo.c + notification.c + pleroma.c + query.c + relationship.c + request.c + scrobbles.c + search.c + status.c + tag.c + timeline.c + uri.c +) + +target_compile_options(mastodont-c PUBLIC + -Wall -Wextra -std=c99 + -Wshadow -Wcast-align -Wstrict-prototypes + -Werror=implicit-function-decleration +) + +target_link_options(mastodont-c PUBLIC + -lmastodont + ${CURL_LDFLAGS_OTHER} +) + +target_include_directories(mastodont-c PUBLIC include/) + diff --git a/cmake/FindMastodont.cmake b/cmake/FindMastodont.cmake new file mode 100644 index 0000000..7e9b996 --- /dev/null +++ b/cmake/FindMastodont.cmake @@ -0,0 +1,18 @@ +#[=======================================================================[.rst: +FindMastodont +-------- + +Find the Mastodont library. + +Result Variables +^^^^^^^^^^^^^^^^ + +This module defines the following variables: + +``CURL_FOUND`` +``CURL_INCLUDE_DIRS`` +``CURL_LIBRARIES`` +``CURL_VERSION_STRING`` + +#]=======================================================================] +