Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cmake does not install required files #381

Closed
kazzmir opened this issue Dec 4, 2015 · 6 comments
Closed

cmake does not install required files #381

kazzmir opened this issue Dec 4, 2015 · 6 comments

Comments

@kazzmir
Copy link

kazzmir commented Dec 4, 2015

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
@kazzmir
Copy link
Author

kazzmir commented Dec 4, 2015

Perhaps this issue would be better targeted to the jgm/cmark project. Sorry if it was made for the wrong project.

@jgm
Copy link
Member

jgm commented Dec 4, 2015

It's exciting to learn that apple/swift is using cmark, but please advise them that node.h isn't part of the public API, so it is intentionally not installed. Users of the library should use the interface exposed in cmark.h to manipulate nodes, rather than using the node data structures directly. (We reserve the right to change the underlying data structures in minor updates which keep the public API stable...not that we're even at 1.0 yet!) The interface exposed in cmark.h should be sufficient to do anything you need to do with nodes. If it isn't, please let us know why.

@nwellnhof - is there a reason the static library isn't installed?

@nwellnhof
Copy link
Contributor

On 04/12/2015 06:58, John MacFarlane wrote:

@nwellnhof - is there a reason the static
library isn't installed?

No, I don't see a reason not to install the static library by default.

@jgm
Copy link
Member

jgm commented Dec 4, 2015

OK, I've changed the install target as suggested,
but left the headers as they are.

@nwellnhof
Copy link
Contributor

I created a pull request to fix the node.h issue in Swift: swiftlang/swift#209

@kazzmir
Copy link
Author

kazzmir commented Dec 4, 2015

Thank you. I was spinning my wheels trying to figure out what change needed to be made to the Swift code to use the cmark API properly.

talum pushed a commit to github/cmark-gfm that referenced this issue Sep 14, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants