[Paraview] Debug Qt Libraries NOT being installed on MSVC Builds
Michael Jackson
mike.jackson at bluequartz.net
Fri Mar 19 14:44:20 EDT 2010
Here is what I came up with:
# Function to install qt libraries. qtliblist is a list of libraries
to install
# of the form "QTCORE QTGUI QTNETWORK QTXML QTTEST QTSQL" etc.
FUNCTION(install_qt_libs qtliblist componentname)
IF (NOT APPLE)
FOREACH(qtlib ${qtliblist})
IF (NOT WIN32)
IF (QT_${qtlib}_LIBRARY_RELEASE)
GET_FILENAME_COMPONENT(QT_LIB_DIR_tmp ${QT_$
{qtlib}_LIBRARY_RELEASE} PATH)
GET_FILENAME_COMPONENT(QT_LIB_NAME_tmp ${QT_$
{qtlib}_LIBRARY_RELEASE} NAME)
FILE(GLOB QT_LIB_LIST RELATIVE "${QT_LIB_DIR_tmp}" "${QT_$
{qtlib}_LIBRARY_RELEASE}*")
INSTALL(CODE "
MESSAGE(STATUS \"Installing \${CMAKE_INSTALL_PREFIX}/$
{PV_INSTALL_LIB_DIR}/${QT_LIB_NAME_tmp}\")
EXECUTE_PROCESS (WORKING_DIRECTORY ${QT_LIB_DIR_tmp}
COMMAND tar c ${QT_LIB_LIST}
COMMAND tar -xC \${CMAKE_INSTALL_PREFIX}/$
{PV_INSTALL_LIB_DIR})
" COMPONENT ${componentname})
ENDIF (QT_${qtlib}_LIBRARY_RELEASE)
ELSE (NOT WIN32)
# GET_FILENAME_COMPONENT(QT_DLL_PATH_tmp ${QT_QMAKE_EXECUTABLE}
PATH)
# INSTALL(FILES ${QT_DLL_PATH_tmp}/${qtlib}4.dll
# DESTINATION ${PV_INSTALL_BIN_DIR}
# COMPONENT ${componentname})
set (BUILD_TYPES "Debug;Release" )
foreach (btype ${BUILD_TYPES})
string(TOUPPER ${btype} BTYPE)
file(MAKE_DIRECTORY ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/$
{btype})
string(TOUPPER ${qtlib} QTLIB)
if (NOT ${QT_${QTLIB}_LIBRARY_${BTYPE}} STREQUAL QT_$
{QTLIB}_LIBRARY_${BTYPE}-NOTFOUND)
GET_FILENAME_COMPONENT(DLL_NAME ${QT_${QTLIB}_LIBRARY_
${BTYPE}} NAME_WE)
GET_FILENAME_COMPONENT(QT_BIN_PATH $
{QT_QMAKE_EXECUTABLE} PATH)
#message(STATUS "**Generating Install Rule for $
{btype} Version of ${DLL_NAME} DLL")
INSTALL(FILES ${QT_BIN_PATH}/${DLL_NAME}.dll
DESTINATION ${PV_INSTALL_BIN_DIR}
CONFIGURATIONS ${btype}
COMPONENT ${componentname} )
# this code is here to copy the qt libraries into the
actual build folder
# on windows in case the qt/bin directory is NOT on
the users PATH anywhere
# which can happen if there are multiple Qt versions
installed or multiple
# arch types (32 or 64 bit) installed. This is turned
OFF for now but I
# usually enable this.
if (0)
add_custom_target(Z_${qtlib}-${BTYPE}-Copy ALL
COMMAND ${CMAKE_COMMAND} -E
copy_if_different ${QT_BIN_PATH}/${DLL_NAME}.dll
${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${btype}/
COMMENT "Copying ${QT_BIN_PATH}/$
{DLL_NAME}.dll to ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${btype}/")
endif()
endif()
endforeach( btype ${BUILD_TYPES} )
ENDIF (NOT WIN32)
ENDFOREACH(qtlib)
ENDIF (NOT APPLE)
ENDFUNCTION(install_qt_libs)
And you call it like this: From ${ParaView_SOURCE}/Applications/
ParaView/CMakeLists.txt
SET (qtliblist QtCore QtGui QtNetwork QtXml QtSql QtHelp QtWebKit
QtCLucene Phonon QtXmlPatterns)
That seems to work fine for both Debug and Release modes. This was
tested on Windows 7 x64 running Visual Studio 2008 RTM and CMake 2.6.4
Hope it helps. I git cloned to "git clone git://
echo1.bluequartz.net/ParaView.git" and have my changes there.
___________________________________________________________
Mike Jackson www.bluequartz.net
On Mar 18, 2010, at 3:06 PM, Dave Partyka wrote:
> Its at the bottom of ParaView\CMake\ParaViewBrandingCPack.cmake.
>
> On Thu, Mar 18, 2010 at 3:01 PM, Michael Jackson <mike.jackson at bluequartz.net
> > wrote:
> Ok. I'm trying to peruse through the ParaView CMake files but am not
> really coming up where those install rules are set? Care to give a
> hint. I may have a patch for you...
> __________________________________________________________
> Mike Jackson www.bluequartz.net
>
>
>
> On Mar 18, 2010, at 2:52 PM, Dave Partyka wrote:
>
> It's a bug, the install rule doesn't respect configuration type.
>
> On Thu, Mar 18, 2010 at 2:46 PM, Mike Jackson <mike.jackson at bluequartz.net
> > wrote:
> This is with ParaView CVS HEAD and VS 2008 running on Windows 7. When
> I build a "Debug" version then run the "INSTALL" project in the
> Paraview.sln file I get the NON-Debug versions of the Qt libraries. I
> have to go back and manually copy the libraries from the Qt
> Installation location into the "bin" directory of the installation. Is
> this intended behavior or a bug? I have a possible patch if needed
> that would help clear this up.
> _________________________________________________________
> Mike Jackson mike.jackson at bluequartz.net
> BlueQuartz Software www.bluequartz.net
> Principal Software Engineer Dayton, Ohio
More information about the ParaView
mailing list