1. 13
  1.  

  2. 3

    On a high level, what the difference between xmake, CMake, and Makefile? Do they aim to solve different problems, or do they solve the very same problem in different ways?

    1. 3

      xmake = make + package manager + generator

      cmake only is a generator

      1. 1

        I see. From my understanding, package managers reply on an eco-system, so you need to convince others to speak your language, just like CMake requires dependency libraries to provide a FindLibFoo.cmake file. How do you encourage external library maintainers to maintain an additional tool-specific build script for xmake, given that we already have Makefile, apt/yum/pkg-config as a package manager, and CMake/Meson as a generator?

        In other words, what’s the killer feature of xmake to justify the cost of adopting it? Maybe the existing build system is neither convenient nor intuitive, but people have already invested a lot of time to get familiar with it, and they need a really good reason to switch their tooling when their upstream and downstream mostly speak, say, CMake.

        1. 2

          The package management of xmake supports more platforms and can also install C/C++ packages for cross-compilation platforms. At the same time, it also supports semantic versions and distributed repository. Users can quickly build their own private package warehouses or define packages directly in the project.

          While vcpkg has just recently supported version selection, conan’s package management does not seem to support semantic version, for example: zlib >=1.2.11, zlib 1.2.*

          Xmake’s package management and xmake build can be seamlessly integrated, and can support custom configuration installation packages.

          add_requires("ffmpeg", {shared = true, debug = true, configs = {libx264 = true}})
          

          In addition, xmake does not have to persuade users to switch to the xmake package repository, because xmake also supports to install packages from third-party package managers, for example: conan/vcpkg/clib/pacman/brew

          Their integration methods are exactly the same, so for users, they are completely free to choose which repository package to use.

          add_requries("conan::openssl/1.1.1g") - use conan packages
          add_requires("vcpkg::openssl") - use vcpkg packages
          add_requires("pacman::zlib") - use pacman packages
          add_requires("brew::zlib") - use homebrew packages
          add_requires("openssl", "zlib") - use xmake packages
          

          Moreover, xmake will automatically detect whether the required package has been installed on the system first, and if it has been installed, xmake will also use it directly.

          1. 1

            Cool! Can you recommend some tutorials on getting started with xmake? The quick start page is too terse, whereas the paid course is probably outdated considering the rapid development cycle of the project.

            1. 2

              Sorry, there is still a lack of English courses. I think that if you look at a few project examples using xmake, you might get started more quickly.

              Some project examples:

              Then go to the api manual of the xmake document to view the api usage

              Or you can use xmake create test command to create an empty project fastly. see https://xmake.io/#/guide/project_examples