Skip to content

GitLab

  • Menu
Projects Groups Snippets
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • VTK VTK
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 740
    • Issues 740
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 199
    • Merge requests 199
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages & Registries
    • Packages & Registries
    • Package Registry
    • Infrastructure Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • VTK
  • VTKVTK
  • Issues
  • #17085
Closed
Open
Created Jul 12, 2017 by Francis Giraldeau@francis.giraldeau

cmake in find-package mode fails to find vtk

CMake can be used in pkg-config mode to output libs and cflags for VTK. The VTK library is found if used in CMakeLists.txt. However, the find-package mode fails:

$ cmake --find-package -DNAME=VTK -DLANGUAGE=CXX -DCOMPILER_ID=GNU -DMODE=COMPILE

CMake Error at /work/software/x86_64/vtk/vtk-8.0.0/lib/cmake/vtk-8.0/VTKConfig.cmake:33 (message):
  GCC 4.6 or later is required.
Call Stack (most recent call first):
  /mnt/md127/work/software/x86_64/cmake/cmake-3.5.2/share/cmake-3.5/Modules/CMakeFindPackageMode.cmake:190 (find_package)

VTK not found.
CMake Error: Problem processing arguments. Aborting.

Inside VTKConfig.cmake, the following code returns the error:

if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU" AND
    CMAKE_CXX_COMPILER_VERSION VERSION_LESS 4.6)
  message(FATAL_ERROR "GCC 4.6 or later is required." )
endif ()

The compiler version is correct (gcc 4.8.5), but the variable CMAKE_CXX_COMPILER_VERSION is actually not defined. When passing the additional arguments -DCMAKE_CXX_COMPILER_VERSION=4.8.5 -DCMAKE_CXX_STANDARD_COMPUTED_DEFAULT=4.8.5, cmake returns correctly.

Assignee
Assign to
Time tracking