[CMake] How to install files produced by custom targets

2013-09-06 Thread Lucas Soltic
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


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

2013-09-06 Thread Petr Kmoch
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 ...).

Petr


On Fri, Sep 6, 2013 at 11:44 AM, Lucas Soltic lucas.sol...@orange.frwrote:

 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

--

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

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

2013-09-06 Thread Petr Kmoch
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.


On Fri, Sep 6, 2013 at 2:08 PM, Lucas Soltic lucas.sol...@orange.fr wrote:


 Le 6 sept. 2013 à 12:58, Petr Kmoch petr.km...@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.sol...@orange.frwrote:

 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




--

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