From 37ec828fa2f61524e3c6ae138cdb36b7ced976c1 Mon Sep 17 00:00:00 2001 From: nekobit Date: Tue, 6 Dec 2022 13:04:44 +0000 Subject: [PATCH] Link and include Mastodont FossilOrigin-Name: 2f4c7035c43f8722e279ee9d605e3b8dfb22afe70c4e66c13e98b5892e8a0b0d --- CMakeLists.txt | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 8d6fcaa..03754e0 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -10,11 +10,17 @@ project(treebird DESCRIPTION "A very lightweight and beautiful Pleroma frontend" LANGUAGES C) -# Import local build -if(EXISTS "mastodont-c/") - include(mastodont-c/mastodont-config.cmake) +# Import local build if it exists. +# This is a current solution unless distributions provide their own packages +if(EXISTS "${CMAKE_CURRENT_LIST_DIR}/mastodont-c") + include(mastodont-c/cmake/mastodont-config.cmake) +else() + # + find_package(MASTODONT REQUIRED) endif() + + add_executable(treebird ${SRC_FILES}) # Useful @@ -98,12 +104,16 @@ append_and_def(SRC_FILES target_sources(treebird PUBLIC ${SRC_FILES}) +message(${MASTODONT_INCLUDE_DIRS}) + target_include_directories(treebird PUBLIC ${PERL_INCLUDE_PATH} + ${MASTODONT_INCLUDE_DIRS} ${CURL_INCLUDE_DIRS}) # Build! Note the mastodont hack, this _should_ change soon. target_link_libraries(treebird PUBLIC ${PERL_LIBRARY} ${CURL_LIBRARIES} + ${MASTODONT_LIBRARIES} mastodont-c/libmastodont.a)