Re: [cmake-developers] automatically download library
On 08-Oct-15 18:06, Marsel Galimullin wrote: The idea is that CMake has possibility to contact with package managers for download necessary libraries. If “find_package” can’t find a library, it need to call apt-get install. Example: auto_downland(apt-get) find_package (Boost COMPONENTS system thread REQUIRED) re:{possibility to contact with package managers} *if* you have a suitable package manager. And even if you have one result may differs for different platforms, e.g.: * OSX, brew install boost => 1.58 * Ubuntu, apt-get install boost-dev => 1.54 Note that 'find_package(Boost)' can find any user-installed libraries or non-host packages for cross-compile, like building Android on Linux, or iOS on OSX (both issues can be solved by using ExternalProject + superbuild). If you and your users are okay with that then it's should be not so hard to implement this CMake module. On 06-Oct-15 15:22, Marsel Galimullin wrote: Hello! I'm student of the University LETI and as a masrer'sthesis I want to developan extension to CMake. It is expected that this extension will automatically download missinglibrary ifinstruction such as «find_package (Boost COMPONENTS system thread REQUIRED)» can not find the package. Could you give me some advices where to begin and which the best direction to design, developand whether to do it? So with all this peculiarities I've described above this will be not such an easy task as you might expect. You can start one from scratch for education or fun (or both) but if you want to do some really helpful stuff my advice to you is to feed "cmake package manager" request to your web search engine and investigate existing solutions. On 08-Oct-15 18:41, Ryan Schmidt wrote: On Oct 8, 2015, at 10:06 AM, Marsel Galimullin wrote: The idea is that CMake has possibility to contact with package managers for download necessary libraries. If “find_package” can’t find a library, it need to call apt-get install. Example: auto_downland(apt-get) find_package (Boost COMPONENTS system thread REQUIRED) I understand the idea, and I'm telling you that if you need this for your own personal project -- one that will never be included in a package management system -- then do whatever you like. But if you are proposing this as something that should be included in cmake, and you are suggesting that it could be used by any project that wants to -- even in projects that might someday be included in a package management system -- then I can tell you that this would not be welcomed by the people who maintain those package management systems. I am such a person. If I were tasked with the request to add to my package management system a project that wanted to control the installation of its own dependencies, or that in some other way tried to be in charge of downloading its dependencies, I would either have to rip all that code out, or more likely I would reject the request to add that project as being too labor-intensive. It is the package management system's job to download and install dependencies, not the job of the project's build system. re:{I would either have to rip all that code out, or more likely I would reject the request to add that project as being too labor-intensive} this can be solved easily by adding option which is set to OFF by default: option(USE_SUPERTOOL "Download host packages automatically" OFF) function(auto_download ...) if(NOT USE_SUPERTOOL) # do nothing return() endif() # do install endfunction() auto_download(...) # by default do nothing find_package(Boost COMPONENT system thread REQUIED) # find the packages you are expecting On 08-Oct-15 18:23, Brad King wrote: On 10/08/2015 11:06 AM, Marsel Galimullin wrote: The idea is that CMake has possibility to contact with package managers for download necessary libraries. If “find_package” can’t find a library, it need to call apt-get install. Example: auto_downland(apt-get) find_package (Boost COMPONENTS system thread REQUIRED) This does not provide enough information to know what package to install. This problem is not in scope for a build system. Another tool should be used to install dependencies ahead of time before running CMake. The source tree could come with some kind of dependency spec file for such a tool to use but this would be independent of the build system. -Brad re:{The source tree could come with some kind of dependency spec file for such a tool to use but this would be independent of the build system} As the one who is using such approach in my product I disagree with that completely :) CMake code and dependencies are in fact coupled strongly. For example: option(USE_GUI "Use some GUI for this project" OFF) if(USE_GUI) if(WIN32) option(USE_QT "Use Qt GUI" ON) else() option(USE_WXWIDGETS "Use WxWidgets GUI" ON) endif() # check at least one and not both if(USE_QT) f
Re: [cmake-developers] automatically download library
Thanks for your comments. 08.10.2015 18:41, Ryan Schmidt пишет: On Oct 8, 2015, at 10:06 AM, Marsel Galimullin wrote: The idea is that CMake has possibility to contact with package managers for download necessary libraries. If “find_package” can’t find a library, it need to call apt-get install. Example: auto_downland(apt-get) find_package (Boost COMPONENTS system thread REQUIRED) I understand the idea, and I'm telling you that if you need this for your own personal project -- one that will never be included in a package management system -- then do whatever you like. But if you are proposing this as something that should be included in cmake, and you are suggesting that it could be used by any project that wants to -- even in projects that might someday be included in a package management system -- then I can tell you that this would not be welcomed by the people who maintain those package management systems. I am such a person. If I were tasked with the request to add to my package management system a project that wanted to control the installation of its own dependencies, or that in some other way tried to be in charge of downloading its dependencies, I would either have to rip all that code out, or more likely I would reject the request to add that project as being too labor-intensive. It is the package management system's job to download and install dependencies, not the job of the project's build system. -- Kind regards, Marsel Galimullin. -- 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-developers
Re: [cmake-developers] automatically download library
On Oct 8, 2015, at 10:06 AM, Marsel Galimullin wrote: > The idea is that CMake has possibility to contact with package managers for > download necessary libraries. > If “find_package” can’t find a library, it need to call apt-get install. > Example: >auto_downland(apt-get) >find_package (Boost COMPONENTS system thread REQUIRED) I understand the idea, and I'm telling you that if you need this for your own personal project -- one that will never be included in a package management system -- then do whatever you like. But if you are proposing this as something that should be included in cmake, and you are suggesting that it could be used by any project that wants to -- even in projects that might someday be included in a package management system -- then I can tell you that this would not be welcomed by the people who maintain those package management systems. I am such a person. If I were tasked with the request to add to my package management system a project that wanted to control the installation of its own dependencies, or that in some other way tried to be in charge of downloading its dependencies, I would either have to rip all that code out, or more likely I would reject the request to add that project as being too labor-intensive. It is the package management system's job to download and install dependencies, not the job of the project's build system. -- 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-developers
Re: [cmake-developers] automatically download library
On 10/08/2015 11:06 AM, Marsel Galimullin wrote: > The idea is that CMake has possibility to contact with package managers > for download necessary libraries. > If “find_package” can’t find a library, it need to call apt-get install. > Example: > auto_downland(apt-get) > find_package (Boost COMPONENTS system thread REQUIRED) This does not provide enough information to know what package to install. This problem is not in scope for a build system. Another tool should be used to install dependencies ahead of time before running CMake. The source tree could come with some kind of dependency spec file for such a tool to use but this would be independent of the build system. -Brad -- 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-developers
Re: [cmake-developers] automatically download library
The idea is that CMake has possibility to contact with package managers for download necessary libraries. If “find_package” can’t find a library, it need to call apt-get install. Example: auto_downland(apt-get) find_package (Boost COMPONENTS system thread REQUIRED) 06.10.2015 15:33, Ryan Schmidt wrote: On Oct 6, 2015, at 7:22 AM, Марсель Галимуллин wrote: I'm student of the University LETI and as a masrer's thesis I want to develop an extension to CMake. It is expected that this extension will automatically download missing library if instruction such as «find_package (Boost COMPONENTS system thread REQUIRED)» can not find the package. Could you give me some advices where to begin and which the best direction to design, develop and whether to do it? If you need that for some special purpose, go for it, but it's probably not a behavior most users would expect, and it's definitely a behavior that would have to be disabled in any software installed by a package management system. (The package management system would want to be in control of what gets downloaded.) -- Kind regards, Marsel Galimullin. -- 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-developers
Re: [cmake-developers] automatically download library
On 10/06/2015 08:22 AM, Марсель Галимуллин wrote: > automatically download missing library if instruction such as > find_package (Boost COMPONENTS system thread REQUIRED) can not > find the package. In general this is outside the scope of a build system and falls in the domain of package management. I do not think this approach is a good fit for CMake's find_package infrastructure as proposed. FYI, CMake already has some features to help people build projects without manually installing all dependencies ahead of time. See ExternalProject and superbuilds for example: http://www.kitware.com/media/html/BuildingExternalProjectsWithCMake2.8.html -Brad -- 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-developers
Re: [cmake-developers] automatically download library
Hey, so i've been working on a quite large build system for OpenCMISS, which in turn consumes about 30 external packages itself. the main repo (and cmake logic) can be found here: https://github.com/OpenCMISS/manage (branch v1.0). feel free to have a look around and use some of the logic. essentially, it performs checks using find_package and then downloads the components from our github repos & builds them if not found. however, such an integration with many many components, difficult interoperability and (thus far) unclear origin of the packages that should be automatically installed (you'll need some sort of database / list for that) is quite a thing for a masters thesis. not to speak of incompatibilities with other system libraries that those automatically downloaded packages might want to use. as for ideas, there's the maven concept: https://maven.apache.org/. it's not cmake, but it also deals with the "is package there, if not, i know where to get & build it" issue. good luck :-) Dr. Daniel Wirtz Dipl. Math. Dipl. Inf. SRC SimTech Pfaffenwaldring 5a +49 711 685 60044 On 10/06/2015 02:22 PM, Марсель Галимуллин wrote: Hello! I'm student of the University LETI and as a masrer'sthesis I want to developan extension to CMake. It is expected that this extension will automatically download missinglibrary ifinstruction such as «find_package (Boost COMPONENTS system thread REQUIRED)» can not find the package. Could you give me some advices where to begin and which the best direction to design, developand whether to do it? -- Kind regards, Marsel Galimullin. -- 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-developers
Re: [cmake-developers] automatically download library
On Oct 6, 2015, at 7:22 AM, Марсель Галимуллин wrote: > I'm student of the University LETI and as a masrer's thesis I want to develop > an extension to CMake. It is expected that this extension will automatically > download missing library if instruction such as «find_package (Boost > COMPONENTS system thread REQUIRED)» can not find the package. Could you give > me some advices where to begin and which the best direction to design, > develop and whether to do it? If you need that for some special purpose, go for it, but it's probably not a behavior most users would expect, and it's definitely a behavior that would have to be disabled in any software installed by a package management system. (The package management system would want to be in control of what gets downloaded.) -- 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-developers
[cmake-developers] automatically download library
Hello!I'm student of the University LETI and as a masrer's thesis I want to develop an extension to CMake. It is expected that this extension will automatically download missing library if instruction such as «find_package (Boost COMPONENTS system thread REQUIRED)» can not find the package. Could you give me some advices where to begin and which the best direction to design, develop and whether to do it? --Kind regards,Marsel Galimullin. -- 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-developers