'QWebEngineView' file not found by cmake (even though it is at same place as 'QWebKit', which it finds just fine
-
Hello,
I am presently moving to 5.6, and in the course of it, changing from QWebView to QWebEngineView. It seems straightforward, but I am hung up on the easiest part - getting my build environment to find the files.The directory structure is symmetric between QtWebKit and QtWebEngine - except that WebEngine has a WebEngineCore in a way that WebKit doesn't have. That may be part of the problem, but can't tell.
To make the transition, I put WebEngine in the same way as WebKit. But whereas it finds WebKit, it does not find WebEngine, leading me to believe there is another variable that isn't in CMakeLists.txt but which is defined somewhere else?
Here's my CMakeLists.txt file:
cmake_minimum_required(VERSION 2.8.11 FATAL_ERROR) project(ia) option(WANT_DEBUG ON) if (APPLE) add_definitions(-Wno-macro-redefined -Wno-inconsistent-missing-override -Wno-potentially-evaluated-expression) endif() include_directories(../caplib ../dicomlib) find_package(ITK REQUIRED) include(${ITK_USE_FILE}) if (ITKVtkGlue_LOADED) find_package(VTK REQUIRED) include(${VTK_USE_FILE}) else() find_package(ItkVtkGlue REQUIRED) include(${ItkVtkGlue_USE_FILE}) set(Glue ItkVtkGlue) endif() #set (CMAKE_PREFIX_PATH /Users/keithmoulton/Qt/5.5/clang_64/lib/cmake/Qt5) #set (QT_QTGUI_LIBRARY /Users/keithmoulton/Qt/5.5/clang_64/lib/QtGui.framework) # Tell CMake to run moc when necessary. set(CMAKE_AUTOMOC ON) # As moc files are generated in the binary dir, tell CMake to always look for includes there. set(CMAKE_INCLUDE_CURRENT_DIR ON) # Widgets finds its own dependencies (QtGui and QtCore). find_package(Qt5Widgets REQUIRED) find_package(Qt5WebKitWidgets REQUIRED) find_package(Qt5WebEngineWidgets REQUIRED) # The Qt5Widgets_INCLUDES also includes the include directories for dependencies QtCore and QtGui. include_directories(${Qt5Widgets_INCLUDES}) include_directories(${Qt5WebKitWidgets_INCLUDES}) include_directories(${Qt5WebEngineWidgets_INCLUDES}) # We need add -DQT_WIDGETS_LIB when using QtWidgets in Qt 5. add_definitions(${Qt5Widgets_DEFINITIONS}) add_definitions(${Qt5WebKitWidgets_DEFINITIONS}) add_definitions(${Qt5WebEngineWidgets_DEFINITIONS}) # Executables fail to build with Qt 5 in the default configuration without -fPIE. We add that here. set(CMAKE_CXX_FLAGS "${Qt5Widgets_EXECUTABLE_COMPILE_FLAGS} ${Qt5WebKitWidgets_EXECUTABLE_COMPILE_FLAGS} ${Qt5WebEngineWidgets_EXECUTABLE_COMPILE_FLAGS}") find_package(VTK REQUIRED) include(${VTK_USE_FILE}) set(CPP cap_main.cpp cap.cpp capTools.cpp processingParameters.cpp workItem.cpp seriesSurvey.cpp targetDefine.cpp patientAnalyze.cpp patientReport.cpp) set(MOC ) set(UI mainwindow.ui aboutPage.ui workItem.ui seriesSurvey.ui targetDefine.ui patientAnalyze.ui patientReport.ui) set(RCC cap.qrc) qt5_wrap_cpp(MOC_GENERATED ${MOC}) qt5_wrap_ui(UI_GENERATED ${UI}) qt5_add_resources(RCC_RESOURCES ${RCC}) source_group("Form Files" FILES ${UI}) source_group("Resource Files" FILES ${RCC}) source_group("Generated Files" FILES ${MOC_GENERATED} ${UI_GENERATED} ${RCC_GENERATED}) include_directories($(CMAKE_CURRENT_BINARY_DIR) $(CMAKE_CURRENT_SOURCE_DIR)) add_subdirectory(../dicomlib dicomlib) add_subdirectory(../caplib caplib) qt5_add_resources(RESOURCE_ADDED ${RCC}) set_source_files_properties(${RESOURCE_ADDED} PROPERTIES GENERATED ON) add_executable(vascuCAP MACOSX_BUNDLE ${MOC_GENERATED} ${UI_GENERATED} ${RCC_GENERATED} main.cpp ${CPP} ${RESOURCE_ADDED} ${BUNDLE_ICON}) set_property(TARGET vascuCAP PROPERTY CXX_STANDARD 11) target_link_libraries(vascuCAP caplib dicomlib ${Qt5Widgets_LIBRARIES} ${Qt5WebKitWidgets_LIBRARIES} ${Qt5WebEngineWidgets_LIBRARIES} ${ITK_LIBRARIES} ${VTK_LIBRARIES}) if (APPLE) install(TARGETS vascuCAP BUNDLE DESTINATION ~/bin/) #install(TARGETS lungCAP BUNDLE DESTINATION ~/bin/) else (APPLE) install(TARGETS vascuCAP DESTINATION /usr/local/bin) #install(TARGETS lungCAP DESTINATION /usr/local/bin) endif()
[edit: Fixed coding tags SGaist]
-
Hi,
Might be a silly question, but did you reconfigure from scratch before building with 5.6 ?
-
This actually precedes 5.6, according to my following sequence:
- I started a 5.6 build on another system
- Then I saw that WebKit isn't in 5.6, it requires a separate pull from git and more complexity... so I determined that I needed to consider a transition path that wouldn't make things more complicated than they already are.
- So I did see that WebEngine is already in 5.5, so I determined that I woudl make my WebKit to WebEngine swith on another computer first, that hadn't been moved to 5.6 yet, and push that to my repo so that my 5.6 could avoid the WebKit complexity.
In other words, I am on parallel paths, this system on 5.5.1 to get rid of WebKit first, then jump to the other system with 5.6, but already having transitioned to WebEngine.
At least that's my plan.
-
What exact error are you getting ?