Fix relative paths of dependencies using sdk
Summary
Using the sight_sdk
generated on another computer while generating the cmake configuration the following error occurs :
Steps to reproduce
- Download the sdk generated on any other computer (you can use the artifactory version built by the CI : https://conan.ircad.fr/artifactory/data/sdk/sight-18.0-linux_x86_64.tar.gz )
- Clone the sight-client-test or the sight-sdk-sample or build your own sight client application
- Launch cmake by following the instructions in https://git.ircad.fr/Sight/sight-sdk-sample
- Configure
- Generate <--- Fails.
Dev environment
- OS: Linux, Windows, MacOS
- CMake version: 3.13.4
- Compiler: clang 6.0.0
- Build type: release
- Commit: Anywhere after the sdk update
What is the current bug behavior?
The generated Sight-{LIB}*Targets.cmake
in the sdk install contains paths relative to the machine that created the sdk binaries.
There are two variables that contain relative paths INTERFACE_INCLUDE_DIRECTORIES
and INTERFACE_SYSTEM_INCLUDE_DIRECTORIES
. They also contain {_IMPORT_PREFIX}/include/sight
which is the correct way to point to dependencies.
The current line looks like :
INTERFACE_INCLUDE_DIRECTORIES "/home/sight/sdk/conan/.conan/data/camp/0.8.2/sight/stable/package6ff7c95bdec038318c1d0d609634510f8fbba349/include;${_IMPORT_PREFIX}/include/sight"
And should look something like this :
INTERFACE_INCLUDE_DIRECTORIES "${_IMPORT_PREFIX}/include/sight"
Possible fixes
Create an Install script in order to parse every Sight-{LIB}*Targets.cmake
and remove useless conan paths