diff options
| author | palange <palange@lindenlab.com> | 2009-11-02 12:13:14 -0800 |
|---|---|---|
| committer | palange <palange@lindenlab.com> | 2009-11-02 12:13:14 -0800 |
| commit | f891ca654dfd7ac4dfa11ff14937c444c6fc301d (patch) | |
| tree | b89abd3b702fb25570a3d8d585bbb0ce4ba73ed0 /indra/cmake/LLSharedLibs.cmake | |
| parent | 7ff2bfd0af6e124d74a7c1c9532fcffff5e0d7fe (diff) | |
| parent | cf0c0e182441e442db78ded1a7139818502ae066 (diff) | |
Automated merge with http://hg.lindenlab.com/viewer/viewer-2-0
Diffstat (limited to 'indra/cmake/LLSharedLibs.cmake')
| -rw-r--r-- | indra/cmake/LLSharedLibs.cmake | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/indra/cmake/LLSharedLibs.cmake b/indra/cmake/LLSharedLibs.cmake new file mode 100644 index 0000000000..3be22ab401 --- /dev/null +++ b/indra/cmake/LLSharedLibs.cmake @@ -0,0 +1,31 @@ +# ll_deploy_sharedlibs_command +# target_exe: the cmake target of the executable for which the shared libs will be deployed. +# search_dirs: a list of dirs to search for the dependencies +# dst_path: path to copy deps to, relative to the output location of the target_exe +macro(ll_deploy_sharedlibs_command target_exe search_dirs dst_path) + get_target_property(OUTPUT_LOCATION ${target_exe} LOCATION) + + if(DARWIN) + get_target_property(IS_BUNDLE ${target_exe} MACOSX_BUNDLE) + if(IS_BUNDLE) + get_filename_component(TARGET_FILE ${OUTPUT_LOCATION} NAME) + set(OUTPUT_PATH ${OUTPUT_LOCATION}.app/Contents/MacOS) + set(OUTPUT_LOCATION ${OUTPUT_PATH}/${TARGET_FILE}) + endif(IS_BUNDLE) + else(APPLE) + message(FATAL_ERROR "Only darwin currently supported!") + endif(DARWIN) + + add_custom_command( + TARGET ${target_exe} POST_BUILD + COMMAND ${CMAKE_COMMAND} + ARGS + "-DBIN_NAME=\"${OUTPUT_LOCATION}\"" + "-DSEARCH_DIRS=\"${search_dirs}\"" + "-DDST_PATH=\"${OUTPUT_PATH}/${dst_path}\"" + "-P" + "${CMAKE_SOURCE_DIR}/cmake/DeploySharedLibs.cmake" + ) + +endmacro(ll_deploy_sharedlibs_command) + |
