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

Avoid to use the old GenerateExportHeader included with VTK 6 #715

Merged
merged 3 commits into from
Jul 8, 2020

Conversation

traversaro
Copy link
Member

@traversaro traversaro commented Jul 8, 2020

vtk 6.3 installs a GenerateExportHeader CMake module that shadows the official CMake module if find_package(VTK) is invoked.

To ensure that the build works even if find_package(VTK) is invoked and VTK 6 is found, we manually include exactly the
GenerateExportHeader that is shipped with CMake, extracting the CMake install prefix from the CMAKE_COMMAND variable

The issue has been solved in vtk >= 7.1, see https://gitlab.kitware.com/vtk/vtk/-/merge_requests/1593 , so this workaround can be removed once we will not support anymore platforms that ship with vtk 6.3 as main vtk version (Ubuntu 18.04).

Fix #714 that was happening on a project that included iDynTree via add_subdirectory and indirectly was calling find_package(VTK) with VTK 6, via find_package(PCL).

vtk 6.3 installs a GenerateExportHeader CMake module that shadows the official CMake module if find_package(VTK)
is invoked. The issue has been solved in vtk >= 7.1, see https://gitlab.kitware.com/vtk/vtk/-/merge_requests/1593 .
To ensure that the build works even if find_package(VTK) is invoked and VTK 6 is found, we manually include exactly the
GenerateExportHeader that is shipped with CMake, extracting the CMake install prefix from the CMAKE_COMMAND variable
This workaround can be removed once we will not support anymore platforms that ship with vtk 6.3 as main vtk version (Ubuntu 18.04).
@traversaro
Copy link
Member Author

VTK users that still use Ubuntu 18.04 may need to be aware of this: @pattacini @xEnVrE @vvasco .

@traversaro
Copy link
Member Author

The CMAKE_COMMAND workaround is not working on macOS, apparently.

@traversaro
Copy link
Member Author

The CMAKE_COMMAND workaround is not working on macOS, apparently.

Thanks to @lrapetti, it seems that on macOS/Homebrew CMake installs its modules in <prefix>/share/cmake while on linux it installs them in <prefix>/share/cmake-3.16 . As this workaround is something that mostly is related to old linux distributions, I think it is sufficient to just check if the GenerateExportHeader.cmake file exists, and if it does not exist we can just fall back on just include(GenerateExportHeader) .

@traversaro traversaro merged commit 57b185a into devel Jul 8, 2020
@traversaro traversaro deleted the fix/714 branch July 8, 2020 21:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants