clay/CMakeLists.txt
Gwendolyn d706fb8904 added clay-xml with xmllib2 that reads in an xml file
with test.xml as input it produces the same output as clay-demo (except for different order of properties in the debug print)
2023-02-08 01:15:56 +01:00

50 lines
1.2 KiB
CMake

cmake_minimum_required(VERSION 3.24)
project(clay C)
set(CMAKE_C_STANDARD 17)
include(FetchContent)
FetchContent_Declare(
cairo
GIT_REPOSITORY https://gitlab.freedesktop.org/cairo/cairo.git
GIT_TAG c3b672634f0635af1ad0ffa8c15b34fc7c1035cf # 1.17.8
)
FetchContent_Declare(
libxml2
GIT_REPOSITORY https://gitlab.gnome.org/GNOME/libxml2.git
GIT_TAG f507d167f1755b7eaea09fb1a44d29aab828b6d1
)
#FetchContent_MakeAvailable(cairo)
add_library(clay
src/clay/color.c
src/clay/context.c
src/clay/debug.c
src/clay/document.c
src/clay/flex.c
src/clay/layout.c
src/clay/property.c
src/clay/render.c
src/clay/text.c
)
target_include_directories(clay PUBLIC include)
target_link_libraries(clay PRIVATE cairo)
target_compile_options(clay PRIVATE -Wall -Werror)
if (PROJECT_IS_TOP_LEVEL)
add_executable(clay-demo src/clay-demo/demo.c)
target_link_libraries(clay-demo PRIVATE clay)
FetchContent_MakeAvailable(libxml2)
add_executable(clay-xml src/clay-xml/main.c)
target_link_libraries(clay-xml PRIVATE clay)
target_link_libraries(clay-xml PRIVATE LibXml2)
endif ()