Skip to content

Commit 685699f

Browse files
Merge branch 'QuietMisdreavus/cmake-targets' into QuietMisdreavus/swift-build
2 parents c816eae + f2139c2 commit 685699f

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

src/CMakeLists.txt

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -158,6 +158,19 @@ if(CMARK_SHARED OR CMARK_STATIC)
158158
)
159159

160160
install(EXPORT cmark-gfm DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake)
161+
162+
set(CMARK_TARGETS_FILE ${CMAKE_CURRENT_BINARY_DIR}/cmarkTargets.cmake)
163+
export(TARGETS ${CMARK_INSTALL} FILE ${CMARK_TARGETS_FILE})
164+
165+
if(CMARK_THREADING AND NOT APPLE AND NOT MSVC)
166+
if(CMARK_SHARED)
167+
target_link_libraries(${LIBRARY} pthread)
168+
endif(CMARK_SHARED)
169+
170+
if(CMARK_STATIC)
171+
target_link_libraries(${STATICLIBRARY} pthread)
172+
endif(CMARK_STATIC)
173+
endif()
161174
endif()
162175

163176
# Feature tests

0 commit comments

Comments
 (0)