Is there anyway to force linking libraries again. This would be useful when some libraries have changed but there is no change in any of the source codes of current project. I am looking for something like this:

make link

有帮助吗?

解决方案

CMake should be able to relink automatically when a particular library changes if you follow the tips here: http://www.cmake.org/pipermail/cmake/2010-November/041072.html

The main idea is to give a full path to target_link_libraries(), rather than just the library name. If you give a full path, CMake will actually inspect the file for modification and relink if it has changed.

If you prefer to explicitly trigger relinking yourself, you can use add_custom_command to make a command like make link which will remove the executable and then trigger a regular make to rebuild it.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top