chore: add cmake find_package test
Some checks failed
run-checks / run-clang-format (push) Has been cancelled
run-tests / test-on-ubuntu (push) Has been cancelled
run-tests / test-on-windows (push) Has been cancelled
run-tests / test-on-osx (push) Has been cancelled

This commit is contained in:
Petra Baranski
2025-07-12 15:32:37 +02:00
parent 28e9a22f9c
commit de67274233
4 changed files with 54 additions and 7 deletions

View File

@@ -0,0 +1,8 @@
# This project is licensed under the MIT license. For more information see the
# LICENSE file.
cmake_minimum_required(VERSION 3.25)
find_package(maddy REQUIRED)
add_executable(maddy_find_package_example main.cpp)
target_link_libraries(maddy_find_package_example PRIVATE maddy::maddy)

View File

@@ -0,0 +1,25 @@
/*
* This project is licensed under the MIT license. For more information see the
* LICENSE file.
*
* This file is a tiny example project to test if find_package works correctly.
*/
#include <iostream>
#include <memory>
#include <sstream>
#include <string>
#include "maddy/parser.h"
int main(int argc, char** argv)
{
std::shared_ptr<maddy::Parser> parser = std::make_shared<maddy::Parser>();
std::stringstream markdownStream;
markdownStream << "# Hello World\n"
<< "This is a **bold** text and this is *italic* text.\n";
std::cout << parser->Parse(markdownStream) << std::endl;
return 0;
}