2023-02-02 22:15:44 +01:00
|
|
|
cmake_minimum_required(VERSION 3.24)
|
|
|
|
project(clay C)
|
|
|
|
|
|
|
|
set(CMAKE_C_STANDARD 17)
|
|
|
|
|
2023-02-08 00:19:58 +01:00
|
|
|
include(FetchContent)
|
2023-02-02 22:15:44 +01:00
|
|
|
|
2023-02-08 00:19:58 +01:00
|
|
|
FetchContent_Declare(
|
|
|
|
cairo
|
|
|
|
GIT_REPOSITORY https://gitlab.freedesktop.org/cairo/cairo.git
|
|
|
|
GIT_TAG c3b672634f0635af1ad0ffa8c15b34fc7c1035cf # 1.17.8
|
2023-02-02 22:15:44 +01:00
|
|
|
)
|
|
|
|
|
2023-02-08 01:15:56 +01:00
|
|
|
FetchContent_Declare(
|
|
|
|
libxml2
|
|
|
|
GIT_REPOSITORY https://gitlab.gnome.org/GNOME/libxml2.git
|
|
|
|
GIT_TAG f507d167f1755b7eaea09fb1a44d29aab828b6d1
|
|
|
|
)
|
|
|
|
|
2023-02-08 00:19:58 +01:00
|
|
|
#FetchContent_MakeAvailable(cairo)
|
|
|
|
|
2023-02-02 22:15:44 +01:00
|
|
|
|
2023-02-08 00:19:58 +01:00
|
|
|
add_library(clay
|
2023-02-08 01:15:41 +01:00
|
|
|
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
|
2023-02-08 00:19:58 +01:00
|
|
|
)
|
2023-02-02 22:15:44 +01:00
|
|
|
|
|
|
|
target_include_directories(clay PUBLIC include)
|
2023-02-08 00:19:58 +01:00
|
|
|
|
|
|
|
target_link_libraries(clay PRIVATE cairo)
|
|
|
|
|
2023-02-02 22:15:44 +01:00
|
|
|
target_compile_options(clay PRIVATE -Wall -Werror)
|
|
|
|
|
2023-02-08 00:19:58 +01:00
|
|
|
if (PROJECT_IS_TOP_LEVEL)
|
2023-02-08 01:15:41 +01:00
|
|
|
add_executable(clay-demo src/clay-demo/demo.c)
|
2023-02-02 22:15:44 +01:00
|
|
|
target_link_libraries(clay-demo PRIVATE clay)
|
2023-02-08 01:15:56 +01:00
|
|
|
|
|
|
|
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)
|
|
|
|
|
2023-02-08 00:19:58 +01:00
|
|
|
endif ()
|