I have the very simple CMakeLists.txt
CMAKE_MINIMUM_REQUIRED(VERSION 2.8)
FIND_PACKAGE(VTK REQUIRED)
PROJECT(test CXX)
that really doesn't do anything. The package VTK is correctly found under /usr/lib/vtk-5.8/VTKConfig.cmake
. This file includes a number of statements of the type
ADD_LIBRARY(foobar SHARED IMPORTED)
to indicate that the shared library libfoobar.so
will need to be linked in executables.
Upon creating Makefiles using the above script, however, CMake will complain that
CMake Warning (dev) at /usr/lib/vtk-5.8/VTKTargets.cmake:244 (ADD_LIBRARY):
ADD_LIBRARY called with SHARED option but the target platform does not
support dynamic linking. Building a STATIC library instead. This may lead
to problems.
Call Stack (most recent call first):
/usr/lib/vtk-5.8/VTKConfig.cmake:200 (INCLUDE)
/usr/share/cmake-2.8/Modules/FindVTK.cmake:73 (FIND_PACKAGE)
CMakeLists.txt:4 (FIND_PACKAGE)
This warning is for project developers. Use -Wno-dev to suppress it
What does this warning mean and how is it dealt with?
This is a Linux system with CMake 2.8.9. While this error message appears for all packages that contain ADD_LIBRARY(foobar SHARED IMPORTED)
, VTK-5.8 is used as an example here.
FIND_*
command is in a toolchain file. See cmake.org/Bug/view.php?id=15999 – Monolithic