The subproject detection avoids adding things into the build that
are not necessary (i.e., standardese, unit tests) and/or may
cause conflicts (i.e., tests target name) when building as a
submodule in a parent project.
Also change CMAKE_SOURCE_LOCATION --> CMAKE_CURRENT_SOURCE_LOCATION
which is more correct and is needed when the source location is
not the top level folder in the project.
The subproject detection avoids adding things into the build that are not necessary (i.e., standardese, unit tests) and/or may cause conflicts (i.e.,
tests
target name) when building as a submodule in a parent project.Also change
CMAKE_SOURCE_LOCATION
-->CMAKE_CURRENT_SOURCE_LOCATION
which is more correct and is needed when the source location is not the top level folder in the project.