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.
Hello SNAP devs,
Out of a need to build SNAP with CMakeLists.txt for a different project (directly related to #19), I have implemented CMake build infrastructure for SNAP. In using modern CMake, I tried as much as possible to make it the CMakeLists.txt file easy to understand for folks who are used to the
Make
build infrastructure. Credit to @banach-space for helping stir me into using modern CMake constructs.Here are some of the salient features of my CMake contribution:
gsnap
,isnap
, there is a single build target calledsnap
. The idea now would that developers would create a different build directory each time they wanted to try out a new compiler, e.g.,build_gnu
.An example build may take on the following form, as given in a bash script:
The build options specified by the original Makefile all exist in the CMakeLists.txt files. As shown above in the script, they should be passed in as CMake build options. Of note is the
CRAY
variable. In the original makefile, information for MPI include and library directories are only passed if MPI is set to "cray". I've honored that in my Makefile, but the way I've written it, developers should specify-DCRAY=ON
for now, in order to pass include and library directories for MPI.There is a custom target called
count
which is equivalent to the original Makefile targetcount
.I've tested with both Make and Ninja as generators.
I would appreciate if y'all would test my contribution to see if it's worth adding.
Thanks!
Anthony