aboutsummaryrefslogtreecommitdiff
path: root/CMakeLists.txt
diff options
context:
space:
mode:
authorcrupest <crupest@outlook.com>2022-01-25 18:39:14 +0800
committercrupest <crupest@outlook.com>2022-01-25 18:39:14 +0800
commitd3aa43d9ea0dfc32935767cf60a89af2736dc339 (patch)
treee8cf043ac6d9a2e6ce038ad6b1f57079834ef129 /CMakeLists.txt
parent71c01a175a939d1a519ab235fdfdeec1101f8b84 (diff)
downloadcru-d3aa43d9ea0dfc32935767cf60a89af2736dc339.tar.gz
cru-d3aa43d9ea0dfc32935767cf60a89af2736dc339.tar.bz2
cru-d3aa43d9ea0dfc32935767cf60a89af2736dc339.zip
...
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt11
1 files changed, 11 insertions, 0 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 055a8302..4040df29 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -27,6 +27,17 @@ endif()
set(CRU_INCLUDE_DIR ${PROJECT_SOURCE_DIR}/include)
set(CRU_ASSETS_DIR ${PROJECT_SOURCE_DIR}/assets)
+function(target_add_resources target res_dir)
+ message("Add resources for target ${target} with files ${res_dir}.")
+
+ file(GLOB_RECURSE RES_SOURCES "${CRU_ASSETS_DIR}/${res_dir}/*")
+ target_sources(${target} PUBLIC ${RES_SOURCES})
+ foreach (RES_FILE ${RES_SOURCES})
+ file(RELATIVE_PATH RES_PATH ${CRU_ASSETS_DIR} ${RES_FILE})
+ set_property(SOURCE ${RES_FILE} PROPERTY MACOSX_PACKAGE_LOCATION "Resources/${RES_PATH}/..")
+ endforeach(RES_FILE)
+endfunction()
+
add_subdirectory(src)
add_subdirectory(test)
add_subdirectory(demos)