Fix usage of angled -> quoted includes
FossilOrigin-Name: 9502a0fe3ad469cda46ab0835779eaa82a48533a3102d84388bd571ba7093eb5
This commit is contained in:
parent
5aa8e03d7e
commit
0e269a0eeb
12 changed files with 56 additions and 45 deletions
|
@ -13,6 +13,15 @@ set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
|
|||
|
||||
find_package(PkgConfig REQUIRED)
|
||||
find_package(CURL REQUIRED)
|
||||
# Find the real cJSON
|
||||
pkg_check_modules(CJSON libcjson)
|
||||
|
||||
if (NOT (CJSON_FOUND AND CJSON_VERSION VERSION_GREATER_EQUAL 1.7.14))
|
||||
# This was a workaround to some distributions providing an older cJSON
|
||||
message("CJSON not found or CJSON_VERSION < 1.7.14, falling back to header-only.")
|
||||
list(APPEND SRC_FILES libs/cjson/cJSON.c)
|
||||
endif()
|
||||
|
||||
|
||||
set(HEADER_FILES
|
||||
include/mastodont_account.h
|
||||
|
@ -49,9 +58,7 @@ set(HEADER_FILES
|
|||
include/mastodont.h
|
||||
)
|
||||
|
||||
add_library(mastodont STATIC ${HEADER_FILES})
|
||||
|
||||
target_sources(mastodont PRIVATE
|
||||
list(APPEND SRC_FILES
|
||||
src/account.c
|
||||
src/application.c
|
||||
src/attachment.c
|
||||
|
@ -76,9 +83,11 @@ target_sources(mastodont PRIVATE
|
|||
src/status.c
|
||||
src/tag.c
|
||||
src/timeline.c
|
||||
src/uri.c
|
||||
libs/cjson/cJSON.c
|
||||
)
|
||||
src/uri.c)
|
||||
|
||||
add_library(mastodont STATIC ${HEADER_FILES})
|
||||
|
||||
target_sources(mastodont PRIVATE ${SRC_FILES})
|
||||
|
||||
target_compile_options(mastodont PUBLIC
|
||||
-Wall -Wextra -std=c99
|
||||
|
@ -95,15 +104,18 @@ target_include_directories(mastodont PUBLIC
|
|||
)
|
||||
|
||||
# Install
|
||||
install(FILES ${HEADER_FILES} DESTINATION
|
||||
include/mastodont/)
|
||||
install(TARGETS mastodont
|
||||
if(CJSON_FOUND AND CJSON_VERSION VERSION_GREATER_EQUAL 1.7.14)
|
||||
install(FILES ${HEADER_FILES} DESTINATION
|
||||
include/mastodont/)
|
||||
install(TARGETS mastodont
|
||||
LIBRARY DESTINATION lib)
|
||||
|
||||
configure_package_config_file(cmake/MastodontConfig.cmake.in
|
||||
configure_package_config_file(cmake/MastodontConfig.cmake.in
|
||||
${CMAKE_CURRENT_BINARY_DIR}/MastodontConfig.cmake
|
||||
INSTALL_DESTINATION lib/cmake
|
||||
INSTALL_DESTINATION lib/cmake/mastodont
|
||||
PATH_VARS INCLUDE_INSTALL_DIR LIB_INSTALL_DIR)
|
||||
|
||||
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/MastodontConfig.cmake DESTINATION lib/cmake)
|
||||
|
||||
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/MastodontConfig.cmake DESTINATION lib/cmake/mastodont)
|
||||
else()
|
||||
message("Since CJSON wasn't found or your distribution doesn't provide correct version, you can still use cmake/mastodont-config.cmake and check for it in your package. You _probably_ don't want this")
|
||||
endif()
|
||||
|
|
|
@ -4,19 +4,19 @@
|
|||
|
||||
#ifndef MASTODONT_H
|
||||
#define MASTODONT_H
|
||||
#include <mastodont_hooks.h>
|
||||
#include <mastodont_types.h>
|
||||
#include <mastodont_timeline.h>
|
||||
#include <mastodont_list.h>
|
||||
#include <mastodont_notification.h>
|
||||
#include <mastodont_status.h>
|
||||
#include <mastodont_relationship.h>
|
||||
#include <mastodont_account.h>
|
||||
#include <mastodont_attachment.h>
|
||||
#include <mastodont_scrobbles.h>
|
||||
#include <mastodont_search.h>
|
||||
#include <mastodont_announcement.h>
|
||||
#include <mastodont_chats.h>
|
||||
#include "mastodont_hooks.h"
|
||||
#include "mastodont_types.h"
|
||||
#include "mastodont_timeline.h"
|
||||
#include "mastodont_list.h"
|
||||
#include "mastodont_notification.h"
|
||||
#include "mastodont_status.h"
|
||||
#include "mastodont_relationship.h"
|
||||
#include "mastodont_account.h"
|
||||
#include "mastodont_attachment.h"
|
||||
#include "mastodont_scrobbles.h"
|
||||
#include "mastodont_search.h"
|
||||
#include "mastodont_announcement.h"
|
||||
#include "mastodont_chats.h"
|
||||
|
||||
/// Initializes libcurl
|
||||
void
|
||||
|
|
|
@ -4,8 +4,8 @@
|
|||
|
||||
#ifndef MASTODONT_ANNOUNCEMENT_H
|
||||
#define MASTODONT_ANNOUNCEMENT_H
|
||||
#include <mastodont_types.h>
|
||||
|
||||
#include "mastodont_types.h"
|
||||
|
||||
// TODO
|
||||
|
||||
#endif /* MASTODONT_ANNOUNCEMENT_H */
|
||||
|
|
|
@ -4,8 +4,8 @@
|
|||
|
||||
#ifndef MASTODONT_ERROR_H
|
||||
#define MASTODONT_ERROR_H
|
||||
#include <mastodont_types.h>
|
||||
#include <mastodont_fetch.h>
|
||||
#include "mastodont_types.h"
|
||||
#include "mastodont_fetch.h"
|
||||
|
||||
int mstdnt_check_error(struct mstdnt_storage* storage);
|
||||
|
||||
|
|
|
@ -5,8 +5,8 @@
|
|||
#ifndef MASTODONT_FETCH_H
|
||||
#define MASTODONT_FETCH_H
|
||||
#include <cjson/cJSON.h>
|
||||
#include <mastodont_types.h>
|
||||
#include <curl/curl.h>
|
||||
#include "mastodont_types.h"
|
||||
|
||||
/** Used to store the response from CURL */
|
||||
struct mstdnt_fetch_data
|
||||
|
|
|
@ -4,10 +4,10 @@
|
|||
|
||||
#ifndef MASTODONT_LIST_H
|
||||
#define MASTODONT_LIST_H
|
||||
#include <mastodont_types.h>
|
||||
#include "mastodont_types.h"
|
||||
#include <cjson/cJSON.h>
|
||||
#include <mastodont_fetch.h>
|
||||
#include <mastodont_account.h>
|
||||
#include "mastodont_fetch.h"
|
||||
#include "mastodont_account.h"
|
||||
|
||||
enum mstdnt_list_replies_policy
|
||||
{
|
||||
|
|
|
@ -4,8 +4,7 @@
|
|||
|
||||
#ifndef MASTODONT_NODEINFO_H
|
||||
#define MASTODONT_NODEINFO_H
|
||||
#include <mastodont_types.h>
|
||||
|
||||
#include "mastodont_types.h"
|
||||
|
||||
struct mstdnt_nodeinfo_metadata
|
||||
{
|
||||
|
|
|
@ -6,8 +6,8 @@
|
|||
// TODO Move me to statuses
|
||||
#ifndef MASTODONT_PLEROMA
|
||||
#define MASTODONT_PLEROMA
|
||||
#include <mastodont_types.h>
|
||||
#include <mastodont_emoji.h>
|
||||
#include "mastodont_types.h"
|
||||
#include "mastodont_emoji.h"
|
||||
|
||||
struct mstdnt_status_pleroma
|
||||
{
|
||||
|
|
|
@ -6,8 +6,8 @@
|
|||
#define MASTODONT_RELATIONSHIP_H
|
||||
#include <stdint.h>
|
||||
#include <cjson/cJSON.h>
|
||||
#include <mastodont_types.h>
|
||||
#include <mastodont_request.h>
|
||||
#include "mastodont_types.h"
|
||||
#include "mastodont_request.h"
|
||||
|
||||
typedef uint16_t mstdnt_relationship_flag_t;
|
||||
|
||||
|
|
|
@ -5,8 +5,8 @@
|
|||
#ifndef MASTODONT_SCROBBLES_H
|
||||
#define MASTODONT_SCROBBLES_H
|
||||
#include <stddef.h>
|
||||
#include <mastodont_types.h>
|
||||
#include <mastodont_account.h>
|
||||
#include "mastodont_types.h"
|
||||
#include "mastodont_account.h"
|
||||
|
||||
typedef struct mstdnt_scrobble
|
||||
{
|
||||
|
|
|
@ -4,8 +4,8 @@
|
|||
|
||||
#ifndef MASTODONT_TIMELINE_H
|
||||
#define MASTODONT_TIMELINE_H
|
||||
#include <mastodont_types.h>
|
||||
#include <mastodont_status.h>
|
||||
#include "mastodont_types.h"
|
||||
#include "mastodont_status.h"
|
||||
|
||||
enum mstdnt_reply_visibility
|
||||
{
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
|
||||
#ifndef MASTODONT_URI_H
|
||||
#define MASTODONT_URI_H
|
||||
#include <mastodont_types.h>
|
||||
#include "mastodont_types.h"
|
||||
#include <stddef.h>
|
||||
|
||||
struct mstdnt_uri
|
||||
|
|
Loading…
Reference in a new issue