From 384724a00be9dbb8f40d295f99b9c6bcfb48b387 Mon Sep 17 00:00:00 2001 From: lns Date: Wed, 20 Oct 2021 19:58:38 +0200 Subject: Added MD4C support to render HTML from Markdown text. * additional blog metadata properties Signed-off-by: lns --- CMakeLists.txt | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) (limited to 'CMakeLists.txt') diff --git a/CMakeLists.txt b/CMakeLists.txt index b107660..1de9b72 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -6,14 +6,27 @@ set(CMAKE_CXX_FLAGS_DEBUG "-g3 -fpic -fno-omit-frame-pointer -fno-rtti -ffunctio set(CMAKE_CXX_FLAGS_RELEASE "-Os -fpic -fomit-frame-pointer -ffunction-sections -fdata-sections -flto") set(CMAKE_EXE_LINKER_FLAGS "-Wl,-gc-sections") -set(INJA_SRCDIR "${PROJECT_SOURCE_DIR}/deps/inja" CACHE STRING "Path to the inja source directory.") +set(INJA_SRCDIR "${PROJECT_SOURCE_DIR}/deps/inja" CACHE STRING + "Path to the inja source directory.") if(NOT EXISTS "${INJA_SRCDIR}/single_include/inja/inja.hpp") message(FATAL_ERROR "inja missing") endif() -include_directories(${CPP_HTTPLIB_SRCDIR} ${INJA_SRCDIR}/single_include ${INJA_SRCDIR}/third_party/include) +set(MD4C_SRCDIR "${PROJECT_SOURCE_DIR}/deps/md4c/src" CACHE STRING + "Path to the md4c source directory.") +if(NOT EXISTS "${MD4C_SRCDIR}/md4c-html.h") + message(FATAL_ERROR "md4c missing") +endif() + +include_directories(${CPP_HTTPLIB_SRCDIR} ${INJA_SRCDIR}/single_include + ${INJA_SRCDIR}/third_party/include + ${MD4C_SRCDIR}) +set(MD4C_SOURCES "${MD4C_SRCDIR}/entity.c" + "${MD4C_SRCDIR}/md4c.c" + "${MD4C_SRCDIR}/md4c-html.c") + file(GLOB_RECURSE SOURCES "src/*.cpp") -add_executable(cpp-web ${SOURCES}) +add_executable(cpp-web ${MD4C_SOURCES} ${SOURCES}) #target_compile_definitions(cpp-web PUBLIC CPPHTTPLIB_THREAD_POOL_COUNT=4) #target_compile_options(cpp-web PUBLIC "-std=c++14") if(CMAKE_BUILD_TYPE MATCHES Release) -- cgit v1.2.3