Skip to content

Commit

Permalink
Build static version of library in default build.
Browse files Browse the repository at this point in the history
The static library will be named (lib)cmark_static.
Closes #11.
  • Loading branch information
jgm committed Mar 8, 2015
1 parent 9a9b176 commit fb68ad1
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
cmake_minimum_required(VERSION 2.8)
set(LIBRARY "libcmark")
set(STATICLIBRARY "libcmark_static")
set(HEADERS
cmark.h
parser.h
Expand Down Expand Up @@ -79,11 +80,15 @@ elseif(CMAKE_COMPILER_IS_GNUCC OR "${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
endif ()

add_library(${LIBRARY} SHARED ${LIBRARY_SOURCES})
add_library(${STATICLIBRARY} STATIC ${LIBRARY_SOURCES})
# Include minor version in soname as long as major version is 0.
set_target_properties(${LIBRARY} PROPERTIES
OUTPUT_NAME "cmark"
SOVERSION ${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}
VERSION ${PROJECT_VERSION})
set_target_properties(${STATICLIBRARY} PROPERTIES
OUTPUT_NAME "cmark_static"
VERSION ${PROJECT_VERSION})

set_property(TARGET ${LIBRARY}
APPEND PROPERTY MACOSX_RPATH true)
Expand Down

0 comments on commit fb68ad1

Please sign in to comment.