I can't generate the header for my ui files with cmake 3.5.2 and Qt 5.9.
My CMakeFileLists.txt:
cmake_minimum_required(VERSION 3.5)
project( fc_app )
message( STATUS "Configuring project")
set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTOUIC ON)
set(CMAKE_AUTORCC ON)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
message( STATUS "search OpenCV")
find_package(
OpenCV
3.2.0
REQUIRED
)
message( STATUS "search Qt")
find_package(
Qt5
5.5.1
REQUIRED
Core
Gui
Widgets
Multimedia
)
message( STATUS "search Boost")
find_package(
Boost
1.58.0
REQUIRED
)
file( GLOB_RECURSE source_files src/* )
file( GLOB_RECURSE header_files include/* )
file( GLOB_RECURSE ui_files ui/* )
file( GLOB_RECURSE res_files res/* )
add_executable(
fc_app
${source_files}
${header_files}
${ui_files}
)
target_link_libraries(
fc_app
${OpenCV_LIBS}
Qt5::Widgets
Qt5::Multimedia
${Boost_LIBRARIES}
)
I get the following error (in make) when I run cmake .. & make in the root/build/ directory. The ui file is a simple QMainWindow with 2 buttons in it, so I don't unterstand why the generation of ui_mainwindow.h failed. I tried to remake the ui file with an other version of Qt5 Designer too.
File '/blablablabla/mainwindow.ui' is not valid
AUTOUIC: error: process for ui_mainwindow.h needed by
"/blablablabla/mainwindow.cpp"
failed:
File '/blablablabla/mainwindow.ui' is not valid