Originally I had a copy of protobuf in VCS with which I completely disagree. I would like to use protobuf as an external dependency to my project.
Only libprotobuf.cmake and libprotobuf-lite.cmake are required for the library. These files can be included in a custom CMakeLists.txt like this:
cmake_minimum_required(VERSION 2.8.12)
project(protobuf C CXX)
# set protobuf_source_dir
# set protobuf_SHARED_OR_STATIC to "SHARED" or "STATIC"
include_directories(${protobuf_source_dir}/src)
include(${protobuf_source_dir}/cmake/libprotobuf-lite.cmake)
include(${protobuf_source_dir}/cmake/libprotobuf.cmake)
I've heard about CMake's ExternalProject, but CMake complains that it can't find any CMakeLists.txt in that project.