[CMake] How to build a target on install (only)?

David Cole DLRdave at aol.com
Mon Feb 16 09:55:46 EST 2015


Ah ha! Back to the simpler approach with install(CODE....!

Good idea, Nils.

Then you just need a stamp/sentinel file associated with running the
operation, and you can check it against your input.

For your "comment" line, you could use "cmake -E echo" to spit out a
comment before running the dSYM tool, and for your stamp files, after
the operation is done, you can use "cmake -E touch" to update the time
stamp on the sentinel files.


D



On Mon, Feb 16, 2015 at 9:49 AM, Nils Gladitz <nilsgladitz at gmail.com> wrote:
> On 02/16/2015 03:25 PM, Paul Smith wrote:
>>
>> On Sun, 2015-02-15 at 18:26 -0600, Iosif Neitzke wrote:
>>>
>>> For conditional file install, you could try something like "cmake -E
>>> copy_if_different".
>>
>>
>> That won't work; I don't have any files to copy.  What I want is to run
>> the dsymutil command during install only, not during the normal build
>> (because it's slow), but only if the binary that was installed has
>> changed.
>>
>> copy_if_different won't help here.
>
>
> How about custom dependency checking?
>
> e.g. something like:
>
>   if(${dependency} IS_NEWER_THAN ${output})
>     execute_process(...)
>   endif()
>
> Nils
>
> --
>
> 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://public.kitware.com/mailman/listinfo/cmake


More information about the CMake mailing list