Thanks for the suggestion - a useful trick to have. I'd love an automatic way to trigger it though rather than having to run make rebuild_cache or thiis unset of the variable.
On Thu, Apr 30, 2009 at 5:16 PM, Philip Lowman <[email protected]> wrote: > 2009/4/30 Bill O'Hara <[email protected]> > >> Thanks - I wasn't sure I was explaining very clearly! I think >> "retriggering find_library" is a far more concise way to say it. >> >> Could perhaps a cmake developer comment on whether its possible to do >> this? Is there some workaround we could currently use to retrigger the >> find_library to check whether we need to relink before running an executable >> via a make target? >> > > I'm not really a cmake developer, but you might try Bill's suggestion of > unset(VAR CACHE). > You could consider something like this, if you're looking for an > interactive way to do it. > > if(RETRIGGER_SEARCH_FOR_FOO) > unset(FOO_LIBRARY CACHE) > unset(FOO_INCLUDE_DIR CACHE) > # etc. > unset(RETRIGGER_SEARCH_FOR_FOO CACHE) > endif() > option(RETRIGGER_SEARCH_FOR_FOO "Search again for Foo" OFF) > > find_package(FOO) > > > Also, often this goes unspoken on the mailing list but do bear in mind that > not all IDEs force recompilation of source files when you change include > directories or force relinking when you change library filenames (VS with > CMake generated project files is a prime example). Unless you know exactly > what you're doing in terms of changing preprocessor definitions, include > directories, or import libraries, it's usually safest to clean the entire > solution after changing your build configuration. > > -- > Philip Lowman >
_______________________________________________ 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
