Re: [cmake-developers] Listing all targets (was: Wrapping functions in CMake)
You're welcome. The key to using it effectively, of course, is using it at the very bottom of the top level CMakeLists.txt file. It can only report on the targets defined so far, so if you put it in the middle somewhere, targets may be defined after you use it, and you'll miss them... D On Saturday, July 18, 2015, Clifford Yapp cliffy...@gmail.com wrote: On Fri, Jul 17, 2015 at 6:05 PM, David Cole dlrd...@aol.com javascript:; wrote: Attached is a patch file of my first attempt. I can iterate some more on this (better testing, add docs, clarify existing docs, address anybody's comments, submit to stage) next week. Attached now in case anybody wants to try it out over the weekend. David, Awesome - thank you for doing that! (Way faster than I would have been able to set it up). It may be Monday before I can put it through it's paces, but I'll definitely give this a go and also see if I can combine it with the SOURCES target property Brad pointed out to kill two problems with one patch. I'll try to get at figuring out how to set up GLOBAL properties for collecting various types of message outputs and prepare a patch for that on Monday as well, unless someone else gets to it sooner. Cheers, 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
Re: [cmake-developers] Listing all targets (was: Wrapping functions in CMake)
On Thu, Jul 16, 2015 at 13:27:12 -0400, David Cole via cmake-developers wrote: This would best be added as a TARGETS variant of the existing http://www.cmake.org/cmake/help/v3.3/command/get_cmake_property.html command. (In my opinion...) The get_property command would also need to handle it. I don't know if it hooks into the more specific commands' implementations though. Doesn't seem like it from a cursory reading though. --Ben -- 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
Re: [cmake-developers] Listing all targets (was: Wrapping functions in CMake)
Are you saying there should be a named GLOBAL property with this information in it...? It seems like more of a fit to get_cmake_property. On Fri, Jul 17, 2015 at 10:14 AM, Ben Boeckel ben.boec...@kitware.com wrote: On Thu, Jul 16, 2015 at 13:27:12 -0400, David Cole via cmake-developers wrote: This would best be added as a TARGETS variant of the existing http://www.cmake.org/cmake/help/v3.3/command/get_cmake_property.html command. (In my opinion...) The get_property command would also need to handle it. I don't know if it hooks into the more specific commands' implementations though. Doesn't seem like it from a cursory reading though. --Ben -- 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
Re: [cmake-developers] Listing all targets (was: Wrapping functions in CMake)
On Fri, Jul 17, 2015 at 14:16:34 -0400, David Cole wrote: get_cmake_property is more like strictly well-pre-defined, read only (ish), built-into CMake properties. Note there is no set_cmake_property... What docs are you looking at that you think have a bug...? Help/command/get_cmake_property: get_cmake_property -- Get a property of the CMake instance. :: get_cmake_property(VAR property) Get a property from the CMake instance. The value of the property is stored in the variable VAR. If the property is not found, VAR will be set to NOTFOUND. Some supported properties include: VARIABLES, CACHE_VARIABLES, COMMANDS, MACROS, and COMPONENTS. See also the more general get_property() command. `get_property` has no way (that I see) to ask for the same properties. The whole command docs could use a revamp too (while TARGETS is being implemented to avoid conflicts?). --Ben -- 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
Re: [cmake-developers] Listing all targets (was: Wrapping functions in CMake)
I think the see also is relevant because it points to another way to get to a whole different set of properties. Perhaps what they're looking for when they stumble upon get_cmake_property is actually target properties, which are only accessible via get_property. While it's relevant, and I think it should remain, I do think it could use some clarification. I'll take a stab at this, and clarify the docs, too, unless somebody else chimes in and tells me wait! I'm doing it already :-) Cheers, David C. On Fri, Jul 17, 2015 at 2:55 PM, Ben Boeckel ben.boec...@kitware.com wrote: On Fri, Jul 17, 2015 at 14:16:34 -0400, David Cole wrote: get_cmake_property is more like strictly well-pre-defined, read only (ish), built-into CMake properties. Note there is no set_cmake_property... What docs are you looking at that you think have a bug...? Help/command/get_cmake_property: get_cmake_property -- Get a property of the CMake instance. :: get_cmake_property(VAR property) Get a property from the CMake instance. The value of the property is stored in the variable VAR. If the property is not found, VAR will be set to NOTFOUND. Some supported properties include: VARIABLES, CACHE_VARIABLES, COMMANDS, MACROS, and COMPONENTS. See also the more general get_property() command. `get_property` has no way (that I see) to ask for the same properties. The whole command docs could use a revamp too (while TARGETS is being implemented to avoid conflicts?). --Ben -- 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
Re: [cmake-developers] Listing all targets (was: Wrapping functions in CMake)
get_cmake_property is more like strictly well-pre-defined, read only (ish), built-into CMake properties. Note there is no set_cmake_property... What docs are you looking at that you think have a bug...? To implement TARGETS for get_cmake_property, I would look to see what logic is used by if(TARGET and use the same list it uses as the value returned here. Should I work on a patch/branch, or is somebody here already working on it? D On Fri, Jul 17, 2015 at 1:54 PM, Ben Boeckel ben.boec...@kitware.com wrote: On Fri, Jul 17, 2015 at 12:18:18 -0400, David Cole wrote: Are you saying there should be a named GLOBAL property with this information in it...? It seems like more of a fit to get_cmake_property. Indeed. It seems there is no overlap between `get_property` and `get_cmake_property`. Which means the docs have a bug. --Ben -- 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
Re: [cmake-developers] Listing all targets (was: Wrapping functions in CMake)
On Fri, Jul 17, 2015 at 12:18:18 -0400, David Cole wrote: Are you saying there should be a named GLOBAL property with this information in it...? It seems like more of a fit to get_cmake_property. Indeed. It seems there is no overlap between `get_property` and `get_cmake_property`. Which means the docs have a bug. --Ben -- 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
Re: [cmake-developers] Listing all targets (was: Wrapping functions in CMake)
On Fri, Jul 17, 2015 at 6:05 PM, David Cole dlrd...@aol.com wrote: Attached is a patch file of my first attempt. I can iterate some more on this (better testing, add docs, clarify existing docs, address anybody's comments, submit to stage) next week. Attached now in case anybody wants to try it out over the weekend. David, Awesome - thank you for doing that! (Way faster than I would have been able to set it up). It may be Monday before I can put it through it's paces, but I'll definitely give this a go and also see if I can combine it with the SOURCES target property Brad pointed out to kill two problems with one patch. I'll try to get at figuring out how to set up GLOBAL properties for collecting various types of message outputs and prepare a patch for that on Monday as well, unless someone else gets to it sooner. Cheers, 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
Re: [cmake-developers] Listing all targets (was: Wrapping functions in CMake)
Attached is a patch file of my first attempt. I can iterate some more on this (better testing, add docs, clarify existing docs, address anybody's comments, submit to stage) next week. Attached now in case anybody wants to try it out over the weekend. Cheers, David C. On Fri, Jul 17, 2015 at 3:03 PM, David Cole dlrd...@aol.com wrote: I think the see also is relevant because it points to another way to get to a whole different set of properties. Perhaps what they're looking for when they stumble upon get_cmake_property is actually target properties, which are only accessible via get_property. While it's relevant, and I think it should remain, I do think it could use some clarification. I'll take a stab at this, and clarify the docs, too, unless somebody else chimes in and tells me wait! I'm doing it already :-) Cheers, David C. On Fri, Jul 17, 2015 at 2:55 PM, Ben Boeckel ben.boec...@kitware.com wrote: On Fri, Jul 17, 2015 at 14:16:34 -0400, David Cole wrote: get_cmake_property is more like strictly well-pre-defined, read only (ish), built-into CMake properties. Note there is no set_cmake_property... What docs are you looking at that you think have a bug...? Help/command/get_cmake_property: get_cmake_property -- Get a property of the CMake instance. :: get_cmake_property(VAR property) Get a property from the CMake instance. The value of the property is stored in the variable VAR. If the property is not found, VAR will be set to NOTFOUND. Some supported properties include: VARIABLES, CACHE_VARIABLES, COMMANDS, MACROS, and COMPONENTS. See also the more general get_property() command. `get_property` has no way (that I see) to ask for the same properties. The whole command docs could use a revamp too (while TARGETS is being implemented to avoid conflicts?). --Ben 0001-CMake-Add-TARGETS-to-get_cmake_property.patch Description: Binary data -- 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
Re: [cmake-developers] Listing all targets (was: Wrapping functions in CMake)
This would best be added as a TARGETS variant of the existing http://www.cmake.org/cmake/help/v3.3/command/get_cmake_property.html command. (In my opinion...) David C. On Thu, Jul 16, 2015 at 11:42 AM, Clifford Yapp cliffy...@gmail.com wrote: On Wed, Jul 15, 2015 at 9:10 AM, Brad King brad.k...@kitware.com wrote: On 07/10/2015 03:42 PM, Clifford Yapp wrote: On Thu, Jul 9, 2015 at 1:35 PM, Clifford Yapp cliffy...@gmail.com wrote: 2. Provide similar lists of all defined targets for the various types (e.g. CMAKE_EXECUTABLE_TARGETS, CMAKE_LIBRARY_TARGETS, CMAKE_CUSTOM_TARGETS). Looking into the CMake sources, it seems like this information is stored already in the global target map - what would be the correct way to expose that information in variables in CMake script space? We shouldn't need separate lists for each because one can check the TYPE target property given the target name. Ah, good point. The list of globally-scoped (non-imported) targets could be made available through a (read-only) global property whose implementation computes the list on the fly. Sounds workable - are there any pre-existing properties like that that can serve as a guide for implementation? Thanks, 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 -- 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
Re: [cmake-developers] Listing all targets (was: Wrapping functions in CMake)
On Wed, Jul 15, 2015 at 9:10 AM, Brad King brad.k...@kitware.com wrote: On 07/10/2015 03:42 PM, Clifford Yapp wrote: On Thu, Jul 9, 2015 at 1:35 PM, Clifford Yapp cliffy...@gmail.com wrote: 2. Provide similar lists of all defined targets for the various types (e.g. CMAKE_EXECUTABLE_TARGETS, CMAKE_LIBRARY_TARGETS, CMAKE_CUSTOM_TARGETS). Looking into the CMake sources, it seems like this information is stored already in the global target map - what would be the correct way to expose that information in variables in CMake script space? We shouldn't need separate lists for each because one can check the TYPE target property given the target name. Ah, good point. The list of globally-scoped (non-imported) targets could be made available through a (read-only) global property whose implementation computes the list on the fly. Sounds workable - are there any pre-existing properties like that that can serve as a guide for implementation? Thanks, 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
Re: [cmake-developers] Listing all targets (was: Wrapping functions in CMake)
On 07/10/2015 03:42 PM, Clifford Yapp wrote: On Thu, Jul 9, 2015 at 1:35 PM, Clifford Yapp cliffy...@gmail.com wrote: 2. Provide similar lists of all defined targets for the various types (e.g. CMAKE_EXECUTABLE_TARGETS, CMAKE_LIBRARY_TARGETS, CMAKE_CUSTOM_TARGETS). Looking into the CMake sources, it seems like this information is stored already in the global target map - what would be the correct way to expose that information in variables in CMake script space? We shouldn't need separate lists for each because one can check the TYPE target property given the target name. The list of globally-scoped (non-imported) targets could be made available through a (read-only) global property whose implementation computes the list on the fly. -Brad -- 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