Test the qt5_add_resource macro.
Change-Id: I94e4c9e525016405abba90bbdbe58e7786ce5bc4 Reviewed-by: Clinton Stimpson <clinton@elemtech.com> Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
This commit is contained in:
parent
38ca60985e
commit
db5b3afa01
@ -9,5 +9,7 @@ include_directories(${Qt5Core_INCLUDE_DIRS})
|
||||
|
||||
qt5_wrap_cpp(moc_files myobject.h)
|
||||
|
||||
add_executable(myobject myobject.cpp ${moc_files})
|
||||
qt5_add_resources(rcc_files "pass2.qrc")
|
||||
|
||||
add_executable(myobject myobject.cpp ${moc_files} ${rcc_files})
|
||||
target_link_libraries(myobject ${Qt5Core_LIBRARIES})
|
||||
|
@ -50,5 +50,7 @@ MyObject::MyObject(QObject *parent)
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
MyObject myObject;
|
||||
// Compile error if the resource file was not created.
|
||||
Q_INIT_RESOURCE(pass2);
|
||||
return 0;
|
||||
}
|
||||
|
6
tests/manual/cmake/pass2/pass2.qrc
Normal file
6
tests/manual/cmake/pass2/pass2.qrc
Normal file
@ -0,0 +1,6 @@
|
||||
<!DOCTYPE RCC><RCC version="1.0">
|
||||
<qresource prefix="/">
|
||||
<file>resource_file.txt</file>
|
||||
</qresource>
|
||||
</RCC>
|
||||
|
1
tests/manual/cmake/pass2/resource_file.txt
Normal file
1
tests/manual/cmake/pass2/resource_file.txt
Normal file
@ -0,0 +1 @@
|
||||
Ken sent me.
|
Loading…
Reference in New Issue
Block a user