Re: [CMake] Is this the proper way to define a package config?
Robert Dailey wrote: I've skimmed over it, but I haven't seen anything useful in that section. Maybe you can point out what exactly I'm supposed to use from that? Someone has already stated that I should use a find module and not define a package config since I'm not the maintainer of boost, I only need to use it. Are you suggesting the opposite, that I should define a package config as a downstream consumer? Sorry, I guess that link was not so relevant. This has relevant information: http://www.cmake.org/cmake/help/v3.0/manual/cmake-developer.7.html#modules You might be interested in picking up the effort here: http://thread.gmane.org/gmane.comp.programming.tools.cmake.devel/10332/focus=10337 Thanks, Steve. -- 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] Is this the proper way to define a package config?
Robert Dailey wrote: What is the Filters target here? How is it created? Would I just create a target called Boost and configure it as needed? You've read http://www.cmake.org/cmake/help/v3.0/manual/cmake-packages.7.html#creating-packages right? Thanks, Steve. -- 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] Is this the proper way to define a package config?
I've skimmed over it, but I haven't seen anything useful in that section. Maybe you can point out what exactly I'm supposed to use from that? Someone has already stated that I should use a find module and not define a package config since I'm not the maintainer of boost, I only need to use it. Are you suggesting the opposite, that I should define a package config as a downstream consumer? On Sat, Oct 25, 2014 at 1:08 AM, Stephen Kelly steve...@gmail.com wrote: Robert Dailey wrote: What is the Filters target here? How is it created? Would I just create a target called Boost and configure it as needed? You've read http://www.cmake.org/cmake/help/v3.0/manual/cmake-packages.7.html#creating-packages right? Thanks, Steve. -- 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] Is this the proper way to define a package config?
As far as I am aware the Boost find module doesn't support writing out import targets. As far as setting up interface libraries for imported tagets you want to use the IMPORTED_LINK_INTERFACE_LIBRARIES and IMPORTED_LINK_INTERFACE_LIBRARIES_CONFIG properties. Here is an example: set_target_properties(Filters PROPERTIES IMPORTED_LINK_INTERFACE_LIBRARIES_DEBUG Common;/usr/local/lib/libzmq.3.dylib ) Note that Common in this example is another imported target. On Thu, Oct 23, 2014 at 12:53 PM, Robert Dailey rcdailey.li...@gmail.com wrote: Thanks for the reply! Basically the boost library I have is precompiled and in my own unique structure. I do not plan to distribute the CMake scripts I write, they are for personal / internal usage only. You suggested a find module, but will this also generate a custom target for boost? That's important so that when I do target_link_libraries(), I can pass in boost and everything is handled for me. I do not want to be working with libs header files directly in each executable or library I define that has a dependency on boost. Thanks again. On Thu, Oct 23, 2014 at 4:59 AM, Johannes Zarl johannes.z...@jku.at wrote: Hi, Assuming you are not a boost developer / your changes won't be upstreamed, then creating a BoostConfig.cmake file won't do you much good. If someone wants to use your project, he/she will have to patch the locally installed boost version to include a BoostConfig.cmake file. You might want to have a look into the FindBoost[1] module of cmake. XXXConfig.cmake files are intended to be written by the creator of a package, FindXXX.cmake packages are intended as a workaround when a package does not contain an XXXConfig.cmake file and are usually written by a consumer of a package. HTH, Johannes [1] http://www.cmake.org/cmake/help/v3.0/module/FindBoost.html On Friday 17 October 2014 00:18:34 Robert Dailey wrote: I have a local package of boost built on Windows. It is always relative to the root of my project at a consistent structure and location. I wanted to define an import target for this and thought it might be best to define a BoostConfig.cmake package config file at the root of the boost lib directory. Is this the right approach? The code is below. Note that I do not have this working just yet because I don't know how to properly setup the interface link libraries. Could use some guidance here too... thanks. add_library( Boost STATIC IMPORTED GLOBAL ) file( GLOB boost_debug_libs ${CMAKE_CURRENT_LIST_DIR}/lib/win32/debug/*.lib ) file( GLOB boost_release_libs ${CMAKE_CURRENT_LIST_DIR}/lib/win32/release/*.lib ) set_target_properties( Boost PROPERTIES IMPORTED_LOCATION_DEBUG lib/win32/debug IMPORTED_LOCATION_RELEASE lib/win32/release INTERFACE_INCLUDE_DIRECTORIES include INTERFACE_LINK_LIBRARIES $$CONFIG:Debug:${boost_debug_libs} $$CONFIG:Release:${boost_release_libs} ) set( Boost_INCLUDE_DIRS include ) set( Boost_LIBRARIES Boost ) -- 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 -- 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] Is this the proper way to define a package config?
What is the Filters target here? How is it created? Would I just create a target called Boost and configure it as needed? On Fri, Oct 24, 2014 at 2:43 PM, Robert Maynard robert.mayn...@kitware.com wrote: As far as I am aware the Boost find module doesn't support writing out import targets. As far as setting up interface libraries for imported tagets you want to use the IMPORTED_LINK_INTERFACE_LIBRARIES and IMPORTED_LINK_INTERFACE_LIBRARIES_CONFIG properties. Here is an example: set_target_properties(Filters PROPERTIES IMPORTED_LINK_INTERFACE_LIBRARIES_DEBUG Common;/usr/local/lib/libzmq.3.dylib ) Note that Common in this example is another imported target. On Thu, Oct 23, 2014 at 12:53 PM, Robert Dailey rcdailey.li...@gmail.com wrote: Thanks for the reply! Basically the boost library I have is precompiled and in my own unique structure. I do not plan to distribute the CMake scripts I write, they are for personal / internal usage only. You suggested a find module, but will this also generate a custom target for boost? That's important so that when I do target_link_libraries(), I can pass in boost and everything is handled for me. I do not want to be working with libs header files directly in each executable or library I define that has a dependency on boost. Thanks again. On Thu, Oct 23, 2014 at 4:59 AM, Johannes Zarl johannes.z...@jku.at wrote: Hi, Assuming you are not a boost developer / your changes won't be upstreamed, then creating a BoostConfig.cmake file won't do you much good. If someone wants to use your project, he/she will have to patch the locally installed boost version to include a BoostConfig.cmake file. You might want to have a look into the FindBoost[1] module of cmake. XXXConfig.cmake files are intended to be written by the creator of a package, FindXXX.cmake packages are intended as a workaround when a package does not contain an XXXConfig.cmake file and are usually written by a consumer of a package. HTH, Johannes [1] http://www.cmake.org/cmake/help/v3.0/module/FindBoost.html On Friday 17 October 2014 00:18:34 Robert Dailey wrote: I have a local package of boost built on Windows. It is always relative to the root of my project at a consistent structure and location. I wanted to define an import target for this and thought it might be best to define a BoostConfig.cmake package config file at the root of the boost lib directory. Is this the right approach? The code is below. Note that I do not have this working just yet because I don't know how to properly setup the interface link libraries. Could use some guidance here too... thanks. add_library( Boost STATIC IMPORTED GLOBAL ) file( GLOB boost_debug_libs ${CMAKE_CURRENT_LIST_DIR}/lib/win32/debug/*.lib ) file( GLOB boost_release_libs ${CMAKE_CURRENT_LIST_DIR}/lib/win32/release/*.lib ) set_target_properties( Boost PROPERTIES IMPORTED_LOCATION_DEBUG lib/win32/debug IMPORTED_LOCATION_RELEASE lib/win32/release INTERFACE_INCLUDE_DIRECTORIES include INTERFACE_LINK_LIBRARIES $$CONFIG:Debug:${boost_debug_libs} $$CONFIG:Release:${boost_release_libs} ) set( Boost_INCLUDE_DIRS include ) set( Boost_LIBRARIES Boost ) -- 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 -- 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:
Re: [CMake] Is this the proper way to define a package config?
Hi, Assuming you are not a boost developer / your changes won't be upstreamed, then creating a BoostConfig.cmake file won't do you much good. If someone wants to use your project, he/she will have to patch the locally installed boost version to include a BoostConfig.cmake file. You might want to have a look into the FindBoost[1] module of cmake. XXXConfig.cmake files are intended to be written by the creator of a package, FindXXX.cmake packages are intended as a workaround when a package does not contain an XXXConfig.cmake file and are usually written by a consumer of a package. HTH, Johannes [1] http://www.cmake.org/cmake/help/v3.0/module/FindBoost.html On Friday 17 October 2014 00:18:34 Robert Dailey wrote: I have a local package of boost built on Windows. It is always relative to the root of my project at a consistent structure and location. I wanted to define an import target for this and thought it might be best to define a BoostConfig.cmake package config file at the root of the boost lib directory. Is this the right approach? The code is below. Note that I do not have this working just yet because I don't know how to properly setup the interface link libraries. Could use some guidance here too... thanks. add_library( Boost STATIC IMPORTED GLOBAL ) file( GLOB boost_debug_libs ${CMAKE_CURRENT_LIST_DIR}/lib/win32/debug/*.lib ) file( GLOB boost_release_libs ${CMAKE_CURRENT_LIST_DIR}/lib/win32/release/*.lib ) set_target_properties( Boost PROPERTIES IMPORTED_LOCATION_DEBUG lib/win32/debug IMPORTED_LOCATION_RELEASE lib/win32/release INTERFACE_INCLUDE_DIRECTORIES include INTERFACE_LINK_LIBRARIES $$CONFIG:Debug:${boost_debug_libs} $$CONFIG:Release:${boost_release_libs} ) set( Boost_INCLUDE_DIRS include ) set( Boost_LIBRARIES Boost ) -- 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] Is this the proper way to define a package config?
Thanks for the reply! Basically the boost library I have is precompiled and in my own unique structure. I do not plan to distribute the CMake scripts I write, they are for personal / internal usage only. You suggested a find module, but will this also generate a custom target for boost? That's important so that when I do target_link_libraries(), I can pass in boost and everything is handled for me. I do not want to be working with libs header files directly in each executable or library I define that has a dependency on boost. Thanks again. On Thu, Oct 23, 2014 at 4:59 AM, Johannes Zarl johannes.z...@jku.at wrote: Hi, Assuming you are not a boost developer / your changes won't be upstreamed, then creating a BoostConfig.cmake file won't do you much good. If someone wants to use your project, he/she will have to patch the locally installed boost version to include a BoostConfig.cmake file. You might want to have a look into the FindBoost[1] module of cmake. XXXConfig.cmake files are intended to be written by the creator of a package, FindXXX.cmake packages are intended as a workaround when a package does not contain an XXXConfig.cmake file and are usually written by a consumer of a package. HTH, Johannes [1] http://www.cmake.org/cmake/help/v3.0/module/FindBoost.html On Friday 17 October 2014 00:18:34 Robert Dailey wrote: I have a local package of boost built on Windows. It is always relative to the root of my project at a consistent structure and location. I wanted to define an import target for this and thought it might be best to define a BoostConfig.cmake package config file at the root of the boost lib directory. Is this the right approach? The code is below. Note that I do not have this working just yet because I don't know how to properly setup the interface link libraries. Could use some guidance here too... thanks. add_library( Boost STATIC IMPORTED GLOBAL ) file( GLOB boost_debug_libs ${CMAKE_CURRENT_LIST_DIR}/lib/win32/debug/*.lib ) file( GLOB boost_release_libs ${CMAKE_CURRENT_LIST_DIR}/lib/win32/release/*.lib ) set_target_properties( Boost PROPERTIES IMPORTED_LOCATION_DEBUG lib/win32/debug IMPORTED_LOCATION_RELEASE lib/win32/release INTERFACE_INCLUDE_DIRECTORIES include INTERFACE_LINK_LIBRARIES $$CONFIG:Debug:${boost_debug_libs} $$CONFIG:Release:${boost_release_libs} ) set( Boost_INCLUDE_DIRS include ) set( Boost_LIBRARIES Boost ) -- 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] Is this the proper way to define a package config?
Can anyone help me with this? It would be much appreciated. Thank you. On Fri, Oct 17, 2014 at 12:18 AM, Robert Dailey rcdailey.li...@gmail.com wrote: I have a local package of boost built on Windows. It is always relative to the root of my project at a consistent structure and location. I wanted to define an import target for this and thought it might be best to define a BoostConfig.cmake package config file at the root of the boost lib directory. Is this the right approach? The code is below. Note that I do not have this working just yet because I don't know how to properly setup the interface link libraries. Could use some guidance here too... thanks. add_library( Boost STATIC IMPORTED GLOBAL ) file( GLOB boost_debug_libs ${CMAKE_CURRENT_LIST_DIR}/lib/win32/debug/*.lib ) file( GLOB boost_release_libs ${CMAKE_CURRENT_LIST_DIR}/lib/win32/release/*.lib ) set_target_properties( Boost PROPERTIES IMPORTED_LOCATION_DEBUG lib/win32/debug IMPORTED_LOCATION_RELEASE lib/win32/release INTERFACE_INCLUDE_DIRECTORIES include INTERFACE_LINK_LIBRARIES $$CONFIG:Debug:${boost_debug_libs} $$CONFIG:Release:${boost_release_libs} ) set( Boost_INCLUDE_DIRS include ) set( Boost_LIBRARIES Boost ) -- 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