Am Mittwoch, 27. November 2013, 11:38:51 schrieb Neil Carlson: > I've created a "find" module for a library (following the example for zlib) > which I use in a standalone project. A second project has it as a > subdirectory, but the second project also uses the same find module for its > own purposes. I'm confused about how to best ensure that the "find" > doesn't get invoked twice; the top level project invokes it, setting > various variables that the lower level project uses without redoing the > find. > > What are the best practices for nesting projects like this? I was thinking > to change the find module to define an imported library target (instead of > a handful of variables like FindZLIB does) and then protecting the find > inside a IF( TARGET ... ) block? Comments?
Just don't care for it, this works for the most cases ;) Long version: if you only do things like find_library() and find_path() those will simply do nothing if their target variables are already defined, which is the same as if you would just run CMake again in the build directory. Eike
signature.asc
Description: This is a digitally signed message part.
-- 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://www.cmake.org/mailman/listinfo/cmake
