59576

CMake: Is there anyway to force linking libraries?

Question:

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:

<blockquote>

make link

</blockquote>

Answer1:

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

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.

Recommend

  • Working copy got mysteriously unlinked from repository. How to relink it again and commit changes?
  • R colour scale for logarithmic data?
  • Does Accurev support stashing?
  • How do I convert a ResultSet in a List of Hashtable?
  • Excluding multiple values from the array
  • byebug, next into application code only
  • Clion & CMake. How To Add Library (*.so)
  • Using SWIG with a build system [closed]
  • matlab crashes without dump file when using fopen for file
  • Alamofire and Reachability.swift not working on xCode8-beta5
  • c++ regex_replace not doing intended substitution
  • C++ Single function pointer for all template instances
  • HttpURLConnection.getOutputStream() takes 20 seconds. Why?
  • Can I have a variable number of URI parameters or key-value pairs in Laravel 4?
  • XSLT foreach repeating nodes to flat
  • How to convert SOAP response with xsi values to json in WSO2esb
  • jwtBearer bearer token with rc-1 update to ASP.Net 5
  • Apache RewriteRule redirection with url encoded
  • Jetty 9 HashLoginService
  • Combining SpatialPolygonsDataFrame of two neighbour countries
  • Test if a set exists before trying to drop it
  • Python urlparse: small issue
  • PostgreSQL Query without WHERE only ORDER BY and LIMIT doesn't use index
  • Read a local file using javascript
  • Django: Count of Group Elements
  • Syntax for setting draggablecursor property in google maps api
  • Seeking advice on Jetty HttpClient Hang
  • does jqgrid support a multiple checkbox list for editing
  • Cannot connect to cassandra from Spark
  • Optimizing database types to compact database (SQLite)
  • swift auto completion not working in Xcode6-Beta
  • Excel - Autoshape get it's name from cell (value)
  • Cross-Platform Protobuf Serialization
  • Does CUDA 5 support STL or THRUST inside the device code?
  • Alternatives to the OPTIONAL fallback SPARQL pattern?
  • Do I've to free mysql result after storing it?
  • Why winpcap requires both .lib and .dll to run?
  • Turn off referential integrity in Derby? is it possible?
  • JaxB to read class hierarchy
  • reshape alternating columns in less time and using less memory