[vtkusers] Why would Tcl_DStringResult be undefined when I build VTK??
kent williams
nkwmailinglists at gmail.com
Tue Apr 13 14:10:47 EDT 2010
I'm trying to automate building all the prerequisite libraries I need
for our application using the CMake ExternalProject_add macros.
I've got a version that seems to do the right thing for Tcl and Tk,
and VTK's build goes fine until it tries to link the VTK wish
interpreter. And then I get this:
Linking CXX executable vtk
Undefined symbols:
"_Tcl_DStringResult", referenced from:
vtkFrustumSourceCppCommand(vtkFrustumSource*, Tcl_Interp*, int,
char**)in libvtkGraphicsTCL.a(vtkFrustumSourceTcl.o)
vtkFrustumSourceCppCommand(vtkFrustumSource*, Tcl_Interp*, int,
char**)in libvtkGraphicsTCL.a(vtkFrustumSourceTcl.o)
Now Tcl_DStringResult is called for every TCL-wrapped VTK function, so
i get tens of thousands of lines of output from the build before it
fails.
What did I do to deserve this?
------------------------------------------------------------------------CMakeLists.txt-----------------------------------------------------------------------------------------------------
project(TclTkVTK)
cmake_minimum_required(VERSION 2.8)
cmake_policy(VERSION 2.8)
set(CMAKE_VERBOSE_MAKEFILE on)
enable_testing()
include(Dart)
include(CPack)
include(ExternalProject)
find_package( Qt4 REQUIRED )
if(QT_USE_FILE)
include(${QT_USE_FILE})
set(QT_USE_QTXML 1)
else(QT_USE_FILE)
set( QT_LIBRARIES ${QT_QT_LIBRARY})
endif(QT_USE_FILE)
SET(QT_CMAKE_FLAGS
-DVTK_USE_QT:BOOL=ON
-DVTK_USE_QVTK:BOOL=ON
-DVTK_USE_GUISUPPORT:BOOL=ON
-DDESIRED_QT_VERSION:STRING=4
-DVTK_USE_QVTK_QTOPENGL:BOOL=ON
)
if(APPLE)
set(QT_CMAKE_FLAGS ${QT_CMAKE_FLAGS}
-DVTK_USE_CARBON:BOOL=OFF
-DVTK_USE_COCOA:BOOL=ON
-DVTK_USE_X:BOOL=OFF
)
set(LIB_EXT dylib)
set(EXTRA_TK_FLAGS
--enable-aqua
--enable-corefoundation
)
else(APPLE)
set(QT_CMAKE_FLAGS ${QT_CMAKE_FLAGS}
-DVTK_USE_CARBON:BOOL=OFF
-DVTK_USE_COCOA:BOOL=OFF
-DVTK_USE_X:BOOL=ON
)
set(LIB_EXT .so)
endif(APPLE)
SET(LOCAL_CMAKE_BUILD_OPTIONS
-DMAKECOMMAND:STRING=${MAKECOMMAND}
-DCMAKE_SKIP_RPATH:BOOL=ON
-DCMAKE_BUILD_TYPE:STRING=${CMAKE_BUILD_TYPE}
-DCMAKE_CXX_FLAGS_RELEASE:STRING=${CMAKE_CXX_FLAGS_RELEASE}
-DCMAKE_CXX_FLAGS_DEBUG:STRING=${CMAKE_CXX_FLAGS_DEBUG}
-DCMAKE_CXX_FLAGS:STRING=${CMAKE_CXX_FLAGS}
-DCMAKE_C_FLAGS_RELEASE:STRING=${CMAKE_C_FLAGS_RELEASE}
-DCMAKE_C_FLAGS_DEBUG:STRING=${CMAKE_C_FLAGS_DEBUG}
-DCMAKE_C_FLAGS:STRING=${CMAKE_C_FLAGS}
-DBUILD_EXAMPLES:BOOL=OFF
-DBUILD_SHARED_LIBS:BOOL=${BUILD_SHARED_LIBS}
-DBUILD_TESTING:BOOL=OFF
-DCMAKE_GENERATOR:STRING=${CMAKE_GENERATOR}
-DCMAKE_EXTRA_GENERATOR:STRING=${CMAKE_EXTRA_GENERATOR}
-DCMAKE_INSTALL_PREFIX:PATH=${CMAKE_INSTALL_PREFIX}
-DCMAKE_LIBRARY_OUTPUT_DIRECTORY:PATH=${CMAKE_LIBRARY_OUTPUT_DIRECTORY}
-DCMAKE_ARCHIVE_OUTPUT_DIRECTORY:PATH=${CMAKE_ARCHIVE_OUTPUT_DIRECTORY}
-DCMAKE_RUNTIME_OUTPUT_DIRECTORY:PATH=${CMAKE_RUNTIME_OUTPUT_DIRECTORY}
-DCMAKE_BUNDLE_OUTPUT_DIRECTORY:PATH=${CMAKE_BUNDLE_OUTPUT_DIRECTORY}
-DDART_TESTING_TIMEOUT:STRING=${DART_TESTING_TIMEOUT}
-DMEMORYCHECK_COMMAND_OPTIONS:STRING=${MEMORYCHECK_COMMAND_OPTIONS}
-DMEMORYCHECK_COMMAND:PATH=${MEMORYCHECK_COMMAND}
-DCMAKE_SHARED_LINKER_FLAGS:STRING=${CMAKE_SHARED_LINKER_FLAGS}
-DCMAKE_EXE_LINKER_FLAGS:STRING=${CMAKE_EXE_LINKER_FLAGS}
-DCMAKE_MODULE_LINKER_FLAGS:STRING=${CMAKE_MODULE_LINKER_FLAGS}
-DSITE:STRING=${SITE}
-DBUILDNAME:STRING=${BUILDNAME}
${QT_CMAKE_FLAGS}
)
set(TCL_DEPEND TCL)
set(proj TCL)
ExternalProject_Add(${proj}
CVS_REPOSITORY ":pserver:anonymous:@tcl.cvs.sourceforge.net:/cvsroot/tcl"
CVS_TAG -r core-8-5-7
CVS_MODULE "tcl"
CONFIGURE_COMMAND CMAKE_C_COMPILER="${CMAKE_C_COMPILER}"
CMAKE_CXX_COMPILER="${CMAKE_CXX_COMPILER}"
${CMAKE_CURRENT_BINARY_DIR}/TCL-prefix/src/TCL/unix/configure
--prefix=${CMAKE_CURRENT_BINARY_DIR}
)
set(TK_DEPEND TK)
set(proj TK)
ExternalProject_Add(${proj}
CVS_REPOSITORY ":pserver:anonymous:@tcl.cvs.sourceforge.net:/cvsroot/tktoolkit"
CVS_TAG -r core-8-5-7
CVS_MODULE "tk"
CONFIGURE_COMMAND CMAKE_C_COMPILER="${CMAKE_C_COMPILER}"
CMAKE_CXX_COMPILER="${CMAKE_CXX_COMPILER}"
${CMAKE_CURRENT_BINARY_DIR}/TK-prefix/src/TK/unix/configure
--prefix=${CMAKE_CURRENT_BINARY_DIR}
--with-tcl=${CMAKE_CURRENT_BINARY_DIR}/lib ${EXTRA_TK_FLAGS}
DEPENDS ${TCL_DEPEND}
)
#
# build VTK
# -DVTK_USE_TK:BOOL=yes
set(VTK_DEPEND VTK)
set(proj VTK)
ExternalProject_Add(${proj}
CVS_REPOSITORY ":pserver:anonymous at public.kitware.com:/cvsroot/VTK"
CVS_TAG -r VTK-5-4-2
CVS_MODULE "VTK"
CMAKE_ARGS ${LOCAL_CMAKE_BUILD_OPTIONS} -DVTK_WRAP_TCL:BOOL=ON
-DTCL_INCLUDE_PATH:PATH=${CMAKE_CURRENT_BINARY_DIR}/include
-DTK_INCLUDE_PATH:PATH=${CMAKE_CURRENT_BINARY_DIR}/include
-DTCL_LIBRARY:FILEPATH=${CMAKE_CURRENT_BINARY_DIR}/lib/libtk8.5.${LIB_EXT}
-DTK_LIBRARY:FILEPATH=${CMAKE_CURRENT_BINARY_DIR}/lib/libtcl8.5.${LIB_EXT}
-DTCL_TCLSH:FILEPATH=${CMAKE_CURRENT_BINARY_DIR}/bin/tclsh8.5
INSTALL_DIR ${CMAKE_INSTALL_PREFIX}
DEPENDS ${TCL_DEPEND} ${TK_DEPEND}
)
More information about the vtkusers
mailing list