Re: [CMake] Run clean before automatically re-running cmake?
Agreed that it is a bit heavyweight, but the stray files have resulted in some pretty cryptic issues in the past (targets linking against an old version of a library that got renamed etc...). Your idea sounds good... I'll give it a try. Thanks! -=Abe On Fri, Feb 14, 2014 at 8:55 AM, Bill Hoffman wrote: > On 2/14/2014 11:00 AM, Abe Bachrach wrote: > >> I'd only want to do a full build if one of the CMakeLists.txt has >> changed (cmake needs to get re-run). Otherwise, I'd like to do a normal >> build. >> > That seems a bit over kill to me. I would rather have a few extra files > than having a complete clean done each time a new file is added or a flag > is changed in a CMake file. Here is what you should do > > 1. create a list of all the targets in your project > 2. use configure file to save the list, but be tricky so that it saves the > last version of the file as well. > 3. add a custom command that all your targets depend on. The custom > command should depend on the file that is configured. It will get run only > when the file changes if you use copy on different. When the custom > command runs it should diff the two files and figure out what target went > away, and then remove it. > > Basically, you should be able to do this all from the CMake language with > custom commands and a CMake script. > > -Bill > > > -- > > 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://www.cmake.org/mailman/listinfo/cmake > -- 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://www.cmake.org/mailman/listinfo/cmake
Re: [CMake] Run clean before automatically re-running cmake?
I'd only want to do a full build if one of the CMakeLists.txt has changed (cmake needs to get re-run). Otherwise, I'd like to do a normal build. On Thu, Feb 13, 2014 at 4:52 AM, Ian Liu Rodrigues wrote: > You are correct that I would prefer that behavior, however I'd prefer to >> go for safety (and do a full clean) until that more advanced logic can be >> implemented... I am in fact using ninja, so hopefully that feature may come >> down the pipe soon :-) >> > > If you want a full build, why don't you just rm -rf build && mkdir build > && cd build && cmake ..? > -- 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://www.cmake.org/mailman/listinfo/cmake
Re: [CMake] Run clean before automatically re-running cmake?
On Wed, Feb 12, 2014 at 8:53 AM, Matthew Woehlke < mw_tr...@users.sourceforge.net> wrote: > > What you really want is to record the "old" list of output files, re-run > CMake, then remove any files on that list that no longer have rules to > generate them. If you do a complete 'clean' you will delete and have to > rebuild more than is necessary (which might even be nothing e.g. if CMake > is being re-run because you added a debugging message). > You are correct that I would prefer that behavior, however I'd prefer to go for safety (and do a full clean) until that more advanced logic can be implemented... I am in fact using ninja, so hopefully that feature may come down the pipe soon :-) -- 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://www.cmake.org/mailman/listinfo/cmake
[CMake] Run clean before automatically re-running cmake?
Hi there, The Makefile that cmake generates includes a rule to automatically re-run cmake if any of the input CMakelists.txt files change. Is there a way to configure this rule to have it run clean first? Currently, if you change the name of an executable target (or library), it will leave the old file in the output location, and then after re-running cmake, the Makefile will not have any record of it, so running make clean won't remove it. I would rather have the rule call make clean before re-running cmake so that such stray outputs are not left around. Is there any way to accomplish this? Thanks! -=Abe -- 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://www.cmake.org/mailman/listinfo/cmake
[CMake] target_link_libraries must have been created in the current directory?
In the cmake documentation for target_link_libraries() it says that: > The named must have been created in the current directory by a > command such as add_executable or add_library. Can someone provide a reason for that, and is there a work-around? We have a large project that is composed of many smaller semi-independent modules (each module builds one or more libraries and/or executables). Each module contains its own CMakeLists.txt file which is added to the top level project's CMakeLists.txt file with add_subdirectory(). Each module stores the set of public libraries that it generates, allowing us to specify dependencies between targets and modules (multiple targets). However for this to work, the CMakeLists.txt in the module directory must be parsed by cmake before the CMakeLists.txt of the target target. Currently, we manually specify the order that modules get built, however this is fragile and error prone. The cleanest way that I have thought of to remedy this situation would be to aggregate the target->module dependencies into a cached file, and then parse this file as the last thing cmake does, calling target_link_libraries() as needed. Unfortunately, this would require a function that could call target_link_libraries() from a directory that is different than the directory where the target was created :-/ Thanks! -- 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
Re: [CMake] changing the cmake color scheme
Thanks for the pointers, I'll try that... is there any logic/rational behind the developers choosing red for linking?? I would think that red should be reserved for errors... and doubly strange that errors are reported in black... should this be submitted as a "bug report"/feature request? -=Abe On Sat, Sep 4, 2010 at 9:17 AM, David Cole wrote: > On Sat, Sep 4, 2010 at 8:51 AM, Michael Hertling wrote: > >> On 09/04/2010 02:32 AM, Abe Bachrach wrote: >> > Hi there, >> > is there a way to change the color scheme that cmake uses while >> building?? >> > >> > I would rather not have the message for linking be red, since this >> > immediately makes me think there was an error. >> >> As Eric has pointed out in the meantime, those colors are hardcoded >> in the CMake code base, but - if on *nix - look at the following: >> >> ADD_CUSTOM_TARGET(red2yellow ALL >>COMMAND find ${CMAKE_BINARY_DIR} -name build.make >>-exec perl -pi -e "s/--red/--yellow/" "{}" "\;") >> >> Placed in the top-level CMakeLists.txt, this custom target tweakes the >> concerned Makefiles to present the linking message in a beautiful but >> unreadable yellow. ;) If it doesn't luckily execute as the very first >> target, you could resort to CMake's ordinary dependency mechanism. >> >> Yours colorfully, >> >> Michael >> ___ >> 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 >> > > > But watch out if any of your file names have "--red" in them.. > > :-) > > > ___ > 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 > ___ 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
[CMake] changing the cmake color scheme
Hi there, is there a way to change the color scheme that cmake uses while building?? I would rather not have the message for linking be red, since this immediately makes me think there was an error. thanks, -=Abe ___ 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