Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I am using ImPlot in a project of mine. My project uses CMake, and having CMake support in dependencies that I obtain from repositories makes it easier for me to use them in my project. As such, I have added a
CMakeLists.txt
to my fork of ImPlot so that I can integrate it more easily to my project. I am writing this PR in the hopes that my modifications might be helpful to other developers.Developers can integrate ImPlot to their CMake project by adding the following lines in a
CMakeLists.txt
file:And then link ImPlot to their executable by doing
target_link_libraries(<target executable> implot <other libraries>)
if they want to link the static version of ImPlot, or
target_link_libraries(<target executable> implot_shared <other libraries>)
if they want to the shared version.
I have added three options in the
CMakeLists.txt
file that can be toggled on or off by setting their values to eitherON
orOFF
, respectively:BUILD_IMPLOT_SHARED
- builds a shared library version of ImPlot; turned on by defaultBUILD_IMPLOT_STATIC
- builds a static library version of ImPlot; turned on by defaultBUILD_IMPLOT_DEMO
- includes the demo in the library; turned off by defaultI've also updated the README to include the documentation for CMake integration.