Dear list,
I need to run a tool after building an executable, which will modify the 
executable itself.
I intend to extend the toolchain for this, because it shall be done for every 
executable on this particular operating system.

I think for this purpose, I need to change the rule 
CMAKE_<LANG>_LINK_EXECUTABLE.
And I think I can't put multiple commands into that rule, so I need to write a 
wrapper which will be called instead of the normal linker, and the calls the 
normal linker and then that special tool.

Right, so far?

Now I'd like to pass a few additional parameters to this tool, which I'd like 
to get from a special target property.

The rule currently looks like this:
set(CMAKE_C_LINK_EXECUTABLE        "<CMAKE_C_COMPILER> <FLAGS> 
<CMAKE_C_LINK_FLAGS> <LINK_FLAGS> <OBJECTS> -o <TARGET> <LINK_LIBRARIES>")

And I wonder what these placeholders in angle brackets mean, and if there are 
more placeholders available. The manual doesn't say anything about this, 
unfortunately:
https://cmake.org/cmake/help/latest/variable/CMAKE_LANG_LINK_EXECUTABLE.html

Is there, for example, a way to access arbitrary target properties?
Or do I need to hide my special parameters somewhere in the LINK_OPTIONS 
property?

Regards,
Sebastian
-- 

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:
https://cmake.org/mailman/listinfo/cmake

Reply via email to