[CMake] Dependencies

Petr Kmoch petr.kmoch at gmail.com
Wed Feb 5 03:08:11 EST 2014


Hi Phil.

If your FOO.asm is used as a source file (i.e. it's listed in an
add_executable() or add_library() command), then you can use the source
file property OBJECT_DEPENDS for that:

  add_executable(myexe FOO.asm other.file one.more)

  set_property(SOURCE FOO.asm PROPERTY OBJECT_DEPENDS BAR.mac BAZ.mac) #any
list of dependencies here

As an alternative to set_property(), you can use the weaker, but shorthand
setter set_source_files_properties() (which can set it for multiple files
at once).

If they're somehow processed with a custom command/target (i.e. via
add_custom_command() or add_custom_target() instead of library/executable),
you can use that command's DEPENDS argument.

Petr


On Tue, Feb 4, 2014 at 7:57 PM, Phil Smith <phil at voltage.com> wrote:

> This is surely something basic, but I'm far from a CMake guru and would
> rather not spend weeks digging to solve something that **seems** like
> it'll be simple.
>
>
>
> We have assembler modules in a project. These use macros, as assembler
> modules are wont to do.
>
>
>
> So if module FOO.asm uses macro BAR.mac, and we change BAR, a CMake should
> rebuild FOO. We recognize that we're going to have to define these
> dependencies manually, but I'm assuming/hoping that there's a way to do
> that in a CMakeLists.
>
>
>
> Unfortunately words like "dependency" make lousy search terms!
>
>
>
> Can someone point me? Or, even better, give me an example of how to say
> "FOO.asm depends on macro BAR.mac"?
>
>
>
> Thanks...
>
> --
>
> ...phsiii
>
>
>
> Phil Smith III
>
> --
>
> 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
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.cmake.org/pipermail/cmake/attachments/20140205/ef4f7169/attachment.html>


More information about the CMake mailing list