Aviso do CMake em /usr/lib/x86_64-linux-gnu/cmake/Qt5Core/Qt5CoreMacros.cmake:273 (find_package):

-1

Compile o programa C ++ com Qt 5.7.0 + cmake, erro apareceu: C

Make Warning at /usr/lib/x86_64-linux-gnu/cmake/Qt5Core/Qt5CoreMacros.cmake:273 (find_package):
  Could not find a package configuration file provided by "Qt5Widget" with
  any of the following names:

    Qt5WidgetConfig.cmake
    qt5widget-config.cmake

  Add the installation prefix of "Qt5Widget" to CMAKE_PREFIX_PATH or set
  "Qt5Widget_DIR" to a directory containing one of the above files.  If
  "Qt5Widget" provides a separate development package or SDK, be sure it has
  been installed.
Call Stack (most recent call first):
  CMakeLists.txt:23 (qt5_use_modules)


CMake Error at /usr/lib/x86_64-linux-gnu/cmake/Qt5Core/Qt5CoreMacros.cmake:275 (message):
  Can not use "Widget" module which has not yet been found.
Call Stack (most recent call first):
  CMakeLists.txt:23 (qt5_use_modules)


-- Configuring incomplete, errors occurred!
See also "/home/allanna/code/OpenCV2_test/colortest/build/CMakeFiles/CMakeOutput.log".

My CMakeLists.txt


cmake_minimum_required(VERSION 3.0.0)

project(colortest)

set(CMAKE_PREFIX_PATH "/usr/lib/x86_64-linux-gnu/cmake/Qt5")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -02 -pthread -fPIE")
set(CMAKE_AUTOMOC ON)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
aux_source_directory(. SRC_LIST)

file(GLOB SRCS *.h *.hpp *.c *.cc *.cpp)
add_executable(${PROJECT_NAME} ${SRCS} ${SRC_LIST} ${ui_FILES} ${qrc_FILES})

find_package(OpenCV REQUIRED)
target_link_libraries(${PROJECT_NAME} ${OpenCV_LIBS})

find_package(Qt5Core)
find_package(Qt5Widgets)
find_package(Qt5Gui)
find_package(Qt5OpenGL)
find_package(Qt5Xml)

qt5_use_modules(${PROJECT_NAME} Core Widget OpenGL Gui Xml)

qt5_wrap_ui(ui_FILES mainwindow.ui)
qt5_add_resources(qrc_FILES colortest.src)

Estou bastante confuso, procurei na internet várias soluções, mas isso não funciona para mim. Por que aparece -1 ao lado da pergunta? De qualquer forma, ajuda por favor. Obrigado.

    
por hoboh 22.10.2016 / 03:16

1 resposta

0

Erro de ortografia de uma palavra Widgets

% bl0ck_qu0te%

deve ser

% bl0ck_qu0te%     
por hoboh 22.10.2016 / 08:57