Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Qt Creator and other tools
  4. Find Qt5DataVisualization package with CMake
Forum Update on Monday, May 27th 2025

Find Qt5DataVisualization package with CMake

Scheduled Pinned Locked Moved Unsolved Qt Creator and other tools
cmakeqt5
2 Posts 2 Posters 2.9k Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • C Offline
    C Offline
    changjurhee
    wrote on last edited by
    #1

    Build environment :

    • CMake 3.8
    • Qt5.6
    • MSVC_2013 w/ x64

    Qt Example : qmlsurface (C:\Qt\Examples\QtDataVisualization\datavisualization\qmlsurface)

    CMakeLists.txt source here...

    //your code here
    
    
    #SET(CMAKE_INCLUDE_CURRENT_DIR ON)   
    
    if(MSVC)
    	if(CMAKE_CL_64)
    		set(QT_INSTALLED_PATH "C:/Qt/5.6/msvc2013_64")
    	else()
    		set(QT_INSTALLED_PATH "C:/Qt/5.6/msvc2013")
    	endif()	
    elseif(APPLE)
    	#SET(QT_INSTALLED_PATH "/opt/Qt5.4.1/5.4/gcc/" )
    elseif()
    	SET(QT_INSTALLED_PATH "C:/Qt/5.6/mingw49_32") 
    endif()
    
    # Add path environment for CMake. 
    SET(CMAKE_PREFIX_PATH ${CMAKE_PREFIX_PATH} ${QT_INSTALLED_PATH} CACHE PATH "")
      
    # These code will enable the auto MOC, UIC and RCC feature.
    # See http://www.cmake.org/cmake/help/v3.0/manual/cmake-qt.7.html
    SET(CMAKE_AUTOMOC ON)
    SET(CMAKE_AUTOUIC ON)
    SET(CMAKE_AUTORCC ON)
    
    # These code will add packages that was used in the source files.
    FIND_PACKAGE(Qt5Widgets) 
    FIND_PACKAGE(Qt5Qml)
    FIND_PACKAGE(Qt5Quick)
    FIND_PACKAGE(Qt5DataVisualization)
    
    set (SRC 
    	main.cpp
    )
    
    set (RESOURCES 
    	qmlsurface.qrc
    )
    
    set (OTHERS 
    	doc/src/qmlsurface.qdoc
    	
    	doc/images/qmlsurface-example.png
    	
    	qml/qmlsurface/Data.qml 
    	qml/qmlsurface/main.qml 
    	qml/qmlsurface/NewButton.qml 	
    	
    	heightmap.png
    )
    
    # -----------------------------------------------------------------------------
    # Setup launcher
    
    if(WIN32)
    	add_executable(qmlsurface ${SRC} ${RESOURCES} ${OTHERS})
    	target_link_libraries(qmlsurface Qt5::Widgets Qt5::Qml Qt5::Quick Qt5::DataVisualization)
    		
    	install(TARGETS qmlsurface
    			DESTINATION ".")
    
    	if(QT_INSTALLED_PATH)
    		if(CMAKE_BUILD_TYPE MATCHES "Debug")
    			install(
    				FILES ${QT_INSTALLED_PATH}/bin/Qt5Cored.dll
    					  ${QT_INSTALLED_PATH}/bin/Qt5Guid.dll
    					  ${QT_INSTALLED_PATH}/bin/Qt5Networkd.dll
    					  ${QT_INSTALLED_PATH}/bin/Qt5Qmld.dll
    					  ${QT_INSTALLED_PATH}/bin/Qt5Quickd.dll
    					  ${QT_INSTALLED_PATH}/bin/DataVisualizationd.dll
    			DESTINATION ".")
    		else()
    			install(
    				FILES ${QT_INSTALLED_PATH}/bin/Qt5Core.dll
    					  ${QT_INSTALLED_PATH}/bin/Qt5Gui.dll
    					  ${QT_INSTALLED_PATH}/bin/Qt5Network.dll
    					  ${QT_INSTALLED_PATH}/bin/Qt5Qml.dll
    					  ${QT_INSTALLED_PATH}/bin/Qt5Quick.dll
    					  ${QT_INSTALLED_PATH}/bin/DataVisualization.dll
    			DESTINATION ".")
    		endif()
    	endif()
    	
    				
    	if(MSVC12_REDIST_DIR)
    		if(CMAKE_CL_64)
    			set(_WIN_PLATFORM x64)
    		else()
    			set(_WIN_PLATFORM x86)
    		endif()
    		install(
    			FILES ${MSVC12_REDIST_DIR}/${_WIN_PLATFORM}/Microsoft.VC120.CRT/msvcp120.dll
    				  ${MSVC12_REDIST_DIR}/${_WIN_PLATFORM}/Microsoft.VC120.CRT/msvcr120.dll
    		DESTINATION ".")
    		if(WITH_OPENMP)
    			install(
    				FILES ${MSVC12_REDIST_DIR}/${_WIN_PLATFORM}/Microsoft.VC120.OpenMP/vcomp120.dll
    				DESTINATION ".")
    		endif()
    	endif()
    endif()
    
    

    Configuring, I got error.

    //error log
    
    CMake Error at C:/Qt/5.6/msvc2013_64/lib/cmake/Qt5DataVisualization/Qt5DataVisualizationConfig.cmake:15 (message):
      The imported target "Qt5::DataVisualization" references the file
    
         "C:/Qt/5.6/msvc2013_64/bin/Qt5DataVisualization.dll"
    
      but this file does not exist.  Possible reasons include:
    
      * The file was deleted, renamed, or moved to another location.
    
      * An install or uninstall procedure did not complete successfully.
    
      * The installation package was faulty and contained
    
         "C:/Qt/5.6/msvc2013_64/lib/cmake/Qt5DataVisualization/Qt5DataVisualizationConfig.cmake"
    
      but not all the files it references.
    
    Call Stack (most recent call first):
      C:/Qt/5.6/msvc2013_64/lib/cmake/Qt5DataVisualization/Qt5DataVisualizationConfig.cmake:31 (_qt5_DataVisualization_check_file_exists)
      C:/Qt/5.6/msvc2013_64/lib/cmake/Qt5DataVisualization/Qt5DataVisualizationConfig.cmake:128 (_populate_DataVisualization_target_properties)
      source/qmlsurface/CMakeLists.txt:28 (FIND_PACKAGE)
    
    
    

    However, bin/lib folder have "DataVisualization.dll/lib" file instead of "Qt5DataVisualization.dll/lib". Is there any reason ?

    1 Reply Last reply
    0
    • M Offline
      M Offline
      mchinand
      wrote on last edited by
      #2

      Do you have a commericial license? The DataVisualization module was only added to the open source license (GPL) in Qt 5.7. Also, how did you install Qt? Using the online installer/maintenance tool, the examples are in sub-directories by version (e.g., C:/Qt/Examples/Qt-5.6), but yours doesn't not seem to use the versioned sub-directories structure.

      1 Reply Last reply
      0

      • Login

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • Users
      • Groups
      • Search
      • Get Qt Extensions
      • Unsolved