File: CMakeLists.txt

package info (click to toggle)
litehtml 0.5-3
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, bullseye, sid
  • size: 2,288 kB
  • sloc: ansic: 30,263; cpp: 15,397; makefile: 8
file content (145 lines) | stat: -rw-r--r-- 3,893 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
cmake_minimum_required(VERSION 2.8)

project(litehtml CXX)

include(GNUInstallDirs)

set(SOURCE_LITEHTML
    src/background.cpp
    src/box.cpp
    src/context.cpp
    src/css_length.cpp
    src/css_selector.cpp
    src/document.cpp
    src/el_anchor.cpp
    src/el_base.cpp
    src/el_before_after.cpp
    src/el_body.cpp
    src/el_break.cpp
    src/el_cdata.cpp
    src/el_comment.cpp
    src/el_div.cpp
    src/element.cpp
    src/el_font.cpp
    src/el_image.cpp
    src/el_link.cpp
    src/el_para.cpp
    src/el_script.cpp
    src/el_space.cpp
    src/el_style.cpp
    src/el_table.cpp
    src/el_td.cpp
    src/el_text.cpp
    src/el_title.cpp
    src/el_tr.cpp
    src/html.cpp
    src/html_tag.cpp
    src/iterators.cpp
    src/media_query.cpp
    src/style.cpp
    src/stylesheet.cpp
    src/table.cpp
    src/utf8_strings.cpp
    src/web_color.cpp
)

set(HEADER_LITEHTML
    include/litehtml.h
    src/attributes.h
    src/background.h
    src/borders.h
    src/box.h
    src/context.h
    src/css_length.h
    src/css_margins.h
    src/css_offsets.h
    src/css_position.h
    src/css_selector.h
    src/document.h
    src/el_anchor.h
    src/el_base.h
    src/el_before_after.h
    src/el_body.h
    src/el_break.h
    src/el_cdata.h
    src/el_comment.h
    src/el_div.h
    src/el_font.h
    src/el_image.h
    src/el_link.h
    src/el_para.h
    src/el_script.h
    src/el_space.h
    src/el_style.h
    src/el_table.h
    src/el_td.h
    src/el_text.h
    src/el_title.h
    src/el_tr.h
    src/element.h
    src/html.h
    src/html_tag.h
    src/iterators.h
    src/media_query.h
    src/os_types.h
    src/style.h
    src/stylesheet.h
    src/table.h
    src/types.h
    src/utf8_strings.h
    src/web_color.h
)

add_library(${PROJECT_NAME}-static ${SOURCE_LITEHTML})

set_target_properties(${PROJECT_NAME}-static PROPERTIES
    CXX_STANDARD 11
    C_STANDARD 99
    PUBLIC_HEADER "${HEADER_LITEHTML}"
    OUTPUT_NAME ${PROJECT_NAME}
    POSITION_INDEPENDENT_CODE 1
)

add_library(${PROJECT_NAME} SHARED $<TARGET_OBJECTS:${PROJECT_NAME}-static>)

set_target_properties(${PROJECT_NAME} PROPERTIES
    VERSION "${LITEHTML_VERSION}"
    SOVERSION 0)

# Export litehtml includes.
target_include_directories(${PROJECT_NAME}-static PUBLIC
    $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/src>
    $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
    $<INSTALL_INTERFACE:include/${PROJECT_NAME}>)
target_include_directories(${PROJECT_NAME}-static PRIVATE include/${PROJECT_NAME})

option(LITEHTML_UTF8 "Build litehtml with UTF-8 text conversion functions." OFF)
if (LITEHTML_UTF8)
  target_compile_definitions(${PROJECT_NAME}-static PUBLIC LITEHTML_UTF8)
endif()

# Gumbo
target_link_libraries(${PROJECT_NAME} PUBLIC gumbo)

# install and export
install(TARGETS ${PROJECT_NAME} ${PROJECT_NAME}-static
    EXPORT litehtmlTargets
    ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
    DESTINATION ${CMAKE_INSTALL_LIBDIR}
    PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/litehtml
)
install(EXPORT litehtmlTargets FILE litehtmlTargets.cmake DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/litehtml)

# Binary Master.css
if (WIN32)
    find_program(XXD_COMMAND xxd.exe ${CMAKE_CURRENT_SOURCE_DIR}/tool)
    file(TO_NATIVE_PATH ${XXD_COMMAND} XXD_COMMAND)
    file(TO_NATIVE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/include/master.css MASTER_FILE)
    add_custom_command(OUTPUT ${CMAKE_CURRENT_SOURCE_DIR}/src/master.css.inc
        COMMAND type ${MASTER_FILE} | "${XXD_COMMAND}" -i > ${CMAKE_CURRENT_SOURCE_DIR}/src/master.css.inc)
else()
    find_program(XXD_COMMAND xxd)
    add_custom_command(OUTPUT ${CMAKE_CURRENT_SOURCE_DIR}/src/master.css.inc
        COMMAND cat ${CMAKE_CURRENT_SOURCE_DIR}/include/master.css | xxd -i > ${CMAKE_CURRENT_SOURCE_DIR}/src/master.css.inc)
endif()
set_source_files_properties(${CMAKE_CURRENT_SOURCE_DIR}/src/master.css.inc PROPERTIES GENERATED TRUE)