forked from ooxi/xml.c
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
50 lines (35 loc) · 970 Bytes
/
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
# Project setup
PROJECT(xml)
SET(VERSION_MAJOR "0")
SET(VERSION_MINOR "1")
SET(VERSION_PATCH "4")
CMAKE_MINIMUM_REQUIRED(VERSION 2.6.0 FATAL_ERROR)
# Compiler setup
SET(CMAKE_C_FLAGS_DEBUG "-g -DDEBUG")
SET(CMAKE_C_FLAGS_RELEASE "-O2")
# Options
OPTION(XML_PARSER_VERBOSE "Enable to be told everything the xml parser does" OFF)
IF(XML_PARSER_VERBOSE)
ADD_DEFINITIONS(-DXML_PARSER_VERBOSE)
ENDIF(XML_PARSER_VERBOSE)
# Sources
SET(SOURCE_DIRECTORY src)
SET(TEST_SOURCE_DIRECTORY test)
# Build library
ADD_LIBRARY(xml STATIC
${SOURCE_DIRECTORY}/xml.c
)
# Build unit cases
INCLUDE_DIRECTORIES(${SOURCE_DIRECTORY})
ADD_EXECUTABLE(test-xml
${TEST_SOURCE_DIRECTORY}/test-xml
)
TARGET_LINK_LIBRARIES(test-xml xml)
FILE( COPY ${TEST_SOURCE_DIRECTORY}/test.xml
DESTINATION ${PROJECT_BINARY_DIR}
)
# Building example
ADD_EXECUTABLE(example
${TEST_SOURCE_DIRECTORY}/example
)
TARGET_LINK_LIBRARIES(example xml)