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`` + +#]=======================================================================] +