61 lines
1.6 KiB
CMake
61 lines
1.6 KiB
CMake
cmake_minimum_required(VERSION 2.6 FATAL_ERROR)
|
|
project(tidy C)
|
|
|
|
option(SUPPORT_UTF16_ENCODINGS "Support Unicode documents" ON)
|
|
option(SUPPORT_ACCESSIBILITY_CHECKS "Support W3C WAI checks" ON)
|
|
option(SUPPORT_ASIAN_ENCODINGS "Support Big5 and ShiftJIS docs" ON)
|
|
option(DMALLOC "Use dmalloc for memory debugging" OFF)
|
|
|
|
add_library(${PROJECT_NAME}
|
|
src/access.c
|
|
src/attrs.c
|
|
src/istack.c
|
|
src/parser.c
|
|
src/tags.c
|
|
src/entities.c
|
|
src/lexer.c
|
|
src/pprint.c
|
|
src/clean.c
|
|
src/localize.c
|
|
src/config.c
|
|
src/alloc.c
|
|
src/attrask.c
|
|
src/attrdict.c
|
|
src/attrget.c
|
|
src/buffio.c
|
|
src/fileio.c
|
|
src/streamio.c
|
|
src/tagask.c
|
|
src/tmbstr.c
|
|
src/utf8.c
|
|
src/tidylib.c
|
|
src/mappedio.c
|
|
)
|
|
|
|
include_directories(
|
|
${CMAKE_CURRENT_SOURCE_DIR}/src
|
|
${CMAKE_CURRENT_SOURCE_DIR}/include/tidy
|
|
)
|
|
|
|
set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -Wall -O0 -fno-omit-frame-pointer -g")
|
|
set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} -Wall -O3 -fomit-frame-pointer")
|
|
|
|
if (SUPPORT_UTF16_ENCODINGS)
|
|
add_definitions(-DSUPPORT_UTF16_ENCODINGS=1)
|
|
else(SUPPORT_UTF16_ENCODINGS)
|
|
add_definitions(-DSUPPORT_UTF16_ENCODINGS=0)
|
|
endif(SUPPORT_UTF16_ENCODINGS)
|
|
if (SUPPORT_ACCESSIBILITY_CHECKS)
|
|
add_definitions(-DSUPPORT_ACCESSIBILITY_CHECKS=1)
|
|
else(SUPPORT_ACCESSIBILITY_CHECKS)
|
|
add_definitions(-DSUPPORT_ACCESSIBILITY_CHECKS=0)
|
|
endif(SUPPORT_ACCESSIBILITY_CHECKS)
|
|
if (SUPPORT_ASIAN_ENCODINGS)
|
|
add_definitions(-DSUPPORT_ASIAN_ENCODINGS=1)
|
|
else(SUPPORT_ASIAN_ENCODINGS)
|
|
add_definitions(-DSUPPORT_ASIAN_ENCODINGS=0)
|
|
endif(SUPPORT_ASIAN_ENCODINGS)
|
|
if (DMALLOC)
|
|
add_definitions(-DDMALLOC)
|
|
target_link_libraries(${PROJECT_NAME} dmalloc)
|
|
endif(DMALLOC)
|