Handle benchmark like other subprojects by not calling
cmake_minimum_required(), project(), and cmake_policy() when
building in-tree.
Also add a new function, benchmark_add_library() that calls add_library()
by default, and llvm_add_library() when available.
This gets rid of an rpath warning on MacOS when compiled with
BUILD_SHARED_LIBS=ON.
Thanks to @lebedev.ri for suggesting how to conditionally wrap add_library().
@beanz Is this problem (ensuring that 'submodules' don't call cmake_minimum_required())
a common CMake issue? Or is it a side-effect of llvm's CMake files? I'm genuinely curious.
That being said, is this *only* about the cmake_minimum_required()?
If so, do you need to also wrap the call to project (benchmark) into this if?
If you don't, then the configure_file() change should also not be needed?