summaryrefslogtreecommitdiffstats
path: root/tests/auto/cmake/test_add_binary_resources_delayed_file/CMakeLists.txt
diff options
context:
space:
mode:
authorA. Klitzing <aklitzing@gmail.com>2014-11-13 11:01:31 +0100
committerAndré Klitzing <aklitzing@gmail.com>2015-02-11 20:59:35 +0000
commit2af127763194c13c3f7ccce507c94eb2de6dbefe (patch)
tree2c4b8e2dbde9d4fbbb0b01b910bd28631060c6b3 /tests/auto/cmake/test_add_binary_resources_delayed_file/CMakeLists.txt
parent83a5694dc21b8220bb0e5c85f24a53361b2fd478 (diff)
CMake: Introduce qt5_add_binary_resources
Optional parameter DESTINATION to set target rcc file Example: qt5_add_binary_resources(GenerateFixture "fixture.qrc") Task-number: QTBUG-41728 Change-Id: I9dc2fe8e7d5e9ad3873b89f75ab84a2a1b9d1d29 Reviewed-by: Stephen Kelly <steveire@gmail.com>
Diffstat (limited to 'tests/auto/cmake/test_add_binary_resources_delayed_file/CMakeLists.txt')
-rw-r--r--tests/auto/cmake/test_add_binary_resources_delayed_file/CMakeLists.txt24
1 files changed, 24 insertions, 0 deletions
diff --git a/tests/auto/cmake/test_add_binary_resources_delayed_file/CMakeLists.txt b/tests/auto/cmake/test_add_binary_resources_delayed_file/CMakeLists.txt
new file mode 100644
index 0000000000..e2478330ea
--- /dev/null
+++ b/tests/auto/cmake/test_add_binary_resources_delayed_file/CMakeLists.txt
@@ -0,0 +1,24 @@
+
+cmake_minimum_required(VERSION 2.8)
+
+project(test_add_binary_resources_delayed_file)
+
+find_package(Qt5Core REQUIRED)
+
+include_directories(${Qt5Core_INCLUDE_DIRS})
+
+add_definitions(${Qt5Core_DEFINITIONS})
+
+qt5_add_binary_resources(rcc_file "${CMAKE_CURRENT_BINARY_DIR}/test_add_binary_resources_delayed_file.qrc" "${CMAKE_CURRENT_SOURCE_DIR}/existing.qrc")
+
+file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/test_add_binary_resources_delayed_file.qrc" "<!DOCTYPE RCC><RCC version=\"1.0\">
+<qresource prefix=\"/\">
+ <file alias=\"resource_file.txt\">${CMAKE_CURRENT_SOURCE_DIR}/resource_file.txt</file>
+</qresource>
+</RCC>
+")
+
+set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${Qt5Core_EXECUTABLE_COMPILE_FLAGS}")
+
+add_executable(test_add_binary_resources_delayed_file main.cpp)
+target_link_libraries(test_add_binary_resources_delayed_file ${Qt5Core_LIBRARIES})