[CMake] retrieving and manipulating (Fortran) dependency information

Zaak Beekman zbeekman at gmail.com
Mon Feb 3 11:57:24 EST 2014


Brad,
Thanks for the reply. After hunting around some more, I discovered the
source file properties OBJECT_DEPENDS and OBJECT_OUTPUTS. I have yet to
experiment with these, but I am wondering if CMake's automatic dependency
resolution will populate these properties. If so I could get dependency
information from there.

(I am trying to setup flymake targets for emacs which don't (re)compile
anything, but rather run the compilers with the compile time warning flags
and -syntax-only flags. Modules and dependency resolution in Fortran is the
main impediment here and if I can come up with a sane solution I may
implement it as a CMake module and share it with others.)

-Zaak

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


On Mon, Feb 3, 2014 at 11:46 AM, Brad King <brad.king at kitware.com> wrote:

> On 01/30/2014 05:43 PM, Zaak Beekman wrote:
> > I noticed that output_required_files is deprecated.
>
> Yes, it has been marked as such since CMake 2.8.5:
>
>  http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=5cf4ff6e
>  http://www.cmake.org/Bug/view.php?id=12214
>
> but was out of favor long before that.  It was a rudimentary
> scanner and did not support Fortran the way CMake's scanner
> used by Makefile generator does.
>
> The modern dependency scanner is an internal implementation
> detail and is not exposed through a public interface.  We do
> not want to expose it publicly because that would limit future
> refactoring.
>
> > Is there a way to determine the dependencies of a Fortran source
> > file that I can then manipulate in a CMakeLists.txt file? Fortran
> > dependency resolution is a pain, and I need to determine
> > dependencies for a custom target.
>
> While the scanner output is not directly accessible you can tell
> CMake to treat dependencies for a custom command as it would
> a particular language source compilation.  The IMPLICIT_DEPENDS
> option to add_custom_command may work:
>
>  add_custom_command(...
>    COMMAND ...command that runs compiler...
>    IMPLICIT_DEPENDS Fortran
>    )
>
> but only with Makefile generators.
>
> -Brad
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.cmake.org/pipermail/cmake/attachments/20140203/7dce707d/attachment.html>


More information about the CMake mailing list