On Sat, Jul 18, 2015 at 5:30 AM, Florent Castelli <florent.caste...@gmail.com> wrote: > I've used that once and you end up with the relative path to the sources > from the CMakeLists.txt. > If you're in another CMakeLists.txt, then you can't use the paths directly. > I tried a few properties but I couldn't find any property to get the folder > where the target was defined. > > How do you get the full path?
That's a very good point - using the command override approach, the CMAKE_CURRENT_SOURCE_DIR is always the directory of the target in question, and looking at our current code I see we do make use of that assumption. We would need a way to find out what CMAKE_CURRENT_SOURCE_DIR was when the target was defined if we're going to build up a list after the fact - maybe something like get_target_property(TDIR <targetname> SOURCE_DIR) to get the source directory in which the target was defined. In combination with the SOURCES property it would allow for full path reconstruction. CY -- 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-developers