Hi all-

I'm building an executable using the standard command:

add_executable(MyExe a.c b.c)

I'm adjusting the CMAKE_EXE_LINKER_FLAGS to emit a mapfile, and it works.

If I delete the mapfile, though, performing an incremental build doesn't
regenerate the mapfile.  This makes sense, since I haven't expressed to
cmake that the mapfile depends on MyExe.  In the above scenario, the
MyExe.map isn't even a target, so cmake doesn't even know it exists.

I've tried creating a custom target, but I can't create a custom command
that regenerates the mapfile, since it comes from add_executable.  I then
tried to use add_dependencies(), but that seems to only influence the build
order.

I could explicitly re-run the linker as a custom command that builds a
custom target, but that seems wasteful since linking does take a bit of
time.

It almost seems like I need some way to tell add_executable that there are
more outputs than just the executable image.  Is there a way to do this?

If anybody could point me in the right direction, I'd appreciate it!
 Thanks in advance for reading.

Best,
Charles
-- 

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

Reply via email to