I am attempting to use ExternalDependencies_Add with the last Protobuf
version (v3.0.0) which is in alpha3 (I'm using the master branch
actually)[1].
If you don't already know: contrary to previous Protobuf version, v3.x
provides
cmake scripts (and also makes CMake's FindProtobuf module unusuable if you
build Protobuf using CMake BTW).

I am having trouble figuring out how to ExternalProject_add work in this
case:
the CMakeFiles.txt is not in the root directory of Protobuf sources, it is
in ./cmake/ [2]
So at build time, after download, I obviously get:

>CUSTOMBUILD : CMake error : The source directory
"blahblah/install_protobuf" does not appear to contain CMakeLists.txt.

I tried several approaches using this as a base:

ExternalProject_Add( install_protobuf
    PREFIX ${NETRUSH_DEPENDENCIES_DIR}/protobuf
    GIT_REPOSITORY https://github.com/google/protobuf.git
    GIT_TAG master

    CMAKE_CACHE_ARGS
        -DBUILD_TESTING:bool=FALSE
)


I tried setting SOURCE_DIR but failed to make it work mainly because I'm
not sure what value to set exactly, and

   SOURCE_DIR cmake

Does not seem to work.

I was wondering if there is some args I could pass to CMake using CMAKE_ARGS
but from the cmake[3] page in the doc I don't see anything that match
exactly, or
I might be misunderstanding something.

I found this recommandation from Miklos Espak from 8th February 2015:
"Specify a patch command that creates a toplevel cmake list with one
'add_subdirectory(A)'  line."

It seems to work, but it also means that the repository is modified, which
is something
I want to avoid. Also it's really a hack for passing the right working
directory to cmake.

Is there a simpler way to do it that I missed?

Thanks for your time.

Joël Lamotte


[1] https://github.com/google/protobuf
[2] https://github.com/google/protobuf/tree/master/cmake
[3] http://www.cmake.org/cmake/help/v3.3/manual/cmake.1.html#manual:cmake(1)
-- 

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more 
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/cmake

Reply via email to