Skip to content

CMake INSTALL target on Windows is broken since 7cad6d7 #3019

@MichalRostocki

Description

@MichalRostocki

Describe the bug
On Windows, performing build & install procedure is no longer successful on latest devel. This is due to wrong path during catch2.pc.tmp configure_file step. Reverting commit 7cad6d7 fixes the issue.

Expected behavior
Configure, build and install procedure should succeed without any special configuration

Reproduction steps
On Windows, in Catch2 repository, perform:

cmake -B build -DCATCH_INSTALL_EXTRAS=OFF -DCATCH_INSTALL_DOCS=OFF -DCMAKE_INSTALL_PREFIX=bin -DCMAKE_UNITY_BUILD=ON
cmake --build build --config Release
cmake --install build

Last command prints out the following error:

CMake Error: Could not open file for write in copy operation /C:/Users/Michal/code/Catch2/bin/share/pkgconfig/catch2.pc.tmp
CMake Error: : System Error: Invalid argument
CMake Error at build/cmake_install.cmake:77 (configure_file):
  configure_file Problem configuring file

Notice a slash before a drive letter, causing the path to be invalid.

Platform information:
Tested on Windows 11 and windows-latest Azure Pipelines agent

Metadata

Metadata

Assignees

No one assigned

    Labels

    Building and PackagingIssues affecting build/packaging scripts and utilities

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions