microsoft / microsoft/vcpkg

vtk build failure

Open
#12,906 17 comments 0 reactions 1 assignee View on GitHub

@LilyWangLL is already working on this.

Since Nov 22, 2021.

category:port-bug
Dominant language
CMake
Stars
27.5k
Forks
7.7k
Avg merge
2d 19h
Merged PRs (30d)
321

Description

**Host Environment**
- OS: Windows
- Compiler: msvc 14.2

**To Reproduce**
Steps to reproduce the behaviour:
- `./vcpkg install vtk`
- Try to use it in two subdirectories, each one is a shared library having a public dependency on vtk. Dependency to vtk is declared as:
```
find_package(VTK CONFIG REQUIRED)
target_link_libraries(lib1 ${VTK_LIBRARIES})
```

**Failure logs**
```
CMake Error at C:/workspace/vcpkg/installed/x64-windows/share/vtk/FindLZ4.cmake:2 (set_target_properties):
Attempt to promote imported target "lz4::lz4" to global scope (by setting
IMPORTED_GLOBAL) which is not built in this directory.
Call Stack (most recent call first):
C:/workspace/vcpkg/scripts/buildsystems/vcpkg.cmake:455 (_find_package)
C:/workspace/vcpkg/installed/x64-windows/share/vtk/VTK-vtk-module-find-packages.cmake:1196 (find_package)
C:/workspace/vcpkg/installed/x64-windows/share/vtk/vtk-config.cmake:129 (include)
C:/workspace/vcpkg/scripts/buildsystems/vcpkg.cmake:455 (_find_package)
src/CMakeLists.txt:22 (find_package)
```

**Additional context**
-VTK itself compiles fine, though there are patches that promote its dependencies to the global scope. For example:
```
set_target_properties(lz4::lz4 PROPERTIES IMPORTED_GLOBAL TRUE)
```
Which then cause an error in my project.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.