forked from google/gumbo-parser
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
55 lines (44 loc) · 1.3 KB
/
CMakeLists.txt
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
cmake_minimum_required(VERSION 3.11)
project(gumbo)
set(CMAKE_CXX_STANDARD 17)
file(GLOB HEADERS_FILES
src/*.h
)
file(GLOB EXPORT_HEADERS_FILES
src/gumbo.h
src/tag_enum.h
)
if(MSVC)
list(APPEND EXPORT_HEADERS_FILES visualc/include/strings.h)
endif()
file(INSTALL ${EXPORT_HEADERS_FILES} DESTINATION ${CMAKE_BINARY_DIR}/include/gumbo)
file(GLOB SOURCES_FILES
src/*.c
)
add_library(gumbo STATIC
${HEADERS_FILES}
${SOURCES_FILES}
)
target_include_directories(gumbo
PUBLIC
$<BUILD_INTERFACE:${CMAKE_BINARY_DIR}/include>
$<INSTALL_INTERFACE:include>
# For support include different way. (gumbo/gumbo.h or gumbo.h)
$<BUILD_INTERFACE:${CMAKE_BINARY_DIR}/include/gumbo>
$<INSTALL_INTERFACE:include/gumbo>
)
install(FILES ${EXPORT_HEADERS_FILES}
DESTINATION ${CMAKE_INSTALL_PREFIX}/include/gumbo
)
install(
TARGETS gumbo
EXPORT "${TARGETS_EXPORT_NAME}"
LIBRARY DESTINATION "lib"
ARCHIVE DESTINATION "lib"
RUNTIME DESTINATION "bin"
INCLUDES DESTINATION "include/gumbo"
)
option(BUILD_GUMBO_TESTS "Builds gumbo tests" OFF)
if(BUILD_GUMBO_TESTS)
add_subdirectory(tests)
endif()