Skip to content

cmake does not install required files #381

@kazzmir

Description

@kazzmir

The cmake build system does not install all required header files, nor does it install the static library. Here is a patch which installs the needed files. The apple/swift project in particular includes cmark.h and node.h. cmark.h requires that cmark_export.h be available. node.h requires buffer.h, chunk.h, config.h, and cmark_ctype.h be available. Finally, swift links in libcmark.a directly. It should probably use pkgconfig and libcmark.pc to discover the proper link flags, but that is a separate issue.

diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index b40c1ac..30474f4 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -114,13 +114,19 @@ endif(MSVC)

set(CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_NO_WARNINGS ON)
include (InstallRequiredSystemLibraries)
-install(TARGETS ${PROGRAM} ${LIBRARY}
+install(TARGETS ${PROGRAM} ${LIBRARY} ${STATICLIBRARY}
   RUNTIME DESTINATION bin
   LIBRARY DESTINATION lib
+  ARCHIVE DESTINATION lib
   )

 install(FILES
   cmark.h
+  node.h
+  buffer.h
+  chunk.h
+  cmark_ctype.h
+  ${CMAKE_CURRENT_BINARY_DIR}/config.h
   ${CMAKE_CURRENT_BINARY_DIR}/cmark_export.h
   ${CMAKE_CURRENT_BINARY_DIR}/cmark_version.h
   DESTINATION include

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions