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.
OptimLib doesn't provide any automated method for users to download and link against it, and in my opinion, doesn't integrate well into modern build systems. For example, my preferred method for including dependencies is using
FetchContent
with CMake to download and link against the dependencies without having to install it to the system, but this is not cleanly possible with OptimLib. Therefore, this PR adds a smallCMakeLists.txt
to this project, making it very easy to include in other CMake projects without having to build and install manually from source.With this PR, building the Ackley example with CMake is as easy as:
Note that this example pulls from my fork, but if this PR is merged it should pull from the original repo and the
main
branch.I'm not sure that I recreated all the compile-time flags properly, as the configure script was rather long, but I can confirm that this example does build and run correctly. If any flags aren't set properly, I'd welcome any modifications/fixes!