summaryrefslogtreecommitdiff
path: root/src/CMakeLists.txt
diff options
context:
space:
mode:
authorJohn MacFarlane <jgm@berkeley.edu>2014-10-25 19:00:26 -0700
committerJohn MacFarlane <jgm@berkeley.edu>2014-10-25 19:07:57 -0700
commit75e924d81e0001c5e298cd89c99ff87d7cf6c8fb (patch)
tree2a01daf84658c6e2c4e04d25926b155e5d028f72 /src/CMakeLists.txt
parent16794168a936feb7f25b3fdbdddf6c24b14a779a (diff)
parent7da937e2aea109e42b5ce9d6c9fe2e4e9ec877fc (diff)
Merge branch 'cmake-build' of https://github.com/gittiver/stmd into gittiver-cmake-build
Conflicts: .gitignore
Diffstat (limited to 'src/CMakeLists.txt')
-rw-r--r--src/CMakeLists.txt50
1 files changed, 50 insertions, 0 deletions
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
new file mode 100644
index 0000000..100bf28
--- /dev/null
+++ b/src/CMakeLists.txt
@@ -0,0 +1,50 @@
+set(PROGRAM_cmark "cmark")
+set(PROGRAM_cmark_SOURCES blocks.c
+ inlines.c
+ main.c
+ debug.h
+ getopt.c
+ print.c
+ scanners.h
+ scanners.c
+ scanners.re
+ cmark.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_cmark}
+ ${PROGRAM_cmark_SOURCES})
+
+if (MSVC)
+set_property(TARGET ${PROGRAM_cmark}
+ APPEND PROPERTY LINK_FLAGS /INCREMENTAL:NO)
+# if sometimes libs are needed ...
+#target_link_libraries(${PROGRAM_chronolog})
+endif(MSVC)
+install(TARGETS ${PROGRAM_cmark}
+RUNTIME DESTINATION bin
+BUNDLE DESTINATION /Applications)
+
+