[CMake] Fwd: How to install files produced by custom targets

Lucas Soltic lucas.soltic at orange.fr
Fri Sep 6 13:17:13 EDT 2013


Woops wrong target email. So just so that anyone can read.. here it is:

Début du message réexpédié :

> De : Lucas Soltic <lucas.soltic at orange.fr>
> Objet : Rép : [CMake] How to install files produced by custom targets
> Date : 6 septembre 2013 19:15:27 UTC+02:00
> À : Petr Kmoch <petr.kmoch at gmail.com>
> 
> Le 6 sept. 2013 à 14:23, Petr Kmoch <petr.kmoch at gmail.com> a écrit :
> 
>> I just wanted to point out the existence of CMAKE_BUILD_TOOL, as it's related. In your case, however, you're probably better off hardcoding 'make'. It should actually be done the same way you run 'make' in your custom command creating the library.
> 
> Ok :)
> 
> I've looked at install(SCRIPT …) and in the meantime I found install(DIRECTORY …) and I realized it was also solving my problem!
> So at the moment I've a working solution with install(DIRECTORY …)
> 
> Thanks a lot for your help! Still good to know that CMake allows executing scrips at install time.
> 
> Lucas
> 
>> On Fri, Sep 6, 2013 at 2:08 PM, Lucas Soltic <lucas.soltic at orange.fr> wrote:
>> 
>> Le 6 sept. 2013 à 12:58, Petr Kmoch <petr.kmoch at gmail.com> a écrit :
>> 
>>> Hi Lucas,
>>> 
>>> you could look into install(CODE ...) or its escaping-hell-avoiding brother, install(SCRIPT ...). The code/script could then be something like execute_process(COMMAND make install ...) or perhaps even execute_process(COMMAND ${CMAKE_BUILD_TOOL} install ...).
>> 
>> Hi Petr,
>> 
>> I guess execute_process() with CMAKE_BUILD_TOOL depends on whether the target build tool supports "install" ? Will that work when installing from Visual Studio for example?
>> 
>> I need a solution that works both on Windows and Unixes :/
>> I'll have a look a install(SCRIPT …).
>> 
>> Thanks!
>> Lucas
>> 
>>> 
>>> Petr
>>> 
>>> 
>>> On Fri, Sep 6, 2013 at 11:44 AM, Lucas Soltic <lucas.soltic at orange.fr> wrote:
>>> Hello,
>>> 
>>> Considering that I have a custom target that outputs some libraries and these libraries were built using configure+make. The custom library is based on autotools. Configure + make are executed by a custom command in the custom target.
>>> 
>>> Is it possible to add a CMake install rule that will execute 'make install' on my custom library? So that the install process is automatically handled.
>>> 
>>> I'm asking that because at the moment I'm finding very hard to install a custom library only with classical CMake install rules, because I cannot know in advance the names of all the outputs because they have suffixes depending on the library version. And I would prefer to avoid hardcoding these versions, so that I can easily update my library.
>>> 
>>> Regards,
>>> Lucas
>>> --
>>> 
>>> 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/20130906/b9e2ae7d/attachment.htm>


More information about the CMake mailing list