Code Monkey home page Code Monkey logo

Comments (3)

neheb avatar neheb commented on August 16, 2024 1

Yes, pkgconfig is the way

Btw if you want to add cmake support, meson supports these two: https://mesonbuild.com/CMake-module.html#cmakewrite_basic_package_version_file

simple example:

--- a/meson.build
+++ b/meson.build
@@ -10,6 +10,7 @@ distro_install = get_option('distro_install')
 extra_args = []
 
 if distro_install
+    cmake = import('cmake')
     pkg = import('pkgconfig')
 else
     if not get_option('multi-line_entries')
@@ -82,6 +83,11 @@ lib_inih = library('inih',
 if distro_install
     install_headers('ini.h')
 
+    cmake.write_basic_package_version_file(
+      name : 'inih',
+      version : meson.project_version(),
+    )
+
     pkg.generate(lib_inih,
         name : 'inih',
         description : 'simple .INI file parser',
@@ -113,6 +119,11 @@ if get_option('with_INIReader')
     if distro_install
         install_headers('cpp/INIReader.h')
 
+        cmake.write_basic_package_version_file(
+            name : 'INIReader',
+            version : meson.project_version(),
+        )
+
         pkg.generate(lib_INIReader,
             name : 'INIReader',
             description : 'simple .INI file parser for C++',

Would simplify inclusion into CMake/Conan but currently the only option is pkgconfig.

from inih.

benhoyt avatar benhoyt commented on August 16, 2024

@aengusjiang Sorry, I don't plan to do this. I personally don't want to keep up with N different build systems. There's already a Meson config file for Meson. See further discussion at #105 and #97

from inih.

Ryanf55 avatar Ryanf55 commented on August 16, 2024

How do you recommend CMake users consume this library who want to use the package provided by their distribution?

From reading some other docs, it appears we should use the pkgconfig file, which appears to be shipped with most distributions.

https://cmake.org/cmake/help/latest/module/FindPkgConfig.html

from inih.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.