summaryrefslogtreecommitdiff
path: root/src/CMakeLists.txt
blob: 203e5bf9dc27c535a0069a0dd71ea5c640c108c7 (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
48
49
50
set(PROGRAM_stmd "stmd")
set(PROGRAM_stmd_SOURCES    blocks.c
                            inlines.c
                            main.c
                            debug.h
                            getopt.c
                            print.c
                            scanners.h
                            scanners.c
                            scanners.re
                            stmd.h
                            utf8.h utf8.c
                            buffer.h buffer.c
							references.h references.c
							html/html.c
							html/html_unescape.h
							html/html_unescape.gperf
							html/houdini.h
							html/houdini_href_e.c
							html/houdini_html_e.c
							html/houdini_html_u.c
)

include_directories(. html)

if (MSVC)
    file(TO_NATIVE_PATH ${CMAKE_CURRENT_SOURCE_DIR} DOS_CURRENT_SOURCE_DIR)
    add_custom_command( OUTPUT ${CMAKE_CURRENT_SOURCE_DIR}/scanners.c
                        DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/scanners.re
                        COMMAND ${RE2C} --case-insensitive -b -i ${DOS_CURRENT_SOURCE_DIR}\\scanners.re >${DOS_CURRENT_SOURCE_DIR}\\scanners.c)
else(MSVC)
    add_custom_command( OUTPUT ${CMAKE_CURRENT_SOURCE_DIR}/scanners.c
                        DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/scanners.re
                        COMMAND ${RE2C} --case-insensitive -b -i ${CMAKE_CURRENT_SOURCE_DIR}/scanners.re >${CMAKE_CURRENT_SOURCE_DIR}/scanners.c)
endif(MSVC)

add_executable(${PROGRAM_stmd} 
                ${PROGRAM_stmd_SOURCES})

if (MSVC)
set_property(TARGET ${PROGRAM_stmd} 
                     APPEND PROPERTY LINK_FLAGS /INCREMENTAL:NO) 
# if sometimes libs are needed ...
#target_link_libraries(${PROGRAM_chronolog})
endif(MSVC)
install(TARGETS ${PROGRAM_stmd}
RUNTIME DESTINATION bin 
BUNDLE DESTINATION /Applications)