summaryrefslogtreecommitdiff
path: root/indra/cmake/LLSharedLibs.cmake
diff options
context:
space:
mode:
authorXiaohong Bao <bao@lindenlab.com>2009-11-03 15:55:53 -0700
committerXiaohong Bao <bao@lindenlab.com>2009-11-03 15:55:53 -0700
commit81e719387983990fe0a2a197a6e09059219c119a (patch)
treef9f8b1bcab20e99413311f758dac521a3093050b /indra/cmake/LLSharedLibs.cmake
parenteaa1ce61b084f23746934e0a7b899242045d691b (diff)
parent9637333708a84a73784248cb842df68e520a311a (diff)
merge
Diffstat (limited to 'indra/cmake/LLSharedLibs.cmake')
-rw-r--r--indra/cmake/LLSharedLibs.cmake31
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..a8c81609bb
--- /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(DARWIN)
+ 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)
+