summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJohn MacFarlane <jgm@berkeley.edu>2014-11-06 22:22:10 -0800
committerJohn MacFarlane <jgm@berkeley.edu>2014-11-06 22:22:10 -0800
commit48c64a6ce073fbc4e42761a32840ec1a7def4555 (patch)
treed282d1df2494bccd69de425a4275b386ef1e61f8 /src
parent59753048c91a12d82f7d62477e5aa96b8fd605c6 (diff)
cmake: Create and install shared library.
Diffstat (limited to 'src')
-rw-r--r--src/CMakeLists.txt18
1 files changed, 13 insertions, 5 deletions
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index aa6ec3d..6ab59b5 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -1,7 +1,6 @@
-set(PROGRAM_cmark "cmark")
-set(PROGRAM_cmark_SOURCES blocks.c
+set(LIBRARY_cmark "commonmark")
+set(LIBRARY_cmark_SOURCES blocks.c
inlines.c
- main.c
debug.h
print.c
scanners.h
@@ -22,6 +21,9 @@ set(PROGRAM_cmark_SOURCES blocks.c
html/houdini_html_e.c
html/houdini_html_u.c
)
+set(PROGRAM_cmark "cmark")
+set(PROGRAM_cmark_SOURCES ${LIBRARY_cmark_SOURCES}
+ main.c)
include_directories(. html)
@@ -39,6 +41,11 @@ endif(MSVC)
add_executable(${PROGRAM_cmark}
${PROGRAM_cmark_SOURCES})
+add_library(${LIBRARY_cmark} SHARED ${LIBRARY_cmark_SOURCES})
+
+set_property(TARGET ${LIBRARY_cmark}
+ APPEND PROPERTY MACOSX_RPATH true)
+
if (MSVC)
set_property(TARGET ${PROGRAM_cmark}
APPEND PROPERTY LINK_FLAGS /INCREMENTAL:NO)
@@ -46,5 +53,6 @@ set_property(TARGET ${PROGRAM_cmark}
#target_link_libraries(${PROGRAM_chronolog})
endif(MSVC)
install(TARGETS ${PROGRAM_cmark}
-RUNTIME DESTINATION bin
-BUNDLE DESTINATION /Applications)
+ RUNTIME DESTINATION bin)
+install(TARGETS ${LIBRARY_cmark}
+ LIBRARY DESTINATION lib)