blt_patch_target: produces an error
- Dominant language
- C++
- Stars
- 296
- Forks
- 66
- Avg merge
- 1h 3m
- Merged PRs (30d)
- 1
Description
User (@rrsettgast) reported the blt_patch_target macro is producing an error that seems to be wrong. Calling `set_property` instead of `target_include_directories` not only didn't produce the warning but also fixed the system includes as well.
cmake version 3.16.8
Error:
```
CMake Error at cmake/blt/cmake/BLTMacros.cmake:488 (target_include_directories):
target_include_directories may only set INTERFACE properties on IMPORTED
targets
Call Stack (most recent call first):
cmake/thirdparty/SetupThirdParty.cmake:516 (blt_patch_target)
cmake/CMakeBasics.cmake:49 (include)
CMakeLists.txt:36 (include)
```
Target info:
```
-- VTK::loguru
-- [VTK::loguru property] 'VTK::loguru' is a cmake target
-- [VTK::loguru property] AUTOGEN_ORIGIN_DEPENDS: ON
-- [VTK::loguru property] AUTOMOC_COMPILER_PREDEFINES: ON
-- [VTK::loguru property] AUTOMOC_MACRO_NAMES: Q_OBJECT;Q_GADGET;Q_NAMESPACE
-- [VTK::loguru property] AUTOMOC_PATH_PREFIX: ON
-- [VTK::loguru property] BINARY_DIR: build-quartz-clang@9.0.0-debug
-- [VTK::loguru property] BUILD_WITH_INSTALL_RPATH: OFF
-- [VTK::loguru property] CXX_EXTENSIONS: OFF
-- [VTK::loguru property] CXX_STANDARD: 14
-- [VTK::loguru property] CXX_STANDARD_REQUIRED: ON
-- [VTK::loguru property] DEBUG_POSTFIX:
-- [VTK::loguru property] Fortran_MODULE_DIRECTORY: build-quartz-clang@9.0.0-debug/lib/fortran
-- [VTK::loguru property] IMPORTED: TRUE
-- [VTK::loguru property] IMPORTED_CONFIGURATIONS: RELEASE
-- [VTK::loguru property] IMPORTED_GLOBAL: FALSE
-- [VTK::loguru property] INSTALL_RPATH:
-- [VTK::loguru property] INSTALL_RPATH_USE_LINK_PATH: OFF
-- [VTK::loguru property] INTERFACE_INCLUDE_DIRECTORIES: install-quartz-clang@9.0.0-release/vtk/include/vtk-9.0;install-quartz-clang@9.0.0-release/vtk/include/vtk-9.0/
-- [VTK::loguru property] INTERFACE_SYSTEM_INCLUDE_DIRECTORIES: include/vtk-9.0/
-- [VTK::loguru property] NAME: VTK::loguru
-- [VTK::loguru property] POSITION_INDEPENDENT_CODE: TRUE
-- [VTK::loguru property] RUNTIME_OUTPUT_DIRECTORY: /build-quartz-clang@9.0.0-debug/bin
-- [VTK::loguru property] SKIP_BUILD_RPATH: OFF
-- [VTK::loguru property] SOURCE_DIR: /src
-- [VTK::loguru property] TYPE: SHARED_LIBRARY
-- [VTK::loguru property] UNITY_BUILD_BATCH_SIZE: 8
```
Contributor guide
Research direction
Start in cmake/blt/cmake/BLTMacros.cmake at line 488, then follow the call from cmake/thirdparty/SetupThirdParty.cmake:516 for the VTK::loguru target. Reproduce with CMake 3.16.8 and inspect how blt_patch_target handles the imported target and its include properties. Done means the reported error is avoided without losing the system include configuration.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cmake
- Domain
- build-system
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100