Giter Site home page Giter Site logo

pmm's Introduction

PMM - The Package Manager Manager

PMM is a module for CMake that manages... package managers.

Wha- Why?

People hate installing new software. Especially when they already have a perfectly working tool present. PMM uses the CMake scripting language to manage external packaging tools. PMM will automatically download, install, and control package managers from within your CMake project.

(As you are reading this, only Conan, vcpkg, CMakeCM, and bpt are supported.)

But This is Just Another Tool I have to Manage!

Never fear! PMM is the lowest-maintenance software you will ever use.

How Do I Use PMM?

Using PMM is simple:

  1. Download the pmm.cmake file (available at the top level of this respository), and place it at the top level of your repository (alongside your CMakeLists.txt).
  2. In your CMakeLists.txt, add a line include(pmm.cmake).
  3. Call the pmm() CMake function.

That's it! The pmm.cmake file is just 23 significant lines. Take a look inside if you doubt.

Wait... It's Downloading a Bunch of Stuff!

Precisely! pmm.cmake is just a bootstrapper for the real PMM code, which can be found in the pmm/ directory in the repository. The content is served over HTTPS from the gh-pages branch of the PMM repository, so it is all publicly visible.

I Don't Want to Automatically Download and Run Code from the Internet

Great! I sympathize, but remember: If you run apt, yum, pip, or even conan and vcpkg, you are automatically downloading and running code from the internet. It's all about whose code you trust.

Even still, you can host the PMM code yourself: Download the pmm/ directory as you want it, and modify the pmm.cmake script to download from your alternate location (eg, a corporate engineering intranet server).

Will PMM Updates Silently Break my Build?

Nope. pmm.cmake will never automatically change the version of PMM that it uses, and the files served will never be modified in-place: New versions will be added, but old versions will remain unmodified.

PMM will notify you if a new version is available, but it won't be annoying about it, and you can always disable this nagging by setting PMM_IGNORE_NEW_VERSION before including pmm.cmake.

How do I Change the PMM Version?

There are two ways:

  1. Set PMM_VERSION before including the pmm.cmake script.
  2. Modify the PMM_VERSION_INIT value near the top of pmm.cmake.

Prefer (1) for conditional/temporary version changes, and (2) for permanent version changes.

How do I Change the Download Location for PMM?

For permanent changes, set PMM_URL and/or PMM_URL_BASE in pmm.cmake. For temporary changes, set PMM_URL before including pmm.cmake

The pmm() Function

The only interface to PMM (after including pmm.cmake) is the pmm() CMake function. Using it is very simple. The VERBOSE and DEBUG options enable verbose and debug logging, respectively. You may set PMM_{DEBUG,VERBOSE} before include(pmm.cmake) to enable these options globally and see information about the PMM bootstrapping process.

The pmm() signature:

pmm(
    # Enable verbose logging
    [VERBOSE]
    # Enable debug logging (implies VERBOSE)
    [DEBUG]

    # Use Conan
    [CONAN
        # Set additional --setting flags
        [SETTINGS ...]
        # Set additional --option flags
        [OPTIONS ...]
        # Set environment options
        [ENV ...]
        # Set the --build option. (Default is `missing`)
        [BUILD <policy>]
        # Ensure remotes are present before installing
        [REMOTES [<name>[::no_verify] <url> [...]]]
        # Enable the Bincrafters repository
        [BINCRAFTERS]
        # Tell PMM about additional files that affect the result of 'conan install'
        [INSTALL_DEPENDS ...]
    ]

    # Use vcpkg
    [VCPKG
        # Specify the revision of vcpkg that you want to use (required)
        REVISION <rev>
        # Specify the triplet
        [TRIPLET <triplet>]
        # Ensure the given packages are installed using vcpkg
        [REQUIRES [req [...]]]
        # Copy custom ports to the vcpkg ports directory
        [PORTS [dirpath [...]]]
        # Set port overlay directories
        [OVERLAY_PORTS [dirpath [...]]]
        # Set triplet overlay directories
        [OVERLAY_TRIPLETS [dirpath [...]]]
    ]

    # Use CMakeCM
    [CMakeCM
        # Either use the latest release, or specify a specific base URL to
        # download from
        {ROLLING | FROM <base-url>}
    ]

    # Use bpt
    [BPT
        # Specify a toolchain. Given as the --toolchain argument to `build-deps`.
        # If not specified, one will be generated automatically based on the
        # current CMake settings.
        [TOOLCHAIN <toolchain>]
        # List of dependency files. Given as --deps-file to `build-deps`.
        [DEP_FILES [filepath [...]]]
        # List of dependency specifiers.
        [DEPENDENCIES [dep [...]]]
    ]
)

CONAN PMM mode

In CONAN mode, PMM will install and use Conan to manage project packages.

PMM-Managed Conan

PMM defaults to a "managed Conan" mode, where it will manage a user-local copy of Conan that it will use to perform all tasks. In managed-mode, PMM will ignore any other available Conan installation present on the system. Managed mode requires that you have a Conan-supported version of Python available for use to perform the install.

Conan is installed by invoking pip with a single conan requirement specifier. The default specifier is conan<2, which will cause Pip to install the newest version of Conan less that 2.0. The arguments given to the Pip command can be changed by setting the PMM_CONAN_PIP_INSTALL_ARGS option variable beforing include()-ing pmm.cmake.

To disable managed-mode and use your own Conan version, set PMM_CONAN_MANAGED to FALSE. Then PMM will instead search for a conan executable to use elsewhere. You can specify a specific conan executable by setting the PMM_CONAN_EXECUTABLE variable before including pmm.cmake.

Conan in PMM

PMM will use the cmake Conan generator (or the cmake_multi generator, if you are using a multi-config CMake generator (experimental)) and will define imported targets for consumption (Equivalent of conan_basic_setup(TARGETS)). It will also set CMAKE_PREFIX_PATH and CMAKE_MODULE_PATH for you to use find_package() and include() against the installed dependencies.

NOTE: No other CMake variables from regular Conan usage are defined.

CONAN mode requires a conanfile.txt or conanfile.py in your project source directory. It will run conan install against this file to obtain dependencies for your project.

PMM Will Not do Everything for You

While PMM will ensure that Conan has been executed for you as part of your configure stage, it is up to you to provide a Conanfile that Conan can consume to get your dependency information.

You will still need to read the Conan documentation to understand the basics of how to declare and consume your dependencies.

VCPKG PMM mode

In VCPKG mode, PMM will download the vcpkg repository at the given REVISION, build the vcpkg tool, and manage the package installation in a use-local data directory.

REVISION should be a git tree-ish (A revision number (preferred), branch, or tag) that you could git checkout from the vcpkg repository. PMM will download the specified commit from GitHub and build the vcpkg command line tool from source. You will need std::filesystem or std::experimental::filesystem support from your compiler and standard library.

If you want to copy custom ports to the vcpkg ports folder, you can define PORTS with a list of folders to copy over. You can create port overlay directories and pass them with the OVERLAY_PORTS argument to pmm().

REQUIRES is a list of packages that you would like to install using the vcpkg command line tool.

When using PMM, you do not need to use the vcpkg.cmake CMake toolchain file: PMM will take care of this aspect for you.

After calling pmm(VCPKG), all you need to do is find_package() the packages that you want to use.

CMakeCM PMM mode

If CMakeCM is provided, PMM will download and make available the CMake Community Modules for you project.

Once the pmm() function is run, you may include or find_package any of the modules provided by CMakeCM.

You must also specify either ROLLING or FROM <base-url> to use CMakeCM with PMM:

  • If you specify ROLLING, PMM will download the latest version of the CMakeCM module index every time you configure (with a few minutes of cooldown).
  • If you specify FROM, the module index will only be obtained from the given base URL. Note: This URL is not the URL of a CMakeCM.cmake file: It is a url that prefixes the CMakeCM.cmake module URL.

BPT PMM mode

With BPT, PMM will automatically download and use bpt to install dependencies. This will result in imported targets being defined that you can then link into your project.

Calling pmm(BPT) multiple times is allowed: Each call will append to the set of installed dependencies rather than override it.

The current compile flags, definitions, and include directories will be used to generate a toolchain file automatically if one is not provided.

The value of CMAKE_CXX_COMPILER_LAUNCHER will be given as the compiler launcher in the generated toolchain file. This can be override with PMM_BPT_COMPILER_LAUNCHER, including setting an empty string "" to disable it completely.

NOTE: bpt support is still very experimental, and bpt itself is still in beta at the time of this writing. Refer to the bpt documentation for information about using bpt.

Helper Commands

The pmm.cmake script can be run with -P to access a set of utility subcommands and options. See cmake -P pmm.cmake /Help for options. Additionally, after PMM has run for the first time, it will generate a sh and bat script that can be used to access the same set of options without needing cmake -P pmm.cmake:

Get help with the /Help option:

> pmm-cli.sh /Help

As an example, you can rebuild a Conan package with this command:

> pmm-cli.sh /Conan /Rebuild <package name> /BuildType <Release or Debug>

pmm's People

Contributors

anotherfoxguy avatar azure-pipelines[bot] avatar caseycarter avatar quincunx271 avatar vector-of-bool avatar zesem avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

pmm's Issues

CMake policy CMP0057 warning

Probably due to my recent CMake version (3.12.2) I get a policy warning followed by an error when trying to use PMM:

CMake Warning (dev) at build/_pmm/1.3.1/conan.cmake:558 (if):
  Policy CMP0057 is not set: Support new IN_LIST if() operator.  Run "cmake
  --help-policy CMP0057" for policy details.  Use the cmake_policy command to
  set the policy and suppress this warning.

  IN_LIST will be interpreted as an operator when the policy is set to NEW.
  Since the policy is not set the OLD behavior will be used.
Call Stack (most recent call first):
  build/_pmm/1.3.1/conan.cmake:635 (_conan_ensure_remotes)
  build/_pmm/1.3.1/main.cmake:32 (_pmm_conan)
  build/_pmm/1.3.1/main.cmake:47 (_pmm_project_fn)
  CMakeLists.txt:12 (pmm)
This warning is for project developers.  Use -Wno-dev to suppress it.

CMake Error at build/_pmm/1.3.1/conan.cmake:558 (if):
  if given arguments:

    "NOT" "(" "url" "IN_LIST" "all_urls" ")"

  Unknown arguments specified
Call Stack (most recent call first):
  build/_pmm/1.3.1/conan.cmake:635 (_conan_ensure_remotes)
  build/_pmm/1.3.1/main.cmake:32 (_pmm_conan)
  build/_pmm/1.3.1/main.cmake:47 (_pmm_project_fn)
  CMakeLists.txt:12 (pmm)


-- Configuring incomplete, errors occurred!
See also "/home/benjamin/prog/cmake-template/build/CMakeFiles/CMakeOutput.log".

Adding cmake_policy(SET CMP0057 NEW) at the top of pmm.cmake solves the issue for me.

Clarification requested: "very experimental" dds support

The README, in the section "DDS PMM Mode", says dds support is "very experimental".

Is this just a restating of the fact that dds itself is still in alpha or does it mean that pmm's dds support is even more fragile than that? I.e., the integration itself may have problems.)

(Just looking for a clarification as to how much confidence I should have in it. I'd like to try dds for a new project, but actually I'm more interested in the simplicity of using pmm and will use it with one of the other package managers if that's going to be less painful. I mean, I'm willing to experience a certain amount of pain alpha-testing dds - but starting new with both pmm and dds and having problems with the integration too is probably a step too far for me at this time.)

VCPKG does not find installed packages

pmm does manage packages correctly but does not import the packages correctly. I have to add manually the VCPKG toolchain file when calling cmake for it to find packages properly. This is the error it throws, so it does call vcpkg.cmake....

CMake Error at C:/Users/.../AppData/Local/pmm/2.1.0/vcpkg-2023.02.24/scripts/buildsystems/vcpkg.cmake:846 (_find_package):
  Could not find a package configuration file provided by "Protobuf" with any
  of the following names:

    ProtobufConfig.cmake
    protobuf-config.cmake

  Add the installation prefix of "Protobuf" to CMAKE_PREFIX_PATH or set
  "Protobuf_DIR" to a directory containing one of the above files.  If
  "Protobuf" provides a separate development package or SDK, be sure it has
  been installed.
Call Stack (most recent call first):
  CMakeLists.txt:48 (find_package)

XDG_DATA_HOME not used

main.cmake tests if the XDG_DATA_HOME environment variable is defined, but uses an incorrect syntax. As pointed out in https://cmake.org/cmake/help/latest/variable/ENV.html, to test for an env variable, the syntax if(DEFINED ENV{<name>}) is used. So that's:

elseif(DEFINED ENV{XDG_DATA_HOME})

This probably affects other locations in PMM where env vars are used.

conan 1.40.4 will not build due to upstream breakage; need to set minimum version to at least 1.46.0

The package markupsafe, upstream from Conan, took a breaking change in a minor version - apparently they don't believe in semantic versioning over there - and that has broken Conan 1.40.4, specified here as the minimum therefore default downloaded+built Conan.

Fixed in Conan 1.46.0.

With 1.46.0 specified as minimum in conan.cmake, pmm now builds Conan in Ubuntu 20.04 (actually, WSL). (Didn't actually try it however.) However, it doesn't build in Windows 10.0.22000.588 in either a VS2019 or VS2022 dev command prompt. So I don't know if this is the newer Conan version's problem or not, so I didn't submit a (one-line) PR for this.

In the VS2022 window pmm's build complains as follows:

-- [pmm] [debug  ] Executing command: "C:/Program Files/Microsoft Visual Studio/2022/Preview/Common7/IDE/CommonExtensions/Microsoft/CMake/CMake/bin/cmake.exe" -E env CONAN_LIBMAN_FOR=cmake C:/Users/David/AppData/Local/pmm/2.0.0/conan/venvs/72a46e/Scripts/conan.exe install R:/3rd/libs/c++-utilities/vector-of-bool/pmm --profile R:/3rd/libs/c++-utilities/vector-of-bool/pmm/build-vs2022/pmm-conan-Debug.profile --generator cmake_multi --build missing WORKING_DIRECTORY R:/3rd/libs/c++-utilities/vector-of-bool/pmm/build-vs2022 NO_EAT_OUTPUT
Auto detecting your dev setup to initialize the default profile (C:\Users\David\.conan\profiles\default)
Found Visual Studio 17
Found gcc 8.3
Found clang 13.0
Default settings
        os=Windows
        os_build=Windows
        arch=x86_64
        arch_build=x86_64
        compiler=Visual Studio
        compiler.version=17
        build_type=Release
*** You can change them in C:\Users\David\.conan\profiles\default ***
*** Or override with -s compiler='other' -s ...s***


ERROR: Invalid setting 'os=Windows' is not a valid 'settings.compiler.version' value.
Possible values are ['8', '9', '10', '11', '12', '14', '15', '16', '17']
Read "http://docs.conan.io/en/latest/faq/troubleshooting.html#error-invalid-setting"
CMake Error at build-vs2022/_pmm/2.0.0/conan.cmake:584 (message):
  Conan install failed [1]:

Call Stack (most recent call first):
  build-vs2022/_pmm/2.0.0/conan.cmake:610 (_pmm_conan_run_install)
  build-vs2022/_pmm/2.0.0/conan.cmake:795 (_pmm_conan_install)
  build-vs2022/_pmm/2.0.0/main.cmake:41 (_pmm_conan)
  build-vs2022/_pmm/2.0.0/main.cmake:62 (_pmm_project_fn)
  CMakeLists.txt:10 (pmm)


-- Configuring incomplete, errors occurred!

In the VS2019 window pmm's build complains as follows:

Found Visual Studio 16
Found gcc 8.3
Found clang 12.0
Default settings
        os=Windows
        os_build=Windows
        arch=x86_64
        arch_build=x86_64
        compiler=Visual Studio
        compiler.version=16
        build_type=Release
*** You can change them in C:\Users\David\.conan\profiles\default ***
*** Or override with -s compiler='other' -s ...s***


Configuration:
[settings]
arch=x86_64
arch_build=x86_64
build_type=Debug
compiler=Visual Studio
compiler.runtime=MDd
compiler.version=16
os=Windows
os_build=Windows
[options]
[build_requires]
[env]
CC=C:/Program Files (x86)/Microsoft Visual Studio/2019/Professional/VC/Tools/MSVC/14.29.30133/bin/Hostx64/x64/cl.exe
CXX=C:/Program Files (x86)/Microsoft Visual Studio/2019/Professional/VC/Tools/MSVC/14.29.30133/bin/Hostx64/x64/cl.exe
conanfile.py (pmm/2.0.0): Installing package
Requirements
Packages

Installing (downloading, building) binaries...
conanfile.py (pmm/2.0.0): Generator cmake created conanbuildinfo.cmake
conanfile.py (pmm/2.0.0): Generator txt created conanbuildinfo.txt
conanfile.py (pmm/2.0.0): ERROR: Generator cmake_multi(file:None) failed
'settings.build_type' doesn't exist
'settings' possible configurations are none
ERROR: 'settings.build_type' doesn't exist
'settings' possible configurations are none
CMake Error at build-vs2019/_pmm/2.0.0/conan.cmake:584 (message):
  Conan install failed [1]:

Call Stack (most recent call first):
  build-vs2019/_pmm/2.0.0/conan.cmake:610 (_pmm_conan_run_install)
  build-vs2019/_pmm/2.0.0/conan.cmake:795 (_pmm_conan_install)
  build-vs2019/_pmm/2.0.0/main.cmake:41 (_pmm_conan)
  build-vs2019/_pmm/2.0.0/main.cmake:62 (_pmm_project_fn)
  CMakeLists.txt:10 (pmm)

(These builds were done right in a clone of the pmm repo.)

Add a VERBOSE or DEBUG option

It would be helpful if pmm(...) had a VERBOSE or DEBUG option so that it would output the executed processes before executing them:

pmm(CONAN VERBOSE)

(when configuring cmake):

...
-- [pmm] Installing Conan requirements from /path/to/conanfile.txt
-- [pmm] conan install /path/to/conanfile.txt -s ... -o ...
...

This would help in understanding what pmm is doing under the hood.

Consider adding some concrete examples

First of all, awesome idea and project! This has really streamlined the build and package management process for me.

This may be due to me being somewhat new to using CMAKE and VCPKG , but I found it more difficult than I thought it should have been to get PMM up and running with VCPKG and CMAKE the first time around. After getting a sample project working once, I can see how easy the configuration is, and how much this could simplify distribution.

Maybe consider adding at least one concrete sample project that uses PMM that a new user can clone and build within minutes, to remove any potential roadblocks they may face, and improve the adoption rate. I created such a project, ariveron/boilerplate-pmm-vcpkg-cmake, for myself. Feel free to use my project or any part of it, with or without attribution, if you wish.

I think the PMM project deserves more stars and mentions. I hope more people start using it. Thank you for creating it.

Local, project-specific vcpkg installation

What if I desired to download a vcpkg installation into a specific project directory, rather than a user-wide location? That way each project can have a self-contained vcpkg repository of sorts, allowing the user to easily control/remove it on a per-project basis. This may be more user-friendly than installing yet another user/system wide package manager, hidden away in local directories.

Does PMM have this sort of functionality, or is it not supported?

Allow Conan settings and options to be set with `-DPMM_CONAN_SETTINGS/OPTIONS`

It would be nice to merge the SETTINGS and OPTIONS arguments of pmm(CONAN ...) with cache variables settable from cmake -D.... I'm proposing PMM_CONAN_SETTINGS and PMM_CONAN_OPTIONS.

These would enable the user to pass other settings and options to conan without modifying the CMakeLists.txt, which is desirable because it enables specifying options such as whether to compile with asan. Currently, if the project maintainer wants to enable that, they have to explicitly add it to the pmm(CONAN ...) call.

PMM Conan virtualenv directory will exist if python3-venv was not installed

I forgot to install python3-venv, which PMM suggested that I do in the resulting error message. However, upon re-running the configure step, I was greeted with this warning:

CMake Warning at build/GCC 10.2.0-Debug/_pmm/1.5.1/conan.cmake:209 (message):
  There exists a PMM Conan virtualenv directory
  (...), but we did not
  find a Conan executable inside it.  This is very unexpected...

This is harmless, but the wording of the warning suggested to me that perhaps this case wasn't thought of. If it is possible, it might be good to avoid this warning message in this case.

Building catch fails

It seems that building [email protected] via PMM fails.

CMakeLists.txt:

cmake_minimum_required(VERSION 3.15)
project(MyProject)

include(pmm.cmake)
pmm(DDS DEPENDS [email protected])

add_library(mylib mylib.cpp)

mylib.cpp:

#include <vector>

std::vector<int> name() {
	return {1,2};
}

Trying to build this, I get following errors:

d:\dev\testbed\cmake-pmm>mkdir build

d:\dev\testbed\cmake-pmm>cd build

d:\dev\testbed\cmake-pmm\build>cmake --version
cmake version 3.24.0-rc3

CMake suite maintained and supported by Kitware (kitware.com/cmake).

d:\dev\testbed\cmake-pmm\build>cmake ..
-- Building for: Visual Studio 16 2019
-- Selecting Windows SDK version 10.0.19041.0 to target Windows 10.0.19044.
-- The C compiler identification is MSVC 19.29.30130.2
-- The CXX compiler identification is MSVC 19.29.30130.2
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: C:/Program Files (x86)/Microsoft Visual Studio/2019/Preview/VC/Tools/MSVC/14.29.30130/bin/Hostx64/x64/cl.exe - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: C:/Program Files (x86)/Microsoft Visual Studio/2019/Preview/VC/Tools/MSVC/14.29.30130/bin/Hostx64/x64/cl.exe - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- [pmm] [warn   ] The DDS subcommand is being replaced with BPT! Update soon!
-- [pmm] [warn   ] Using pmm+bpt with multi-conf builds is not yet fully supported.
[info ] Loading 1 dependencies
[info ] Dependency: [email protected]
[info ] NOTE: A prior version of the project build database was found.
[info ] This is not an error, but incremental builds will be invalidated.
[info ] The database is being upgraded, and no further action is necessary.
[info ] [catch2/catch2] Compile: catch2\catch_approx.cpp
[info ] [catch2/catch2] Compile: catch2\catch_assertion_result.cpp
[info ] [catch2/catch2] Compile: catch2\benchmark\detail\catch_stats.cpp
[info ] [catch2/catch2] Compile: catch2\benchmark\internal\catch_benchmark_combined_tu.cpp
[info ] [catch2/catch2] Compile: catch2\catch_config.cpp
[info ] [catch2/catch2] Compile: catch2\catch_message.cpp
[info ] [catch2/catch2] Compile: catch2\catch_assertion_result.cpp   -     332ms [ 3/66]
[info ] [catch2/catch2] Compile: catch2\benchmark\detail\catch_stats.cpp -     332ms [ 2/66]
[info ] [catch2/catch2] Compile: catch2\catch_approx.cpp             -     332ms [ 1/66]
[error] Compilation failed: C:\Users\vid\AppData\Local\dds\pkg\[email protected]\src\catch2\catch_assertion_result.cpp
[error] Compilation failed: C:\Users\vid\AppData\Local\dds\pkg\[email protected]\src\catch2\benchmark\detail\catch_stats.cpp
[info ] [catch2/catch2] Compile: catch2\benchmark\internal\catch_benchmark_combined_tu.cpp -     332ms [ 4/66]
[error] Compilation failed: C:\Users\vid\AppData\Local\dds\pkg\[email protected]\src\catch2\catch_approx.cpp
[info ] [catch2/catch2] Compile: catch2\catch_config.cpp             -     332ms [ 5/66]
[error] Subcommand FAILED [Exited 2]: "C:/Program Files (x86)/Microsoft Visual Studio/2019/Preview/VC/Tools/MSVC/14.29.30130/bin/Hostx64/x64/cl.exe" /MD /EHsc /nologo /permissive- /I "C:\Users\vid\AppData\Local\dds\pkg\[email protected]\src" /showIncludes /c "C:\Users\vid\AppData\Local\dds\pkg\[email protected]\src\catch2\catch_assertion_result.cpp" "/FoD:\dev\testbed\cmake-pmm\build\_deps\[email protected]\obj\catch2\catch_assertion_result.cpp.obj" /DWIN32 /D_WINDOWS /GR /EHsc
Note: including file: C:\Users\vid\AppData\Local\dds\pkg\[email protected]\src\catch2/catch_assertion_result.hpp
C:\Users\vid\AppData\Local\dds\pkg\[email protected]\src\catch2/catch_assertion_result.hpp(11): fatal error C1083: Cannot open include file: 'string': No such file or directory

[error] Compilation failed: C:\Users\vid\AppData\Local\dds\pkg\[email protected]\src\catch2\catch_config.cpp
[error] Subcommand FAILED [Exited 2]: "C:/Program Files (x86)/Microsoft Visual Studio/2019/Preview/VC/Tools/MSVC/14.29.30130/bin/Hostx64/x64/cl.exe" /MD /EHsc /nologo /permissive- /I "C:\Users\vid\AppData\Local\dds\pkg\[email protected]\src" /showIncludes /c "C:\Users\vid\AppData\Local\dds\pkg\[email protected]\src\catch2\benchmark\detail\catch_stats.cpp" "/FoD:\dev\testbed\cmake-pmm\build\_deps\[email protected]\obj\catch2\benchmark\detail\catch_stats.cpp.obj" /DWIN32 /D_WINDOWS /GR /EHsc
Note: including file: C:\Users\vid\AppData\Local\dds\pkg\[email protected]\src\catch2/benchmark/detail/catch_stats.hpp
Note: including file:  C:\Users\vid\AppData\Local\dds\pkg\[email protected]\src\catch2/benchmark/catch_estimate.hpp
Note: including file:  C:\Users\vid\AppData\Local\dds\pkg\[email protected]\src\catch2/benchmark/catch_outlier_classification.hpp
C:\Users\vid\AppData\Local\dds\pkg\[email protected]\src\catch2/benchmark/detail/catch_stats.hpp(16): fatal error C1083: Cannot open include file: 'algorithm': No such file or directory

[error] Subcommand FAILED [Exited 2]: "C:/Program Files (x86)/Microsoft Visual Studio/2019/Preview/VC/Tools/MSVC/14.29.30130/bin/Hostx64/x64/cl.exe" /MD /EHsc /nologo /permissive- /I "C:\Users\vid\AppData\Local\dds\pkg\[email protected]\src" /showIncludes /c "C:\Users\vid\AppData\Local\dds\pkg\[email protected]\src\catch2\catch_approx.cpp" "/FoD:\dev\testbed\cmake-pmm\build\_deps\[email protected]\obj\catch2\catch_approx.cpp.obj" /DWIN32 /D_WINDOWS /GR /EHsc
Note: including file: C:\Users\vid\AppData\Local\dds\pkg\[email protected]\src\catch2/catch_approx.hpp
Note: including file:  C:\Users\vid\AppData\Local\dds\pkg\[email protected]\src\catch2/catch_tostring.hpp
C:\Users\vid\AppData\Local\dds\pkg\[email protected]\src\catch2/catch_tostring.hpp(12): fatal error C1083: Cannot open include file: 'vector': No such file or directory

[error] Subcommand FAILED [Exited 2]: "C:/Program Files (x86)/Microsoft Visual Studio/2019/Preview/VC/Tools/MSVC/14.29.30130/bin/Hostx64/x64/cl.exe" /MD /EHsc /nologo /permissive- /I "C:\Users\vid\AppData\Local\dds\pkg\[email protected]\src" /showIncludes /c "C:\Users\vid\AppData\Local\dds\pkg\[email protected]\src\catch2\catch_config.cpp" "/FoD:\dev\testbed\cmake-pmm\build\_deps\[email protected]\obj\catch2\catch_config.cpp.obj" /DWIN32 /D_WINDOWS /GR /EHsc
Note: including file: C:\Users\vid\AppData\Local\dds\pkg\[email protected]\src\catch2/catch_config.hpp
Note: including file:  C:\Users\vid\AppData\Local\dds\pkg\[email protected]\src\catch2/catch_test_spec.hpp
Note: including file:   C:\Users\vid\AppData\Local\dds\pkg\[email protected]\src\catch2/internal/catch_unique_ptr.hpp
C:\Users\vid\AppData\Local\dds\pkg\[email protected]\src\catch2/internal/catch_unique_ptr.hpp(11): fatal error C1083: Cannot open include file: 'cassert': No such file or directory

[error] Compilation failed: C:\Users\vid\AppData\Local\dds\pkg\[email protected]\src\catch2\benchmark\internal\catch_benchmark_combined_tu.cpp
[info ] [catch2/catch2] Compile: catch2\catch_message.cpp            -     225ms [ 6/66]
[error] Compilation failed: C:\Users\vid\AppData\Local\dds\pkg\[email protected]\src\catch2\catch_message.cpp
[error] Subcommand FAILED [Exited 2]: "C:/Program Files (x86)/Microsoft Visual Studio/2019/Preview/VC/Tools/MSVC/14.29.30130/bin/Hostx64/x64/cl.exe" /MD /EHsc /nologo /permissive- /I "C:\Users\vid\AppData\Local\dds\pkg\[email protected]\src" /showIncludes /c "C:\Users\vid\AppData\Local\dds\pkg\[email protected]\src\catch2\benchmark\internal\catch_benchmark_combined_tu.cpp" "/FoD:\dev\testbed\cmake-pmm\build\_deps\[email protected]\obj\catch2\benchmark\internal\catch_benchmark_combined_tu.cpp.obj" /DWIN32 /D_WINDOWS /GR /EHsc
Note: including file: C:\Users\vid\AppData\Local\dds\pkg\[email protected]\src\catch2/benchmark/catch_chronometer.hpp
Note: including file:  C:\Users\vid\AppData\Local\dds\pkg\[email protected]\src\catch2/benchmark/catch_clock.hpp
C:\Users\vid\AppData\Local\dds\pkg\[email protected]\src\catch2/benchmark/catch_clock.hpp(13): fatal error C1083: Cannot open include file: 'chrono': No such file or directory

[error] Subcommand FAILED [Exited 2]: "C:/Program Files (x86)/Microsoft Visual Studio/2019/Preview/VC/Tools/MSVC/14.29.30130/bin/Hostx64/x64/cl.exe" /MD /EHsc /nologo /permissive- /I "C:\Users\vid\AppData\Local\dds\pkg\[email protected]\src" /showIncludes /c "C:\Users\vid\AppData\Local\dds\pkg\[email protected]\src\catch2\catch_message.cpp" "/FoD:\dev\testbed\cmake-pmm\build\_deps\[email protected]\obj\catch2\catch_message.cpp.obj" /DWIN32 /D_WINDOWS /GR /EHsc
Note: including file: C:\Users\vid\AppData\Local\dds\pkg\[email protected]\src\catch2/catch_message.hpp
Note: including file:  C:\Users\vid\AppData\Local\dds\pkg\[email protected]\src\catch2/internal/catch_result_type.hpp
Note: including file:  C:\Users\vid\AppData\Local\dds\pkg\[email protected]\src\catch2/internal/catch_common.hpp
Note: including file:   C:\Users\vid\AppData\Local\dds\pkg\[email protected]\src\catch2/internal/catch_compiler_capabilities.hpp
Note: including file:    C:\Users\vid\AppData\Local\dds\pkg\[email protected]\src\catch2/internal/catch_platform.hpp
Note: including file:   C:\Users\vid\AppData\Local\dds\pkg\[email protected]\src\catch2/internal/catch_stringref.hpp
C:\Users\vid\AppData\Local\dds\pkg\[email protected]\src\catch2/internal/catch_stringref.hpp(11): fatal error C1083: Cannot open include file: 'cstddef': No such file or directory

[error] Compilation failed [C:\Users\vid\AppData\Local\dds\pkg\[email protected]\src\catch2\catch_approx.cpp]
[error] Compilation failed [C:\Users\vid\AppData\Local\dds\pkg\[email protected]\src\catch2\benchmark\detail\catch_stats.cpp]
[error] Compilation failed [C:\Users\vid\AppData\Local\dds\pkg\[email protected]\src\catch2\catch_assertion_result.cpp]
[error] Compilation failed [C:\Users\vid\AppData\Local\dds\pkg\[email protected]\src\catch2\catch_config.cpp]
[error] Compilation failed [C:\Users\vid\AppData\Local\dds\pkg\[email protected]\src\catch2\benchmark\internal\catch_benchmark_combined_tu.cpp]
[error] Compilation failed [C:\Users\vid\AppData\Local\dds\pkg\[email protected]\src\catch2\catch_message.cpp]
[error] Source compilation failed.
[error]
Source compilation failed. Refer to the compiler output.

[error] Refer: https://vector-of-bool.github.io/docs/dds/err/compile-failure.html
CMake Error at build/_pmm/2.1.0/dds.cmake:298 (message):
  DDS failed to build our dependencies [1]
Call Stack (most recent call first):
  build/_pmm/2.1.0/main.cmake:55 (_pmm_dds)
  build/_pmm/2.1.0/main.cmake:66 (_pmm_project_fn)
  CMakeLists.txt:5 (pmm)


-- Configuring incomplete, errors occurred!
See also "D:/dev/testbed/cmake-pmm/build/CMakeFiles/CMakeOutput.log".

Note that this doesn't seem to be problem with the C++ toolchain or CMake. When I remove the pmm(...) call from CMakeList, I can build the example correctly. C++ headers are located correctly:

d:\dev\testbed\cmake-pmm\build>type ..\CMakeLists.txt
cmake_minimum_required(VERSION 3.15)
project(MyProject)

include(pmm.cmake)
#pmm(DDS DEPENDS [email protected])

add_library(mylib mylib.cpp)

d:\dev\testbed\cmake-pmm\build>cmake ..
-- Selecting Windows SDK version 10.0.19041.0 to target Windows 10.0.19044.
-- Configuring done
-- Generating done
-- Build files have been written to: D:/dev/testbed/cmake-pmm/build

d:\dev\testbed\cmake-pmm\build>cmake --build .
Microsoft (R) Build Engine version 16.11.0-preview-21302-05+5e37cc992 for .NET Framework
Copyright (C) Microsoft Corporation. All rights reserved.

  Building Custom Rule D:/dev/testbed/cmake-pmm/CMakeLists.txt
  mylib.cpp
  mylib.vcxproj -> D:\dev\testbed\cmake-pmm\build\Debug\mylib.lib
  Building Custom Rule D:/dev/testbed/cmake-pmm/CMakeLists.txt

d:\dev\testbed\cmake-pmm\build>dir /b Debug
mylib.lib
mylib.pdb

Race condition on file when generating multiple configurations simultaneously

In certain situations (using CMake profiles of CLion for example), there are two cmake processes running and sourcing the pmm files. More often than not, one of the configurations succeed and the others fails on line 49 of entry.cmake:

file(RENAME "${tmp}" "${dest}")

Maybe a lock file would mitigate this issue?

Comparison with cpm-cmake/CPM.cmake

At first glance it is rather difficult to judge the differences between this project and CPM, which is currently more popular. So whenever possible, can a comparison with that be documented? Mostly I think it would be helpful to point out:

  • Differences in targets and philosophy. E.g. CPM is strictly aimed at downloading cmake based projects, and it does not aim to create any central repository of this. As I understand pmm aims at bridging with other projects as well and also make a more centralized repository of cmake projects.
  • Differences in syntax and options. E.g. in CPM you can directly pass the cmake options to the dependent when you add it to the project, you can prioritize system installed packages, etc. How do you do similar actions in ppm?
  • Differences in implementations. CPM is a single-file cmake dependency, that you can add it either manually or using an automatic function.
  • Differences in features.

Infinite recursion for VCPKG in nested pmm projects

First of all, this is an excellent manager for easing up the setup time for new projects. Thanks a million!
As i've continued on using this, I've encounted a bug for when I have two dependencies that uses PMM.
The first library executes fine, while the second library gets the following error:

CMake Error at /home/per/.local/share/pmm/2.0.0/vcpkg-2022.03.10/scripts/buildsystems/vcpkg.cmake:722 (set):
  Maximum recursion depth of 1000 exceeded
Call Stack (most recent call first):
  /home/per/.local/share/pmm/2.0.0/vcpkg-2022.03.10/scripts/buildsystems/vcpkg.cmake:800 (_find_package)
  /home/per/.local/share/pmm/2.0.0/vcpkg-2022.03.10/scripts/buildsystems/vcpkg.cmake:800 (_find_package)
  /home/per/.local/share/pmm/2.0.0/vcpkg-2022.03.10/scripts/buildsystems/vcpkg.cmake:800 (_find_package)
  /home/per/.local/share/pmm/2.0.0/vcpkg-2022.03.10/scripts/buildsystems/vcpkg.cmake:800 (_find_package)
  /home/per/.local/share/pmm/2.0.0/vcpkg-2022.03.10/scripts/buildsystems/vcpkg.cmake:800 (_find_package)
  /home/per/.local/share/pmm/2.0.0/vcpkg-2022.03.10/scripts/buildsystems/vcpkg.cmake:800 (_find_package)
  /home/per/.local/share/pmm/2.0.0/vcpkg-2022.03.10/scripts/buildsystems/vcpkg.cmake:800 (_find_package)
  /home/per/.local/share/pmm/2.0.0/vcpkg-2022.03.10/scripts/buildsystems/vcpkg.cmake:800 (_find_package)

I've tracked this down to the following line: https://github.com/vector-of-bool/pmm/blob/develop/pmm/vcpkg.cmake#L265
I've tried to remove the line, which seemingly fixes it. And also, removed the PARENT_SCOPE flag works.
However, I have no idea on what this is actually doing, so I dont dare to propose this as an fix.

Is this possibly something you could provide a fix for?

Thanks!

PMM and VCPKG cannot find package directory

I'm trying out the pmm tool to add libraries to my project. I've opt'ed for the VCPKG variant. pmm installs fine, packages are installed, but then the cmake command find_package(x), says it cannot find the package. After hours of fiddling around, I found where the packages are getting installed and manually added the path to cmake. This works, but of course it's very dissatisfying because I am not sure how universal this path would be. How can I make this work without providing that path? Or is this path always needed and I have not fully understood the documentation? Any insight would be much appreciated. Here is my CMakeLists.txt:

cmake_minimum_required(VERSION 3.10)
project(pmmAndVcpkg VERSION 0.0.0)

set(VCPKG_REV 2022.05.10)

include(pmm.cmake)
pmm(
    VCPKG
    REVISION ${VCPKG_REV}
    REQUIRES fmt
)

# WHY DO I NEED THIS SECTION????
################################

set(VCPKG_PATH $ENV{HOME}/.local/share/pmm/${PMM_VERSION_INIT}/vcpkg-${VCPKG_REV}/packages)

set(CMAKE_MODULE_PATH ${CMAKE_BINARY_DIR} ${VCPKG_PATH} ${CMAKE_MODULE_PATH})
set(CMAKE_PREFIX_PATH ${CMAKE_BINARY_DIR} ${VCPKG_PATH} ${CMAKE_PREFIX_PATH})
################################

find_package(fmt CONFIG REQUIRED)

add_executable(main main.cpp)

target_link_libraries(main PRIVATE fmt)

Apart from this file I only added the pmm.cmake file as required, and a main.cpp file to assert I can link to the library.

pmm(CONAN) doesn't respect CMAKE_BUILD_TYPE

pmm(CONAN) doesn't seem to grab the CMAKE_BUILD_TYPE in order to send -s build_type=Foo to conan.

This causes issues when trying to use MSVC, since MSVC is not ABI compatible across build configurations

Conan: cross compilation settings

Conan has some settings for cross compiling: https://docs.conan.io/en/latest/systems_cross_building/cross_building.html (full settings reference). We should see if we can set the *_build settings.

The *_build settings correspond to CMake's *_HOST_* settings. Note that Conan uses "host" to refer to the target machine, the machine we are building for. It uses "build" to refer to the host machine, the machine we are building on.

We can get information on the os_build from CMAKE_HOST_SYSTEM_NAME. There's no CMAKE_ARCH_SIZEOF_VOID_P, but maybe we can get this information from CMAKE_HOST_SYSTEM_PROCESSOR.

Allow Custom Ports

In the development of various of libraries, I end up with ports that are too unstable to be merge to upstream vcpkg (due to them needing to be changed multiple times a day). It would be great if pmm could offer a way to specify a custom ports folder and it would merge the ports from upstream vcpkg with the custom ones supplied. I haven't taken too good of a look yet on what would need to happen to make that work, but logically it shouldn't be too difficult, though knowing cmake, doing a recursive merge may be difficult.

Add support for cmake_multi generator

The cmake_multi generator would be useful for builds using Visual Studio

The official Conan cmake wrapper (https://github.com/conan-io/cmake-conan) has support for it.

Workflow

  1. Set the generator to cmake_multi (https://github.com/conan-io/cmake-conan/blob/develop/conan.cmake#L335-L339)
  2. Install both Debug and Release dependencies. (https://github.com/conan-io/cmake-conan/blob/develop/conan.cmake#L476-L483)
  3. Load the build info from conanbuildinfo_multi.cmake instead of conanbuildinfo.cmake (https://github.com/conan-io/cmake-conan/blob/develop/conan.cmake#L442-L446)

Question: Influence build type (Visual Studio)

Just played around with the project for the first time. Looks really promising!

One thing I would like to ask is what the best way to influence the build type for a Visual Studio build is? I did the following:

  • added pmm.cmake (version 1.3.1)
  • adjusted CMakeLists.txt:
include(pmm.cmake)
pmm(CONAN)
  • Ran cmake -G "Visual Studio 15 2017 Win64" ..\MyProject
  • The settings used by pmm for the conan install were:
[settings]
arch=x86_64
compiler=Visual Studio
compiler.runtime=MD
compiler.version=15
os=Windows
  • I'm currently only interested in a Debug build though. What would I need to change to achieve that? I have added SETTINGS "build_type=Debug" to the pmm call and that works. However, it does not seem to be the ideal solution that every developer that wants a different build type has to change the project file?

conan has inconsistent permitted values for settings.compiler.version for clang - pmm fails

Environment

  • pmm 1.5.1
  • clang 11.0

Problem

When setting my compiler to clang 11.0, conan install fails with the following error:

[cmake] ERROR: Invalid setting '11.0' is not a valid 'settings.compiler.version' value.
[cmake] Possible values are ['10', '11', '3.3', '3.4', '3.5', '3.6', '3.7', '3.8', '3.9', '4.0', '5.0', '6.0', '7.0', '7.1', '8', '9']

Why this happens

pmm conveniently creates a conan profile for me, but always sets compiler.version to <major>.<minor>. However, as you can see in the conan output above, 11.0 is not a valid value.

How we could possibly fix it

Obviously this isn't your fault, conan is just inconsistent with their permitted values (maybe they follow some guideline set by clang itself, I don't know tbh), but maybe we can work around this issue.

I think it wouldn't do any harm stealing the list of allowed values from conan, checking if <major>.<minor> is inside and if it isn't, trying again with <major> (provided that <minor> is zero of course).

Thanks for making this awesome integration!

PMM_VCPKG_EXECUTABLE wrong

Hi thanks for this cool project.
I use this in a project without problems. Recently I tried to cross compile the project, but it fails because in vcpkg mode pmm uses CMAKE_EXECUTABLE_SUFFIX to determine the path of the vcpkg executable, which is not necessarily the system executable.

How to run conan given a pmm-managed repo?

I'm trying to get the pitchfork repo to build. It is using conan. Apparentliy it's conanfile.py is way out of date. I don't understand conan yet, but I see the following error and:

  • I don't know how to run conan though it says "you may need to run conan manually (from the build directory)". No conan is found anywhere (i.e., using which). (or Conan)
    • For example, I'd like to add a remote using conan remote add bincrafters https://api.bintray.com/conan/bincrafters/public-conan
-- [pmm] Installing Conan requirements from /mnt/r/BBits/pitchfork/conanfile.py
Configuration:
[settings]
arch=x86
build_type=Debug
compiler=gcc
compiler.libcxx=libstdc++11
compiler.version=9
cppstd=17
os=Linux
[options]
[build_requires]
[env]
CC=/usr/bin/cc
CXX=/usr/bin/c++
Catch2/2.13.8@catchorg/stable: Not found in local cache, looking in remotes...
Catch2/2.13.8@catchorg/stable: Trying with 'conancenter'...
ERROR: Failed requirement 'Catch2/2.13.8@catchorg/stable' from 'conanfile.py (pf/0.1.0)'
ERROR: Unable to find 'Catch2/2.13.8@catchorg/stable' in remotes
CMake Error at build/_pmm/1.3.1/conan.cmake:470 (message):
  Conan install failed [1]:

Call Stack (most recent call first):
  build/_pmm/1.3.1/conan.cmake:495 (_pmm_conan_install_1)
  build/_pmm/1.3.1/conan.cmake:643 (_pmm_conan_install)
  build/_pmm/1.3.1/main.cmake:32 (_pmm_conan)
  build/_pmm/1.3.1/main.cmake:47 (_pmm_project_fn)
  CMakeLists.txt:32 (pmm)


CMake Error at build/_pmm/1.3.1/conan.cmake:500 (message):
  Conan dependencies were not imported (Expected file
  /mnt/r/BBits/pitchfork/build/conanbuildinfo.cmake).  You may need to run
  Conan manually (from the build directory).  Ensure you are using the
  'cmake' generator.
Call Stack (most recent call first):
  build/_pmm/1.3.1/conan.cmake:643 (_pmm_conan_install)
  build/_pmm/1.3.1/main.cmake:32 (_pmm_conan)
  build/_pmm/1.3.1/main.cmake:47 (_pmm_project_fn)
  CMakeLists.txt:32 (pmm)


CMake Error at CMakeLists.txt:33 (conan_set_find_paths):
  Unknown CMake command "conan_set_find_paths".

Conan doesn't always update conanbuildinfo.cmake

Currently, pmm(CONAN) checks the timestamp of conanbuildinfo.cmake:

get_filename_component(conan_inc "${bin}/conanbuildinfo.cmake" ABSOLUTE)
# ...
if("${conanfile}" IS_NEWER_THAN "${conan_inc}")

However, conan does not always update this file. If the conanfile.txt's timestamp was changed without changing its contents, conan doesn't touch conanbuildinfo.cmake, so pmm will rerun conan install on every configure.

Instead, conaninfo.txt should be used. As of now, conaninfo.txt is updated every time conan runs.

pmm breaks when used in both a top-level project and a sub-project

Using pmm from both a top-level project and a sub-project fails, because conan tries to define an already-existing target

top-level

# ...
pmm(CONAN)
conan_set_find_paths() # I think this line isn't needed; I think pmm does it for us

# ...
add_subdirectory(external) # which has add_subdirectory(some_dependency)

# ...

some_dependency

# ...
pmm(CONAN)
conan_set_find_paths()

# ...

Both the top-level and some_dependency depend on some shared third-party library, e.g. boost.


Currently, conan.cmake calls _pmm_conan_do_setup(), which runs conan_define_targets() and conan_set_find_paths(). The multiple conan_define_targets() is what causes this error.

vcpkg-root error with vcpkg 2020.04

When using master PMM on Ubuntu 18.04 with the newest version of vcpkg 2020.4, it fails with the following error:

-- [download 100% complete]
-- [pmm] Extracting vcpkg archive...
-- [pmm] Bootstrapping the vcpkg tool (This may take a minute)...
-- [pmm] Testing bootstrapped vcpkg
-- [pmm] vcpkg successfully bootstrapped to /home/omaralv/.local/share/pmm/1.4.2/vcpkg-2020.04
-- [pmm] Using vcpkg executable: /home/omaralv/.local/share/pmm/1.4.2/vcpkg-2020.04/vcpkg
-- [pmm] Installing requirements with vcpkg

CMake Error at build/_pmm/1.4.2/vcpkg.cmake:185 (message):
  Failed to install requirements with vcpkg [1]:

  Error: Could not detect vcpkg-root.

PMM requires internet connection

Once the files are already downloaded, PMM still requires an internet connection to download information about whether PMM is out-of-date. This should not be required. It should be possible to build without an internet connection.

With PMM 0.4.0 (but was told it wasn't changed in 1.0.0):

(CMakeTools Log)

[cmake] CMake Error at build/msvc-dbg/_pmm/0.4.0/entry.cmake:22 (message):
[cmake]   Error while downloading file from
[cmake]   'https://vector-of-bool.github.io/pmm/0.4.0/util.cmake' to
[cmake]   '/build-dir/_pmm/0.4.0/util.cmake'
[cmake]   [6]: "Couldn't resolve host name"

VCPKG_ROOT error

I was getting the following on windows vcpkg:
"Changing the working directory to the vcpkg root directory failed. Did you incorrectly define the VCPKG_ROOT environment variable, or did you mistakenly create a file named .vcpkg-root somewhere?"

i added the following to vcpkg.cmake line 182 (when vcpkg is called)
--vcpkg-root "${vcpkg_inst_dir}"
this ensures that the root directory for vcpkg is that of the installation.

Support older versions of CMake

Ubuntu 16.04 is still very common. Its default version of CMake is 3.5.1. Is it reasonable to support CMake 3.5.1? That could allow more people to use pmm if they are unable to update CMake for some reason.

Not many changes are necessary. The cmake_minimum_requireds need to be updated, obviously, and the if(some_version VERSION_GREATER_EQUAL some_number) need to be changed to if(NOT some_version VERSION_LESS some_number). After that, I believe it works on CMake 3.5.1, although I have not tested all code paths.

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.