2012/2/18 Alexander Neundorf <neund...@kde.org>: > On Saturday 18 February 2012, Eric Noulard wrote: >> Hi all, >> >> I'm pursuing my quest for a better CPack doc. >> First set of modifications are in master: >> cpack --help-command-xxx >> cpack --help-variable-xxx >> works. >> >> However variables are somehow "problematic" because I get all the >> properties defined for CMake in the doc because variables are a >> special kind of properties. >> >> CPack (or CTest) is using a instance of cmake object which does: >> >> this->InitializeProperties(); >> >> in its constructor.... >> so that I end up with a lot more properties in "full doc" >> i.e. in >> cpack --help-full >> >> Than I thought I shall. >> Now there is two options: >> >> 1) Avoid InitializeProperties(); in cmake object constructor and do >> that elsewhere >> for CMake and nowhere for CTest and CPack. >> >> 2) Let CTest and CPack keep the CMake inherited properties and filter out >> the unwaned CMake specific section in the doc. >> >> 1) is definitely easier but raise a question: >> Do CTest and CPack NEED the cmake property definition? >> Is this a wanted behavior or just an oversight? >> i.e. is set_property(...) supposed to work in a ctest or cpack >> loaded script? >> >> 2) is doable but require more work. >> >> in the same way should the "standard" variable doc section be inherited >> from CMake to CTest/CPack? >> >> try (I know it's not supposed to work but nevertheless): >> ctest --help-variable-list >> >> and you'll see what I mean. > > 2) sounds like a hack. If the properties are there, there should be a reason > for it, and then they should also appear in the documentation.
Agreed but it strange to have documentation for ALLOW_DUPLICATE_CUSTOM_TARGETS RULE_LAUNCH_COMPILE COMPILE_DEFINITIONS etc... for either CPack or CTest. nevertheless they ARE currently defined in the CMake script interpreter used by CTest or CPack because as I said they are defined in the cmake object constructor. They do not appear in the CTest doc because --help-variable is not implemented they do now in cpack because of that. Concerning CPack I'm pretty sure no part of CPack code uses CMake inherited properties, cpack's cmake interpreter is not supposed to load For CTest I doubt it but the fact is I don't really know. A small test of CMake in scripting mode (see script attached try it with cmake -P scriptable.cmake) tells me some properties may be useful but may be not all of them... Your opinion? -- Erk Membre de l'April - « promouvoir et défendre le logiciel libre » - http://www.april.org
message(STATUS "This script is launched in script mode") message(STATUS "Current dir is: ${CMAKE_CURRENT_LIST_DIR}") set_property(GLOBAL PROPERTY What "Coucou") message(STATUS "Property has been set") get_property(PROPVAL GLOBAL PROPERTY What) message(STATUS "Re-Read property value is: ${PROPVAL}") set(MYCACHE_VAL 123 CACHE INTERNAL "A Script mode cache value") get_property(PROPVAL CACHE MYCACHE_VAL PROPERTY HELPSTRING) message(STATUS "Cache entry help string is: ${PROPVAL}") message(STATUS "Trying to set a directory property") set_property(DIRECTORY PROPERTY EXCLUDE_FROM_ALL TRUE) get_property(PROPVAL DIRECTORY PROPERTY CACHE_VARIABLES) message(STATUS "Cache variables defined in this dir is: ${PROPVAL}")
-- 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://public.kitware.com/cgi-bin/mailman/listinfo/cmake-developers