diff --git a/CMakeLists.txt b/CMakeLists.txt index 3fa1c315b3..a4316cb3a8 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -16,6 +16,7 @@ include(cmake/tinyxml2.cmake) include(cmake/zlib.cmake) if(NOT MSVC) + cmake_policy(SET CMP0058 NEW) include(third_party/cpp_rsc/cmake/modules/cpp_resource.cmake) if(NOT ANDROID AND NOT IOS) # If not cross-compiling, we can build cpp_rsc. diff --git a/cmake/embed_files.cmake b/cmake/embed_files.cmake deleted file mode 100644 index 977c1ba0cb..0000000000 --- a/cmake/embed_files.cmake +++ /dev/null @@ -1,27 +0,0 @@ -# Compilation step for static resources -# Taken from: -# https://beesbuzz.biz/code/4399-Embedding-binary-resources-with-CMake-and-C-11 -function(ADD_RESOURCES out_var) - set(result) - foreach(in_f ${ARGN}) - set(out_f "${CMAKE_CURRENT_BINARY_DIR}/${in_f}.o") - file(RELATIVE_PATH rel_path_with_file ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/${in_f}) - get_filename_component(rel_path ${rel_path_with_file} DIRECTORY) - file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/${rel_path}) - - if (APPLE) - set(binary_options -sectcreate binary) - else() - set(binary_options -b binary) - endif() - - add_custom_command(OUTPUT ${out_f} - COMMAND ld -r ${binary_options} -o ${out_f} ${CMAKE_CURRENT_SOURCE_DIR}/${in_f} - DEPENDS ${in_f} - WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} - COMMENT "Adding resource ${in_f}" - VERBATIM) - list(APPEND result ${out_f}) - endforeach() - set(${out_var} "${result}" PARENT_SCOPE) -endfunction()