diff options
-rw-r--r-- | CMakeLists.txt | 1 | ||||
-rw-r--r-- | src/CMakeLists.txt | 55 |
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)
|