Menu

#92 Export a CMake Config file

Feature Request
closed-out-of-date
nobody
CMake (1)
5
2017-09-03
2016-04-03
alamaison
No

Modern versions of CMake support a better way of finding dependencies,
known as the Config file. It is similar to pkg_config .pc files and is
installed alongside the package. Then clients can just add:

   find_package(EXPAT CONFIG)
   add_executable(foo ...)
   target_link_libraries(foo EXPAT::expat)

The client target will get all the correct include paths and compile
definitions necessary to work with the expat target, automatically.

1 Attachments

Discussion

  • Sebastian Pipping

    Hello alamaison,
    for a quick reply let me say that:

    • There is general interest to work in that direction
    • It could be cool to have the (still primary) autotools build system install such a file, too
    • At least CMake >=3.5.1 comes with /usr/share/cmake/Modules/FindEXPAT.cmake out of the box. How do we best align to that?
     

    Last edit: Sebastian Pipping 2016-04-17
    • Elias Pipping

      Elias Pipping - 2016-04-18

      Cmake 3.5.1 is very recent. But according to

      https://cmake.org/cmake/help/v3.0/module/FindEXPAT.html

      the FindEXPAT.cmake module existed in 3.0.2 already, which is what e.g. current Debian stable ships.

      I'm not sure what cmake's policy is here (do they prefer to move checks downstream and deprecate their own version eventually e.g.?) but assuming they're fine with keeping that check and it works well, it seems to me nothing needs to be done on expat's side.

       
  • Sebastian Pipping

    • status: open --> closed-out-of-date
     
  • Sebastian Pipping

    No reply for more than a year, closing as obsolete.

     

Log in to post a comment.

MongoDB Logo MongoDB