summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGulliver <gulliver@fargonauten.de>2014-09-10 17:24:27 +0200
committerGulliver <gulliver@fargonauten.de>2014-09-10 17:24:27 +0200
commit0a40eea051e5b61c954f32025df21a475b0ee111 (patch)
treea3207fbe7c62a6bd0b5659bd6a9d5109b53b1e64 /src
parent358925ec028bcdb312616ffebf427eda595896cd (diff)
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)
Diffstat (limited to 'src')
-rw-r--r--src/CMakeLists.txt55
1 files changed, 33 insertions, 22 deletions
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)