vtk build failure
@LilyWangLL is already working on this.
Since Nov 22, 2021.
- 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
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.