If we import libsnark as submodule dependency in a project that has his own CMakeLists.txt file, we are not able to define make check or make doc since they are defined yet by libsnark.
More specifically we have these problems:
cmake .. does not compile because check, doc target collides with check, doc target defined into libsnark.
make test has view of all the test defined libsnark/CMakeLists.txt and will try to execute them.
For these reasons, adding IS_LIBSNARK_PARENT option facilitates the inclusion of libsnark as submodule dependency into a repository without requesting modifications. In the main repository will be enough to define OPTION(IS_LIBFF_PARENT OFF).
If we import libsnark as submodule dependency in a project that has his own
CMakeLists.txt
file, we are not able to definemake check
ormake doc
since they are defined yet by libsnark.More specifically we have these problems:
cmake ..
does not compile becausecheck
,doc
target collides withcheck
,doc
target defined into libsnark.make test
has view of all the test definedlibsnark/CMakeLists.txt
and will try to execute them.For these reasons, adding
IS_LIBSNARK_PARENT
option facilitates the inclusion of libsnark as submodule dependency into a repository without requesting modifications. In the main repository will be enough to defineOPTION(IS_LIBFF_PARENT OFF)
.This is the same approach used in libsnark dependencies https://github.com/scipr-lab/libsnark/blob/master/depends/CMakeLists.txt