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

build: use absolute path for cmarkTargets.cmake #327

Merged
merged 1 commit into from
Jan 23, 2020

Conversation

compnerd
Copy link
Contributor

Adjust the include of the CMake file to use a cmarkConfig.cmake relative
location which enables use without considerations for the path.

@compnerd
Copy link
Contributor Author

CC: @nwellnhof

Adjust the include of the CMake file to use a cmarkConfig.cmake relative
location which enables use without considerations for the path.
@compnerd
Copy link
Contributor Author

@nwellnhof - do you think it is better to just substitute in the absolute path instead from CMake?

@nwellnhof
Copy link
Contributor

I have no idea.

@compnerd
Copy link
Contributor Author

@jgm what do you think of merging this as is; once it is merged, I can update the version being used in Swift and we can revisit that if it is an issue.

@jgm
Copy link
Member

jgm commented Jan 23, 2020

I really don't understand the implications of this change. (Sorry, cmake is a mystery to me.) Can you explain a bit more fully?

@compnerd
Copy link
Contributor Author

compnerd commented Jan 23, 2020

Oh, sure. The change is related to CMake's concepts of export targets - it allows for you to specify a set of targets which can then be used by another project. One way of using them is without installation of the library to the system. This allows you to build a static version of a library (e.g. cmark) and then directly link that into your program with proper dependency tracking across the projects. This mechanism works through a file that is emitted which is cmarkConfig.cmake (generated from cmarkConfig.cmake.in). This file references the cmarkTargets.cmake which is emitted by CMake as well. However, it was being included by a relative path and so unless you were in the correct location, it would fail to find the file. This now uses the absolute path which makes it resilient to the location from where things are being executed.

@jgm jgm merged commit 14622a1 into commonmark:master Jan 23, 2020
@jgm
Copy link
Member

jgm commented Jan 23, 2020

OK, sounds like a good idea then.

@compnerd compnerd deleted the path branch January 23, 2020 17:03
@drodriguez
Copy link

I think this change would have needed to modify the CMakeLists.txt invocation of configure_file to use the @ONLY parameter, because the CMAKE_CURRENT_LIST_DIR is being replaced during the configure_file, not during the include (according to the console logs of apple/swift#29438).

QuietMisdreavus pushed a commit to apple/swift-cmark that referenced this pull request Apr 6, 2023
…ut-formats

Add other output formats to the quadratic fuzzer
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

Successfully merging this pull request may close these issues.

None yet

5 participants