summaryrefslogtreecommitdiff
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
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)
-rw-r--r--CMakeLists.txt1
-rw-r--r--src/CMakeLists.txt55
2 files changed, 34 insertions, 22 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index ae057c2..905e17d 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -14,6 +14,7 @@ CHECK_INCLUDE_FILE (stdbool.h HAVE_STDBOOL_H)
#option(${PROJECT_NAME}_WITH_DOCS "generate Documentation" OFF)
#option(${PROJECT_NAME}_WITH_TESTS "enable testing" ON)
option(CMAKE_SUPPRESS_REGENERATION "suppress rules to re-run cmake on changes (warning: no dependency checks!)?" OFF)
+set(RE2C ${CMAKE_CURRENT_SOURCE_DIR}/re2c)
if (MSVC)
option(PROJECT_LINK_MSVC_MT "link with /MT instead of /MD (use msvc runtime dlls versus static linked)" ON)
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)