diff options
author | John MacFarlane <jgm@berkeley.edu> | 2014-11-06 23:23:50 -0800 |
---|---|---|
committer | John MacFarlane <jgm@berkeley.edu> | 2014-11-06 23:23:50 -0800 |
commit | bc978561c1616985df6a73657db5015822c4b33b (patch) | |
tree | d6b1289ea135a2a124b39802991297dfb3546bcb | |
parent | 187149ec3efa72c8ea931e15690943698214d748 (diff) |
More cmake improvements.
-rw-r--r-- | Makefile | 15 | ||||
-rw-r--r-- | src/CMakeLists.txt | 43 |
2 files changed, 34 insertions, 24 deletions
@@ -75,10 +75,11 @@ benchjs: # #$(SRCDIR)/scanners.c: $(SRCDIR)/scanners.re # re2c --case-insensitive -bis $< > $@ || (rm $@ && false) -# -#$(SRCDIR)/case_fold_switch.inc: $(DATADIR)/CaseFolding-3.2.0.txt -# perl mkcasefold.pl < $< > $@ -# + + +$(SRCDIR)/case_fold_switch.inc: $(DATADIR)/CaseFolding-3.2.0.txt + perl mkcasefold.pl < $< > $@ + #$(SRCDIR)/html/html_unescape.h: $(SRCDIR)/html/html_unescape.gperf # gperf -I -t -N find_entity -H hash_entity -K entity -C -l # --null-strings -m5 $< > $@ @@ -92,6 +93,12 @@ benchjs: # install $(cmark_HDR) $(PREFIX)/include/cmark/ # install $(HTML_HDR) $(PREFIX)/include/cmark/html/ +#CMARK_HDR = $(SRCDIR)/cmark.h $(SRCDIR)/buffer.h $(SRCDIR)/references.h \ +# $(SRCDIR)/chunk.h $(SRCDIR)/debug.h $(SRCDIR)/utf8.h \ +# $(SRCDIR)/scanners.h $(SRCDIR)/inlines.h +# +#HTML_HDR = $(SRCDIR)/html/html_unescape.h $(SRCDIR)/html/houdini.h + dingus: js/commonmark.js echo "Starting dingus server at http://localhost:9000" && python -m SimpleHTTPServer 9000 diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 6ab59b5..f5fe29d 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -1,28 +1,32 @@ -set(LIBRARY_cmark "commonmark") -set(LIBRARY_cmark_SOURCES blocks.c - inlines.c +set(LIBRARY "commonmark") +set(HEADERS cmark.h + buffer.h + chunk.h + references.h debug.h - print.c + utf8.h scanners.h + inlines.h + html/html_unescape.h + html/houdini.h + ) +set(LIBRARY_SOURCES blocks.c + inlines.c + print.c 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 + ${HEADERS} ) -set(PROGRAM_cmark "cmark") -set(PROGRAM_cmark_SOURCES ${LIBRARY_cmark_SOURCES} +set(PROGRAM "cmark") +set(PROGRAM_SOURCES ${LIBRARY_SOURCES} main.c) include_directories(. html) @@ -38,21 +42,20 @@ else(MSVC) 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}) +add_executable(${PROGRAM} + ${PROGRAM_SOURCES}) -add_library(${LIBRARY_cmark} SHARED ${LIBRARY_cmark_SOURCES}) +add_library(${LIBRARY} SHARED ${LIBRARY_SOURCES}) -set_property(TARGET ${LIBRARY_cmark} +set_property(TARGET ${LIBRARY} APPEND PROPERTY MACOSX_RPATH true) if (MSVC) -set_property(TARGET ${PROGRAM_cmark} +set_property(TARGET ${PROGRAM} 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) -install(TARGETS ${LIBRARY_cmark} +install(TARGETS ${PROGRAM} ${LIBRARY} + RUNTIME DESTINATION bin LIBRARY DESTINATION lib) |