Re: [CMake] What is the best way to handle Boost dependencies in a package config file
Thanks for the reply, Michi. Forgive me if I'm missing something - how does this help with your package config file? Doesn't Boost_LIBRARIES contain full paths to the component libraries you listed? My understanding is that in order to have a package config file result in something that can be relocated, I'd need to be able to do something like: find_package(Boost CONFIG COMPONENTS system filesystem regex REQUIRED) target_link_libraries(my_target Boost::system Boost::filesystem Boost::regex) That is, the find package would have to create imported targets for the boost dependencies. As far as I know, FindBoost.cmake does not do this. Please correct me if I'm wrong - that would make me most happy! Thanks again for the help. Matt > -Original Message- > From: Michi Henning [mailto:michi.henn...@canonical.com] > Sent: Wednesday, January 27, 2016 1:55 AM > To: Johnson, Matt (GE Healthcare) > Cc: cmake@cmake.org > Subject: Re: [CMake] What is the best way to handle Boost dependencies in > a package config file > > We use this, which works fine for me on Ubuntu: > > find_package(Boost COMPONENTS system filesystem regex serialization > thread log REQUIRED) > > Cheers, > > Michi. > > > On 27 Jan 2016, at 12:54 , Johnson, Matt (GE Healthcare) >wrote: > > > > I like package config files. I want to use more of them. However, I have a > dependency on boost. While boost has a Find module, it doesn't have a > package config file. I'm not going to be able to depend on the users of my > package building boost via cmake (also, is that still an active thing?). > > > > It seems like the best I could hope for is to generate the package config > > file, > then hack it up to deal with the boost stuff. Has anyone already solved this > problem or have any tips? I found this Hunter package manager > (https://urldefense.proofpoint.com/v2/url?u=https- > 3A__github.com_ruslo_hunter=CwIFAg=IV_clAzoPDE253xZdHuilRgztyh > _RiV3wUrLrDQYWSI=qts7iZJBjQRtedrrcqcDRKGTou2a2ZKSs95InlFGa34 > =PrIOuKSVt-ib8BwXCLUzXhcXKOaI-nPRE3lR3m- > XYH8=2LvLkrDkWzloxqrrBP6UdCiiL0YnWgmToNjL2_5mZTw= ), but it > seems a bit heavyweight when all I want is boost. Also, I can't have my build > system going out and downloading the packages - they all have to come from > an internal source. > > > > Thanks, > > Matt > > > > > > -- > > > > Powered by www.kitware.com > > > > Please keep messages on-topic and check the CMake FAQ at: > > https://urldefense.proofpoint.com/v2/url?u=http- > 3A__www.cmake.org_Wiki > > _CMake- > 5FFAQ=CwIFAg=IV_clAzoPDE253xZdHuilRgztyh_RiV3wUrLrDQYWSI= > > qts7iZJBjQRtedrrcqcDRKGTou2a2ZKSs95InlFGa34=PrIOuKSVt- > ib8BwXCLUzXhcX > > KOaI-nPRE3lR3m- > XYH8=voIOJHSB3_3nWFPCHnLZrEHATQTMvoAv6TceyDyGQZA= > > > > Kitware offers various services to support the CMake community. For more > information on each offering, please visit: > > > > CMake Support: > > https://urldefense.proofpoint.com/v2/url?u=http- > 3A__cmake.org_cmake_he > > > lp_support.html=CwIFAg=IV_clAzoPDE253xZdHuilRgztyh_RiV3wUrLrDQ > YWSI > > =qts7iZJBjQRtedrrcqcDRKGTou2a2ZKSs95InlFGa34=PrIOuKSVt- > ib8BwXCLUzX > > hcXKOaI-nPRE3lR3m- > XYH8=g65Y7hDTwOo3VrTo2tEH3SUkWkr98xxGzXD1HwzQYsw > > = CMake Consulting: > > https://urldefense.proofpoint.com/v2/url?u=http- > 3A__cmake.org_cmake_he > > > lp_consulting.html=CwIFAg=IV_clAzoPDE253xZdHuilRgztyh_RiV3wUrLr > DQY > > WSI=qts7iZJBjQRtedrrcqcDRKGTou2a2ZKSs95InlFGa34=PrIOuKSVt- > ib8BwXCL > > UzXhcXKOaI-nPRE3lR3m-XYH8=Ldr318Ilc_hQg2SdaGdLBb- > iz_KqDMgeeUbtAMAodH > > U= CMake Training Courses: > > https://urldefense.proofpoint.com/v2/url?u=http- > 3A__cmake.org_cmake_he > > > lp_training.html=CwIFAg=IV_clAzoPDE253xZdHuilRgztyh_RiV3wUrLrDQ > YWS > > I=qts7iZJBjQRtedrrcqcDRKGTou2a2ZKSs95InlFGa34=PrIOuKSVt- > ib8BwXCLUz > > XhcXKOaI-nPRE3lR3m- > XYH8=QihVB4Y2sUhcmA1sx5eJiP5U6bAEPUiv0eWvBaxQCBM& > > e= > > > > Visit other Kitware open-source projects at > > https://urldefense.proofpoint.com/v2/url?u=http- > 3A__www.kitware.com_op > > > ensource_opensource.html=CwIFAg=IV_clAzoPDE253xZdHuilRgztyh_Ri > V3wU > > > rLrDQYWSI=qts7iZJBjQRtedrrcqcDRKGTou2a2ZKSs95InlFGa34=PrIOuKS > Vt-ib > > 8BwXCLUzXhcXKOaI-nPRE3lR3m- > XYH8=HS6ra4DuapPlznsB2bTbsvGRHWo1VqrLEC8W > > LkNuNE4= > > > > Follow this link to subscribe/unsubscribe: > > https://urldefense.proofpoint.com/v2/url?u=http-3A__public.kitware.com > > > _mailman_listinfo_cmake=CwIFAg=IV_clAzoPDE253xZdHuilRgztyh_RiV > 3wUrLrDQYWSI=qts7iZJBjQRtedrrcqcDRKGTou2a2ZKSs95InlFGa34=PrIO > uKSVt-ib8BwXCLUzXhcXKOaI-nPRE3lR3m- > XYH8=aXGbP0VkR84NnoG05l6FMHvDll3S2Z788vYWyD5bQp0= -- 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
Re: [CMake] What is the best way to handle Boost dependencies in a package config file
> -Original Message- > From: Ruslan Baratov [mailto:ruslan_bara...@yahoo.com] > Sent: Wednesday, January 27, 2016 2:18 AM > To: Johnson, Matt (GE Healthcare) > Cc: cmake@cmake.org > Subject: Re: [CMake] What is the best way to handle Boost dependencies in > a package config file > > On 27-Jan-16 09:54, Johnson, Matt (GE Healthcare) wrote: > > I like package config files. I want to use more of them. However, I have a > dependency on boost. While boost has a Find module, it doesn't have a > package config file. I'm not going to be able to depend on the users of my > package building boost via cmake (also, is that still an active thing?). > > > > It seems like the best I could hope for is to generate the package config > > file, > then hack it up to deal with the boost stuff. Has anyone already solved this > problem or have any tips? I found this Hunter package manager > (https://urldefense.proofpoint.com/v2/url?u=https- > 3A__github.com_ruslo_hunter=CwIC- > g=IV_clAzoPDE253xZdHuilRgztyh_RiV3wUrLrDQYWSI=qts7iZJBjQRtedrrc > qcDRKGTou2a2ZKSs95InlFGa34=h5ntMfnYSIOG1mQp_twkUPunK5Nz0q9 > HBqa7Ld4B_hs=zi9sk8NwKokHEqrLyGA5a_yrRxLdHF9P7ID23wgrWPY= > ), but it seems a bit heavyweight when all I want is boost. > -- > > Also, I can't have my build system going out and downloading the packages > - they all have to come from an internal source. > > > Just for your information you can use "file://" links instead of regular > "https://urldefense.proofpoint.com/v2/url?u=http-3A__=CwIC- > g=IV_clAzoPDE253xZdHuilRgztyh_RiV3wUrLrDQYWSI=qts7iZJBjQRtedrrc > qcDRKGTou2a2ZKSs95InlFGa34=h5ntMfnYSIOG1mQp_twkUPunK5Nz0q9 > HBqa7Ld4B_hs=ts63TtZeGvflnLyyJ8pKESTjxabuzNCPmS0fGn_1L7E= " in > both hunter.cmake and HunterGate so there is no need to "go out" - you can > be completely offline. > > Ruslo Ruslo - thanks for that. I'm seriously going to look into Hunter more. From my cursory glance at it, it's a seriously impressive bit of cmake scripting. Can I ask you a few follow ups? 1. in the case of boost, what it is doing is using the find package module, then creating import targets based off the information. Correct? 2. If I require a newer version of boost than what is listed in the gate file, I'd need to update hunter.cmake and HunterGate, correct? 3. If I want to distribute my package to others, they too would need to use Hunter, correct? Since boost doesn't have a package config file in its distribution, the dependency targets (e.g. Boost::regex) wouldn't exist on their system) Any tips on this? Thanks again for your hard work on Hunter. I've done a bit of cmake to download and install some dependencies in the past. Yours is WAY nicer than what I came up with. Matt -- 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
Re: [CMake] What is the best way to handle Boost dependencies in a package config file
On 27-Jan-16 20:08, Johnson, Matt (GE Healthcare) wrote: -Original Message- From: Ruslan Baratov [mailto:ruslan_bara...@yahoo.com] Sent: Wednesday, January 27, 2016 2:18 AM To: Johnson, Matt (GE Healthcare) Cc: cmake@cmake.org Subject: Re: [CMake] What is the best way to handle Boost dependencies in a package config file On 27-Jan-16 09:54, Johnson, Matt (GE Healthcare) wrote: I like package config files. I want to use more of them. However, I have a dependency on boost. While boost has a Find module, it doesn't have a package config file. I'm not going to be able to depend on the users of my package building boost via cmake (also, is that still an active thing?). It seems like the best I could hope for is to generate the package config file, then hack it up to deal with the boost stuff. Has anyone already solved this problem or have any tips? I found this Hunter package manager (https://urldefense.proofpoint.com/v2/url?u=https- 3A__github.com_ruslo_hunter=CwIC- g=IV_clAzoPDE253xZdHuilRgztyh_RiV3wUrLrDQYWSI=qts7iZJBjQRtedrrc qcDRKGTou2a2ZKSs95InlFGa34=h5ntMfnYSIOG1mQp_twkUPunK5Nz0q9 HBqa7Ld4B_hs=zi9sk8NwKokHEqrLyGA5a_yrRxLdHF9P7ID23wgrWPY= ), but it seems a bit heavyweight when all I want is boost. -- Also, I can't have my build system going out and downloading the packages - they all have to come from an internal source. Just for your information you can use "file://" links instead of regular "https://urldefense.proofpoint.com/v2/url?u=http-3A__=CwIC- g=IV_clAzoPDE253xZdHuilRgztyh_RiV3wUrLrDQYWSI=qts7iZJBjQRtedrrc qcDRKGTou2a2ZKSs95InlFGa34=h5ntMfnYSIOG1mQp_twkUPunK5Nz0q9 HBqa7Ld4B_hs=ts63TtZeGvflnLyyJ8pKESTjxabuzNCPmS0fGn_1L7E= " in both hunter.cmake and HunterGate so there is no need to "go out" - you can be completely offline. Ruslo Ruslo - thanks for that. I'm seriously going to look into Hunter more. From my cursory glance at it, it's a seriously impressive bit of cmake scripting. -- Can I ask you a few follow ups? 1. in the case of boost, what it is doing is using the find package module, then creating import targets based off the information. Correct? In general yes, but also some information passed from ExternalProject_Add recipe, like optional dependency. So it differs from approach "just add BoostConfig.cmake file" after boost installed. Templates: * https://github.com/ruslo/hunter/blob/master/cmake/templates/BoostConfig.cmake.in * https://github.com/ruslo/hunter/blob/master/cmake/templates/BoostBZip2Dependency.cmake.in (optional boost.iostreams -> bzip2 dependency) 2. If I require a newer version of boost than what is listed in the gate file, I'd need to update hunter.cmake and HunterGate, correct? URL/SHA1 of HunterGate command doesn't hold version of Boost to be precise. It holds version of archive with several versions of Boost (Boost/hunter.cmake: 1.55, 1.56, ...) and default version (configs/default.cmake: 1.58). User can choose non-default version by adding custom local config.cmake file: https://github.com/ruslo/hunter/wiki/example.custom.config.id. If you need version that is not listed in Boost/hunter.cmake you have to add it to Boost/hunter.cmake and create new archive. There is feature request that can allow to do it locally so it will be improved in future. 3. If I want to distribute my package to others, they too would need to use Hunter, correct? Since boost doesn't have a package config file in its distribution, the dependency targets (e.g. Boost::regex) wouldn't exist on their system) Any tips on this? Well somebody have to install such extra code with Boost::* targets anyway, the easiest way is to delegate this job to Hunter. Also if you add your package to Hunter archive then users can add your package just by `hunter_add_package(Foo)` without even knowing about Boost and type of Boost targets. This is package distribution design. Thanks again for your hard work on Hunter. I've done a bit of cmake to download and install some dependencies in the past. Yours is WAY nicer than what I came up with. Matt Thanks, Ruslo -- 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
Re: [CMake] What is the best way to handle Boost dependencies in a package config file
We use this, which works fine for me on Ubuntu: find_package(Boost COMPONENTS system filesystem regex serialization thread log REQUIRED) Cheers, Michi. > On 27 Jan 2016, at 12:54 , Johnson, Matt (GE Healthcare) >wrote: > > I like package config files. I want to use more of them. However, I have a > dependency on boost. While boost has a Find module, it doesn't have a > package config file. I'm not going to be able to depend on the users of my > package building boost via cmake (also, is that still an active thing?). > > It seems like the best I could hope for is to generate the package config > file, then hack it up to deal with the boost stuff. Has anyone already > solved this problem or have any tips? I found this Hunter package manager > (https://github.com/ruslo/hunter), but it seems a bit heavyweight when all I > want is boost. Also, I can't have my build system going out and downloading > the packages - they all have to come from an internal source. > > Thanks, > Matt > > > -- > > 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 -- 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
Re: [CMake] What is the best way to handle Boost dependencies in a package config file
On 27-Jan-16 09:54, Johnson, Matt (GE Healthcare) wrote: I like package config files. I want to use more of them. However, I have a dependency on boost. While boost has a Find module, it doesn't have a package config file. I'm not going to be able to depend on the users of my package building boost via cmake (also, is that still an active thing?). It seems like the best I could hope for is to generate the package config file, then hack it up to deal with the boost stuff. Has anyone already solved this problem or have any tips? I found this Hunter package manager (https://github.com/ruslo/hunter), but it seems a bit heavyweight when all I want is boost. -- Also, I can't have my build system going out and downloading the packages - they all have to come from an internal source. Just for your information you can use "file://" links instead of regular "http://; in both hunter.cmake and HunterGate so there is no need to "go out" - you can be completely offline. Ruslo -- 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
[CMake] What is the best way to handle Boost dependencies in a package config file
I like package config files. I want to use more of them. However, I have a dependency on boost. While boost has a Find module, it doesn't have a package config file. I'm not going to be able to depend on the users of my package building boost via cmake (also, is that still an active thing?). It seems like the best I could hope for is to generate the package config file, then hack it up to deal with the boost stuff. Has anyone already solved this problem or have any tips? I found this Hunter package manager (https://github.com/ruslo/hunter), but it seems a bit heavyweight when all I want is boost. Also, I can't have my build system going out and downloading the packages - they all have to come from an internal source. Thanks, Matt -- 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