summaryrefslogtreecommitdiffstats
path: root/libmscgen/CMakeLists.txt
blob: 0a23900896e294e4be8193dc8fe9cac56e74317c (plain)
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
include_directories(
    ${PROJECT_SOURCE_DIR}/liblodepng
    ${PROJECT_SOURCE_DIR}/libmscgen
    ${GENERATED_SRC}
)

set(LEX_FILES mscgen_lexer) 
foreach(lex_file ${LEX_FILES})
    add_custom_command(
        COMMAND ${PYTHON_EXECUTABLE} ${PROJECT_SOURCE_DIR}/src/scan_states.py ${PROJECT_SOURCE_DIR}/libmscgen/${lex_file}.l > ${GENERATED_SRC}/${lex_file}.l.h
        DEPENDS ${PROJECT_SOURCE_DIR}/src/scan_states.py ${PROJECT_SOURCE_DIR}/libmscgen/${lex_file}.l
        OUTPUT  ${GENERATED_SRC}/${lex_file}.l.h
    )
    set_source_files_properties(${GENERATED_SRC}/${lex_file}.l.h PROPERTIES GENERATED 1)

    FLEX_TARGET(${lex_file}        ${lex_file}.l        ${GENERATED_SRC}/${lex_file}.cpp        COMPILE_FLAGS "${LEX_FLAGS}")
endforeach()

add_library(mscgen
gd.c
gd_security.c
gdfontt.c
gdtables.c
gd_color.c
gdfonts.c
gdhelpers.c
gd_lodepng.c
mscgen_adraw.c
mscgen_gd_out.c
mscgen_ps_out.c
mscgen_null_out.c
${GENERATED_SRC}/mscgen_language.cpp
${GENERATED_SRC}/mscgen_lexer.cpp
${GENERATED_SRC}/mscgen_lexer.l.h
mscgen_api.c
mscgen_msc.c
mscgen_safe.c
mscgen_svg_out.c
mscgen_usage.c
mscgen_utf8.c
)


BISON_TARGET(mscgen_language
             mscgen_language.y
             ${GENERATED_SRC}/mscgen_language.cpp
             COMPILE_FLAGS "${YACC_FLAGS}")