Hi André, 2012/5/2 André Caron <[email protected]> > > I've come up with a simple workflow where each library project exports a > "library-config.cmake" file and any project that includes it defines the > "library_DIR" variable to the folder containing this "library-config.cmake" > file so that it can be resolved from anywhere in the CMake scripts using > only "find_package()". This way, when the library can either set the > "library_DIR" variable or inherit it from the parent project. This solves > the problem of using either its own Git submodule or a parent project's Git > submodule, ensuring you build the library only once for the entire project > and that all sub-projects use the same version. >
I am testing with a similar solution, having an example is great! I like the solution on how to build the dependencies (using the add_subdirectory in the config.cmake). I might need to reorder my project a little bit for this, but definitely looks useful! > I'm slowly converting all my projects to CMake using this pattern. You > can find some of those on my GitHub profile[2]. One example is cfcgi[3]. > Note that I'm learning a lot along the way and I don't guarantee that all > of this conforms to CMake best practices. I'm only referring to this for > the project structure and CMake concept to clarify my explanation with an > example. That being said, if anyone has comments about the CMake scripts > in there, your input is welcome :-) > I'll see if I can make an example for my usecase. If I have some comments/additions I will post them here. -- Met vriendelijke groet, Alexander Broekhuis
-- Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Follow this link to subscribe/unsubscribe: http://www.cmake.org/mailman/listinfo/cmake
