[CMake] Dependencies

Zaak Beekman zbeekman at gmail.com
Wed Feb 5 12:14:54 EST 2014


I might also add that the set_property() approach has an additional
advantage over the set_source_files_properties(): The APPEND and
APPEND_STRING options allow you to add properties like dependencies without
overwriting the values which already exist.


> 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
>
>
Izaak Beekman
===================================
(301)244-9367
Princeton University Doctoral Candidate
Mechanical and Aerospace Engineering
ibeekman at princeton.edu

UMD-CP Visiting Graduate Student
Aerospace Engineering
ibeekman at umiacs.umd.edu
ibeekman at umd.edu
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.cmake.org/pipermail/cmake/attachments/20140205/83150cfb/attachment.html>


More information about the CMake mailing list