2017-09-03 07:35:59 +08:00
|
|
|
cmake_minimum_required(VERSION 3.8.0)
|
|
|
|
|
|
|
|
project(gumbo)
|
|
|
|
|
2023-02-24 03:25:44 +08:00
|
|
|
set(gumbo_public_headers
|
|
|
|
src/gumbo.h
|
|
|
|
src/tag_enum.h
|
|
|
|
)
|
|
|
|
|
2017-09-03 07:35:59 +08:00
|
|
|
set(gumbo_srcs
|
|
|
|
src/attribute.c
|
|
|
|
src/char_ref.c
|
|
|
|
src/error.c
|
|
|
|
src/parser.c
|
|
|
|
src/string_buffer.c
|
|
|
|
src/string_piece.c
|
|
|
|
src/tag.c
|
|
|
|
src/tokenizer.c
|
|
|
|
src/utf8.c
|
|
|
|
src/util.c
|
|
|
|
src/vector.c
|
|
|
|
)
|
|
|
|
|
2018-06-13 01:19:02 +08:00
|
|
|
include_directories(src)
|
|
|
|
if (MSVC)
|
|
|
|
include_directories(visualc/include)
|
|
|
|
endif (MSVC)
|
2017-09-03 07:35:59 +08:00
|
|
|
|
|
|
|
add_library(gumbo ${gumbo_srcs})
|
|
|
|
|
2023-02-24 03:25:44 +08:00
|
|
|
set_target_properties(gumbo PROPERTIES
|
|
|
|
C_STANDARD 99
|
|
|
|
PUBLIC_HEADER "${gumbo_public_headers}"
|
|
|
|
)
|
|
|
|
|
|
|
|
target_include_directories(gumbo PUBLIC
|
|
|
|
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/src>
|
|
|
|
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
|
|
|
|
$<INSTALL_INTERFACE:include/>)
|
|
|
|
|
2017-09-03 07:35:59 +08:00
|
|
|
install(
|
2022-04-20 00:39:39 +08:00
|
|
|
TARGETS gumbo EXPORT unofficial-gumbo-config
|
2017-09-03 07:35:59 +08:00
|
|
|
RUNTIME DESTINATION bin
|
|
|
|
LIBRARY DESTINATION lib
|
|
|
|
ARCHIVE DESTINATION lib
|
2023-02-24 03:25:44 +08:00
|
|
|
PUBLIC_HEADER DESTINATION include
|
2017-09-03 07:35:59 +08:00
|
|
|
)
|
2022-04-20 00:39:39 +08:00
|
|
|
|
|
|
|
install(EXPORT unofficial-gumbo-config
|
|
|
|
NAMESPACE unofficial::gumbo::
|
|
|
|
DESTINATION share/unofficial-gumbo
|
|
|
|
)
|
|
|
|
configure_file("${CMAKE_CURRENT_SOURCE_DIR}/gumbo.pc.in" "${CMAKE_CURRENT_BINARY_DIR}/lib/pkgconfig/gumbo.pc" @ONLY)
|
|
|
|
|
|
|
|
install(FILES "${CMAKE_CURRENT_BINARY_DIR}/lib/pkgconfig/gumbo.pc" DESTINATION "lib/pkgconfig")
|
2023-02-24 03:25:44 +08:00
|
|
|
|