diff options
author | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2011-11-07 19:53:40 +0400 |
---|---|---|
committer | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2011-11-07 19:53:40 +0400 |
commit | a6828b9c6f2ec24853cccac16bfdfae870c0d8c2 (patch) | |
tree | f97bc758915a5235f0f128c271e15e628e33ae45 /build_files | |
parent | b06db617a04e7ca378c6e38d90c37c9924207d82 (diff) |
CMake: add delayed_install macro to specify files to be installed from modules
other than source/creator.
Diffstat (limited to 'build_files')
-rw-r--r-- | build_files/cmake/macros.cmake | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/build_files/cmake/macros.cmake b/build_files/cmake/macros.cmake index ba1cdd9013b..c9a04f87148 100644 --- a/build_files/cmake/macros.cmake +++ b/build_files/cmake/macros.cmake @@ -630,3 +630,38 @@ macro(blender_project_hack_post) endif() endmacro() + +# pair of macros to allow libraries to be specify files to install, but to +# only install them at the end so the directories don't get cleared with +# the files in them. used by cycles to install addon. +macro(delayed_install + base + files + destination) + + foreach(f ${files}) + set_property(GLOBAL APPEND PROPERTY DELAYED_INSTALL_FILES ${base}/${f}) + set_property(GLOBAL APPEND PROPERTY DELAYED_INSTALL_DESTINATIONS ${destination}) + endforeach() +endmacro() + +# note this is a function instead of a macro so that ${BUILD_TYPE} in targetdir +# does not get expanded in calling but is preserved +function(delayed_do_install + targetdir) + + get_property(files GLOBAL PROPERTY DELAYED_INSTALL_FILES) + get_property(destinations GLOBAL PROPERTY DELAYED_INSTALL_DESTINATIONS) + + if(files) + list(LENGTH files n) + math(EXPR n "${n}-1") + + foreach(i RANGE ${n}) + list(GET files ${i} f) + list(GET destinations ${i} d) + install(FILES ${f} DESTINATION ${targetdir}/${d}) + endforeach() + endif() +endfunction() + |