On Mon, Jun 22, 2009 at 10:05 AM, David Doria<[email protected]> wrote: > You may also need to use FORCE: >> >> if(NOT CMAKE_BUILD_TYPE) >> set(CMAKE_BUILD_TYPE "Release" CACHE STRING >> "Choose the type of build, options are: Debug Release >> RelWithDebInfo MinSizeRel." >> FORCE) >> endif(NOT CMAKE_BUILD_TYPE) >> >> James >> _______________________________________________ > > Great, that did it (it did require using FORCE). I don't understand why > <docstring> is required? Why can you not leave that string alone and simply > change the value of <variable>?
Because if you want to use FORCE you need to have a doc string. Note the [] grouping. If you don't provide a doc string it will not get the right number of arguments. set(<variable> <value> [[CACHE <type> <docstring> [FORCE]] | PARENT_SCOPE]) I've wanted the ability to set cache variables and leave the doc string alone for a while. I've just gotten used to the missing feature. I asked once if we could have the ability to query a doc string for a cache variable, so that I would only have to document the variable once, but I never filed a bug request for it. James _______________________________________________ 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
