Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

X_VCPKG_APPLOCAL_DEPS_INSTALL fails with install(... FILE_SET ...) #43243

Open
MHebes opened this issue Jan 13, 2025 · 0 comments · May be fixed by #43255
Open

X_VCPKG_APPLOCAL_DEPS_INSTALL fails with install(... FILE_SET ...) #43243

MHebes opened this issue Jan 13, 2025 · 0 comments · May be fixed by #43255
Assignees
Labels
category:tool-update The issue is with build tool or build script, which requires update or should be executed correctly

Comments

@MHebes
Copy link

MHebes commented Jan 13, 2025

Describe the bug
X_VCPKG_APPLOCAL_DEPS_INSTALL does not recognize FILE_SET as a subcommand in an install expression.

Environment

  • OS: Windows
  • Compiler:
    $ vcpkg --version
    vcpkg package management program version 2024-09-30-ab8988503c7cffabfd440b243a383c0a352a023d
    $ cmake --version
    cmake version 3.31.1
    

To Reproduce
Steps to reproduce the behavior:

  1. Create a minimal vcpkg project with at least the following files
    • CMakeLists.txt
    • vcpkg.json
    • helloworld.cpp
    • helloworld.hpp
  2. Contents of CMakeLists.txt:
    cmake_minimum_required(VERSION 3.10)
    
    project(HelloWorld)
    
    add_library(HelloWorld STATIC)
    
    target_sources(HelloWorld
        PRIVATE
            helloworld.cpp
        PUBLIC
            FILE_SET HEADERS
            BASE_DIRS "${PROJECT_SOURCE_DIR}"
            FILES helloworld.hpp
    )
    
    install(TARGETS HelloWorld FILE_SET HEADERS)
  3. mkdir build && cd build
  4. cmake -DCMAKE_TOOLCHAIN_FILE="${VCPKG_ROOT}/scripts/buildsystems/vcpkg.cmake" -DX_VCPKG_APPLOCAL_DEPS_INSTALL:BOOL="TRUE" .. && cmake --build .

Expected behavior
X_VCPKG_APPLOCAL_DEPS_INSTALL should support install(... FILE_SET ...) syntax.

Failure logs

CMake Error at C:/Program Files/Microsoft Visual Studio/2022/Professional/VC/vcpkg/scripts/buildsystems/vcpkg.cmake:703 (get_target_property):
  get_target_property() called with non-existent target "FILE_SET".
Call Stack (most recent call first):
  C:/Program Files/Microsoft Visual Studio/2022/Professional/VC/vcpkg/scripts/buildsystems/vcpkg.cmake:756 (x_vcpkg_install_local_dependencies)
  CMakeLists.txt:16 (install)


CMake Error at C:/Program Files/Microsoft Visual Studio/2022/Professional/VC/vcpkg/scripts/buildsystems/vcpkg.cmake:703 (get_target_property):
  get_target_property() called with non-existent target "HEADERS".
Call Stack (most recent call first):
  C:/Program Files/Microsoft Visual Studio/2022/Professional/VC/vcpkg/scripts/buildsystems/vcpkg.cmake:756 (x_vcpkg_install_local_dependencies)
  CMakeLists.txt:16 (install)


-- Configuring incomplete, errors occurred!

Additional context

Just adding FILE_SET to the subcommand regex works:

diff --git a/scripts/buildsystems/vcpkg.cmake b/scripts/buildsystems/vcpkg.cmake
index 0ff9c1b40..02c462bc7 100644
--- a/scripts/buildsystems/vcpkg.cmake
+++ b/scripts/buildsystems/vcpkg.cmake
@@ -736,7 +736,7 @@ if(X_VCPKG_APPLOCAL_DEPS_INSTALL)
                     set(modifier "${arg}")
                     continue()
                 endif()
-                if(arg MATCHES "^(TARGETS|DESTINATION|PERMISSIONS|CONFIGURATIONS|COMPONENT|NAMELINK_COMPONENT|OPTIONAL|EXCLUDE_FROM_ALL|NAMELINK_ONLY|NAMELINK_SKIP|EXPORT)$")
+                if(arg MATCHES "^(TARGETS|DESTINATION|PERMISSIONS|CONFIGURATIONS|COMPONENT|NAMELINK_COMPONENT|OPTIONAL|EXCLUDE_FROM_ALL|NAMELINK_ONLY|NAMELINK_SKIP|EXPORT|FILE_SET)$")
                     set(last_command "${arg}")
                     continue()
                 endif()
@Mengna-Li Mengna-Li linked a pull request Jan 14, 2025 that will close this issue
7 tasks
@Mengna-Li Mengna-Li added the category:tool-update The issue is with build tool or build script, which requires update or should be executed correctly label Jan 14, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
category:tool-update The issue is with build tool or build script, which requires update or should be executed correctly
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants