[prev in list] [next in list] [prev in thread] [next in thread] 

List:       cmake
Subject:    Re: [CMake] file dependency not working in external projects
From:       hex <hex7c3 () gmail ! com>
Date:       2019-09-24 14:07:34
Message-ID: fa25744c-c4e1-d3b3-32ae-b322c1fcf6d1 () gmail ! com
[Download RAW message or body]

[Attachment #2 (multipart/alternative)]


hello Eric Doenges,

You are correct. This has been given me headaches.

Setting BUILD_ALWAYS to TRUE gives the desired behaviour.


Thank you


On 24/09/2019 14:59, Eric Doenges wrote:
>
> You're probably missing the BUILD_ALWAYS option to ExternalProject_Add:
>
> |BUILD_ALWAYS <bool>|
>     Enabling this option forces the build step to always be run. This
>     can be the easiest way to robustly ensure that the external
>     project’s own build dependencies are evaluated rather than relying
>     on the default success timestamp-based method. This option is not
>     normally needed unless developers are expected to modify something
>     the external project’s build depends on in a way that is not
>     detectable via the step target dependencies (e.g. |SOURCE_DIR| is
>     used without a download method and developers might modify the
>     sources in |SOURCE_DIR|).
> Am 24.09.19 um 15:23 schrieb hex:
>> hello,
>>
>> I have a problem with a build step.
>>
>> The following command is run every time somefile changes:
>>
>> add_custom_command( OUTPUT out.put
>>     COMMAND touch out.put
>>     DEPENDS somefile.txt
>> )
>>
>> add_custom_target( sometarget DEPENDS out.put )
>>
>>
>> I move this snippet inside an external project (with 
>> ExternalProject_Add) and the custom command is only run once at build.
>>
>> I am using absolute path to somefile, the command is not rebuild 
>> changing somefile.
>>
>> I am using Gnu make generator and build with make all
>>
>>
>> What am I missing?
>>
> -- 
>
> *Dr. Eric Dönges*
> Senior Software Engineer
>
> MVTec Software GmbH | Arnulfstr. 205 | 80634 Munich | Germany
> doenges@mvtec.com <mailto:mustermann@mvtec.com> | Tel: +49 89 457 
> 695-0 | www.mvtec.com <http://www.mvtec.com>
>
> Find our privacy policy here <https://www.mvtec.com/imprint>.
>
> Sign up <https://www.mvtec.com/newsletter> for our MVTec Newsletter!
>
> Geschäftsführer: Dr. Wolfgang Eckstein, Dr. Olaf Munkelt
> Amtsgericht München HRB 114695
>
> MVTec Software GmbH Logo
>

[Attachment #5 (text/html)]

<html>
  <head>

    <meta http-equiv="content-type" content="text/html; charset=UTF-8">
  </head>
  <body text="#000000" bgcolor="#FFFFFF">
    <br>
    <div class="moz-forward-container"> hello Eric Doenges,
      <p>You are correct. This has been given me headaches. <br>
      </p>
      <p>Setting BUILD_ALWAYS to TRUE gives the desired behaviour. <br>
      </p>
      <p><br>
      </p>
      <p>Thank you<br>
      </p>
      <p><br>
      </p>
      <div class="moz-cite-prefix">On 24/09/2019 14:59, Eric Doenges
        wrote:<br>
      </div>
      <blockquote type="cite"
        cite="mid:533cf7a4-2d0e-38c8-9aa8-840cd05685d3@mvtec.com">
        <meta http-equiv="Content-Type" content="text/html;
          charset=UTF-8">
        <p>You're probably missing the BUILD_ALWAYS option to
          ExternalProject_Add:</p>
        <p> </p>
        <dt><code class="docutils literal notranslate"><span class="pre">BUILD_ALWAYS</span>
            <span class="pre">&lt;bool&gt;</span></code></dt>
        <dd>Enabling this option forces the build step to always be run.
          This can be the easiest way to robustly ensure that the
          external project’s own build dependencies are evaluated rather
          than relying on the default success timestamp-based method.
          This option is not normally needed unless developers are
          expected to modify something the external project’s build
          depends on in a way that is not detectable via the step target
          dependencies (e.g. <code class="docutils literal notranslate"><span
              class="pre">SOURCE_DIR</span></code> is used without a
          download method and developers might modify the sources in <code
            class="docutils literal notranslate"><span class="pre">SOURCE_DIR</span></code>).</dd>
        <div class="moz-cite-prefix">Am 24.09.19 um 15:23 schrieb hex:<br>
        </div>
        <blockquote type="cite"
          cite="mid:6e50496c-706c-a037-fc54-3f1880a86cf4@gmail.com">hello,
          <br>
          <br>
          I have a problem with a build step. <br>
          <br>
          The following command is run every time somefile changes: <br>
          <br>
          add_custom_command( OUTPUT out.put <br>
              COMMAND touch out.put <br>
              DEPENDS somefile.txt <br>
          ) <br>
          <br>
          add_custom_target( sometarget DEPENDS out.put ) <br>
          <br>
          <br>
          I move this snippet inside an external project (with
          ExternalProject_Add) and the custom command is only run once
          at build. <br>
          <br>
          I am using absolute path to somefile, the command is not
          rebuild changing somefile. <br>
          <br>
          I am using Gnu make generator and build with make all <br>
          <br>
          <br>
          What am I missing? <br>
          <br>
        </blockquote>
        <div class="moz-signature">-- <br>
          <div style="width:480px; text-align: left; font-family: Arial,
            Helvetica, sans-serif;">
            <p style="color: #062d64; font-size: 14px; text-align: left;
              font-family: Arial, Helvetica, sans-serif;"> <b>Dr. Eric
                Dönges</b> <br>
              Senior Software Engineer </p>
            <p style="color: #062d64; font-size: 12px; text-align: left;
              font-family: Arial, Helvetica, sans-serif;">MVTec Software
              GmbH | Arnulfstr. 205 | 80634 Munich | Germany <br>
              <a style="font-size: 12px; font-family: Arial, Helvetica,
                sans-serif; color: #062d64;"
                href="mailto:mustermann@mvtec.com"
                moz-do-not-send="true">doenges@mvtec.com</a> | Tel: +49
              89 457 695-0 | <a style="font-size: 12px; font-family:
                Arial, Helvetica, sans-serif; color: #062d64;"
                href="http://www.mvtec.com" moz-do-not-send="true">www.mvtec.com</a>
              <br>
            </p>
            <p> <span style="font-size: 12px; font-family: Arial,
                Helvetica, sans-serif; color: #062d64;">Find our privacy
                policy <a style="font-size: 12px; font-family: Arial,
                  Helvetica, sans-serif; color: #062d64;"
                  href="https://www.mvtec.com/imprint"
                  moz-do-not-send="true">here</a>.</span> </p>
            <p style="color: #062d64; font-size: 12px; text-align: left;
              font-family: Arial, Helvetica, sans-serif;"><img
src="https://mvtec.com/fileadmin/Redaktion/newsletter/mail-signature/newsletter-icon.png"
                valign="bottom" moz-do-not-send="true" width="16"
                height="16"> <a style="font-size: 12px; font-family:
                Arial, Helvetica, sans-serif; color: #062d64;
                font-weight: bold;"
                href="https://www.mvtec.com/newsletter"
                moz-do-not-send="true">Sign up</a> for our MVTec
              Newsletter!</p>
            <p style="margin: 0px; color: #666; font-size: 12px;
              text-align: left; font-family: Arial, Helvetica,
              sans-serif;">Geschäftsführer: Dr. Wolfgang Eckstein, Dr.
              Olaf Munkelt<br>
              Amtsgericht München HRB 114695</p>
            <p style="margin: 0px; color: #666; font-size: 12px;
              text-align: left; font-family: Arial, Helvetica,
              sans-serif;"> </p>
            <img
src="https://www.mvtec.com/fileadmin/Redaktion/newsletter/mail-signature/mvtec-logo-line.png"
              alt="MVTec Software GmbH Logo" moz-do-not-send="true"></div>
        </div>
        <br>
        <fieldset class="mimeAttachmentHeader"></fieldset>
      </blockquote>
    </div>
  </body>
</html>


-- 

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



[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic