Qt的qrc文件通过cmake在VS中编译Q_INIT_RESOURCE imagecomposition 编译
2017-07-03 15:11
1136 查看
想把Qt的安装文件里的example编译到VS下运行,想法是通过cmake文件写cmakelist文件进行编译,后来碰到,Q_INIT_RESOURCE一直不能编译通过,提示不能连接,后来各种找,原来在cmake3.0之后,已经可以直接使用了。
cmake_minimum_required(VERSION 2.8.11)
project(imagecomposition)
# Find includes in corresponding build directories
set(CMAKE_INCLUDE_CURRENT_DIR ON)
# Instruct CMake to run moc automatically when needed.
set(CMAKE_AUTOMOC ON)
# Find the QtWidgets library need open
set(CMAKE_AUTORCC ON)
find_package(Qt5Widgets)
find_package(Qt5Core)
add_executable(imagecomposition WIN32 main.cpp
imagecomposition.qrc
imagecomposer.h
imagecomposer.cpp
)
# Use the Widgets module from Qt 5.
target_link_libraries(imagecomposition Qt5::Widgets)
cmake_minimum_required(VERSION 2.8.11)
project(imagecomposition)
# Find includes in corresponding build directories
set(CMAKE_INCLUDE_CURRENT_DIR ON)
# Instruct CMake to run moc automatically when needed.
set(CMAKE_AUTOMOC ON)
# Find the QtWidgets library need open
set(CMAKE_AUTORCC ON)
find_package(Qt5Widgets)
find_package(Qt5Core)
add_executable(imagecomposition WIN32 main.cpp
imagecomposition.qrc
imagecomposer.h
imagecomposer.cpp
)
# Use the Widgets module from Qt 5.
target_link_libraries(imagecomposition Qt5::Widgets)
相关文章推荐
- VS2013 QT可以编译通过但是头文件有红线
- Qt Q_INIT_RESOURCE 让 dll 动态库使用 qrc 资源文件
- VS下QT学习笔记-使用.qrc资源文件
- Qt的qrc加入大图片不能编译通过(提示:堆空间不足)
- Qt工程在Linux下编译时出现.ui文件编译不通过的问题
- VS下QT学习笔记-使用.qrc资源文件
- VS2013编译32位与36位的sqlite,再CMAKE生成osgearth加载mbtiles文件需要的osgdb_osgearth_mbtiles.dll
- CodeJock如何通过vs编译成两个dll文件
- Ubuntu下通过CMake文件编译CUDA+OpenCV代码操作步骤
- Qt工程在Linux下编译时出现.ui文件编译不通过的问题
- QT的qmake 通过pro文件生成vs工程
- vs下编译qt项目,qrc资源问题
- VS 编译 QT文件
- VS2015 + PCL1.8.0 + QT_5.62 + cmake3.82 编译VTK7.1,生成QVTKWidgetPlugin.dll
- Cmake编译QT,丢失ts文件信息问题
- VS 2015 64位CMake编译openCV3.1.0必备文件
- vs 2008的工程编译的manifest文件导致程序无法运行,通过设置 /MANIFESTDEPENDENCY (Specify Manifest Dependencies) 解决
- qt通过pri文件实现预编译处理
- 使用Cmake生成CEF的项目源文件,并在VS2015中编译通过
- 使用code blocks编译qt程序之三:编译qrc文件