From 0a40eea051e5b61c954f32025df21a475b0ee111 Mon Sep 17 00:00:00 2001 From: Gulliver Date: Wed, 10 Sep 2014 17:24:27 +0200 Subject: added scanner.c to sources and special rule for it to build it from scanner.re (added setting RE2C which contains the path to needed re2c utilitity) --- src/CMakeLists.txt | 55 ++++++++++++++++++++++++++++++++---------------------- 1 file changed, 33 insertions(+), 22 deletions(-) (limited to 'src') diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index c454eca..35de787 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -1,33 +1,44 @@ set(PROGRAM_stmd "stmd") -set(PROGRAM_stmd_SOURCES blocks.c -inlines.c -main.c -debug.h -detab.c -bstrlib.c -bstrlib.h -getopt.c -html.c - - -print.c -scanners.h -scanners.re -stmd.h -utf8.c -utf8.h -uthash.h +set(PROGRAM_stmd_SOURCES blocks.c + inlines.c + main.c + debug.h + detab.c + bstrlib.c + bstrlib.h + getopt.c + html.c + print.c + scanners.h + scanners.c + scanners.re + stmd.h + utf8.c + utf8.h + uthash.h ) +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_chronolog} - APPEND PROPERTY LINK_FLAGS /INCREMENTAL:NO) -target_link_libraries(${PROGRAM_chronolog} gdiplus.lib) +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_chronolog} +install(TARGETS PROGRAM_stmd RUNTIME DESTINATION bin BUNDLE DESTINATION Applications) -- cgit v1.2.3