summaryrefslogtreecommitdiff
path: root/indra
diff options
context:
space:
mode:
Diffstat (limited to 'indra')
-rw-r--r--indra/cmake/LLSharedLibs.cmake87
-rw-r--r--indra/llcommon/CMakeLists.txt42
-rw-r--r--indra/mac_crash_logger/CMakeLists.txt6
-rw-r--r--indra/mac_updater/CMakeLists.txt5
-rw-r--r--indra/test_apps/llplugintest/CMakeLists.txt6
-rw-r--r--indra/win_crash_logger/CMakeLists.txt5
-rw-r--r--indra/win_updater/CMakeLists.txt7
7 files changed, 67 insertions, 91 deletions
diff --git a/indra/cmake/LLSharedLibs.cmake b/indra/cmake/LLSharedLibs.cmake
index 28f0e7ad12..6f602680f4 100644
--- a/indra/cmake/LLSharedLibs.cmake
+++ b/indra/cmake/LLSharedLibs.cmake
@@ -1,49 +1,74 @@
-
-if(DARWIN)
- set(TMP_PATH "../Resource")
-elseif(LINUX)
- set(TMP_PATH "../lib")
-else(DARWIN)
- set(TMP_PATH ".")
-endif(DARWIN)
-
- set(SHARED_LIB_REL_PATH ${TMP_PATH} CACHE STRING "Relative path from executable to shared libs")
-
# 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)
- get_filename_component(OUTPUT_PATH ${OUTPUT_LOCATION} PATH)
-
+macro(ll_deploy_sharedlibs_command target_exe)
+ get_target_property(TARGET_LOCATION ${target_exe} LOCATION)
+ get_filename_component(OUTPUT_PATH ${TARGET_LOCATION} PATH)
+
if(DARWIN)
+ set(SEARCH_DIRS "${SHARED_LIB_STAGING_DIR}/${CMAKE_CFG_INTDIR}/Resources")
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})
+ # If its a bundle the exe is not in the target location, this should find it.
+ get_filename_component(TARGET_FILE ${TARGET_LOCATION} NAME)
+ set(OUTPUT_PATH ${TARGET_LOCATION}.app/Contents/MacOS)
+ set(TARGET_LOCATION ${OUTPUT_PATH}/${TARGET_FILE})
+ set(OUTPUT_PATH ${OUTPUT_PATH}/../Resources)
endif(IS_BUNDLE)
+ elseif(WINDOWS)
+ set(SEARCH_DIRS "${SHARED_LIB_STAGING_DIR}/${CMAKE_CFG_INTDIR}" "$ENV{SystemRoot}/system32")
+ elseif(LINUX)
+ set(SEARCH_DIRS "${SHARED_LIB_STAGING_DIR}")
+ set(OUTPUT_PATH ${OUTPUT_PATH}/lib)
endif(DARWIN)
- if(WINDOWS)
- set(REAL_SEARCH_DIRS ${search_dirs} "$ENV{SystemRoot}/system32")
- endif(WINDOWS)
-
- if(LINUX)
- message(FATAL_ERROR "LINUX Unsupported!?!")
- endif(LINUX)
-
add_custom_command(
TARGET ${target_exe} POST_BUILD
COMMAND ${CMAKE_COMMAND}
ARGS
- "-DBIN_NAME=\"${OUTPUT_LOCATION}\""
- "-DSEARCH_DIRS=\"${REAL_SEARCH_DIRS}\""
- "-DDST_PATH=\"${OUTPUT_PATH}/${dst_path}\""
+ "-DBIN_NAME=\"${TARGET_LOCATION}\""
+ "-DSEARCH_DIRS=\"${SEARCH_DIRS}\""
+ "-DDST_PATH=\"${OUTPUT_PATH}\""
"-P"
"${CMAKE_SOURCE_DIR}/cmake/DeploySharedLibs.cmake"
)
endmacro(ll_deploy_sharedlibs_command)
+# ll_stage_sharedlib
+# Performs config and adds a copy command for a sharedlib target.
+macro(ll_stage_sharedlib DSO_TARGET)
+ if(SHARED_LIB_STAGING_DIR)
+ # target gets written to the DLL staging directory.
+ # Also this directory is shared with RunBuildTest.cmake, y'know, for the tests.
+ set_target_properties(${DSO_TARGET} PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${SHARED_LIB_STAGING_DIR})
+ if(NOT WINDOWS)
+ get_target_property(DSO_PATH ${DSO_TARGET} LOCATION)
+ get_filename_component(DSO_FILE ${DSO_PATH} NAME)
+ if(DARWIN)
+ set(SHARED_LIB_STAGING_DIR_CONFIG ${SHARED_LIB_STAGING_DIR}/${CMAKE_CFG_INTDIR}/Resources)
+ else(DARWIN)
+ set(SHARED_LIB_STAGING_DIR_CONFIG ${SHARED_LIB_STAGING_DIR}/${CMAKE_CFG_INTDIR})
+ endif(DARWIN)
+
+ # *TODO - maybe make this a symbolic link? -brad
+ add_custom_command(
+ TARGET ${DSO_TARGET} POST_BUILD
+ COMMAND ${CMAKE_COMMAND}
+ ARGS
+ -E
+ copy_if_different
+ ${DSO_PATH}
+ ${SHARED_LIB_STAGING_DIR_CONFIG}/${DSO_FILE}
+ COMMENT "Copying llcommon to the staging folder."
+ )
+ endif(NOT WINDOWS)
+ endif(SHARED_LIB_STAGING_DIR)
+
+ if (DARWIN)
+ set_target_properties(${DSO_TARGET} PROPERTIES
+ BUILD_WITH_INSTALL_RPATH 1
+ INSTALL_NAME_DIR "@executable_path/../Resources"
+ )
+ endif(DARWIN)
+
+endmacro(ll_stage_sharedlib) \ No newline at end of file
diff --git a/indra/llcommon/CMakeLists.txt b/indra/llcommon/CMakeLists.txt
index ea36e65729..f40359790a 100644
--- a/indra/llcommon/CMakeLists.txt
+++ b/indra/llcommon/CMakeLists.txt
@@ -1,3 +1,4 @@
+
# -*- cmake -*-
project(llcommon)
@@ -6,8 +7,8 @@ include(00-Common)
include(LLCommon)
include(Linking)
include(Boost)
-include (Pth)
-
+include(Pth)
+include(LLSharedLibs)
include(Copy3rdPartyLibs)
include_directories(
@@ -241,42 +242,7 @@ list(APPEND llcommon_SOURCE_FILES ${llcommon_HEADER_FILES})
if(LLCOMMON_LINK_SHARED)
add_library (llcommon SHARED ${llcommon_SOURCE_FILES})
-
- if(SHARED_LIB_STAGING_DIR)
- # *FIX:Mani ---
- # llcommon.dll get written to the DLL staging directory.
- # Also this directory is shared with RunBuildTest.cmake, y'know, for the tests.
- set_target_properties(llcommon PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${SHARED_LIB_STAGING_DIR})
- if(NOT WINDOWS)
- get_target_property(LLCOMMON_PATH llcommon LOCATION)
- get_filename_component(LLCOMMON_FILE ${LLCOMMON_PATH} NAME)
- if(DARWIN)
- set(SHARED_LIB_STAGING_DIR_CONFIG ${SHARED_LIB_STAGING_DIR}/${CMAKE_CFG_INTDIR}/Resources)
- else(DARWIN)
- set(SHARED_LIB_STAGING_DIR_CONFIG ${SHARED_LIB_STAGING_DIR}/${CMAKE_CFG_INTDIR})
- endif(DARWIN)
-
- # *TODO - maybe make this a symbolic link? -brad
- add_custom_command(
- TARGET llcommon POST_BUILD
- COMMAND ${CMAKE_COMMAND}
- ARGS
- -E
- copy_if_different
- ${LLCOMMON_PATH}
- ${SHARED_LIB_STAGING_DIR_CONFIG}/${LLCOMMON_FILE}
- COMMENT "Copying llcommon to the staging folder."
- )
- endif(NOT WINDOWS)
- endif(SHARED_LIB_STAGING_DIR)
-
- if (DARWIN)
- set_target_properties(llcommon PROPERTIES
- BUILD_WITH_INSTALL_RPATH 1
- INSTALL_NAME_DIR "@executable_path/../Resources"
- )
- endif(DARWIN)
-
+ ll_stage_sharedlib(llcommon)
else(LLCOMMON_LINK_SHARED)
add_library (llcommon ${llcommon_SOURCE_FILES})
endif(LLCOMMON_LINK_SHARED)
diff --git a/indra/mac_crash_logger/CMakeLists.txt b/indra/mac_crash_logger/CMakeLists.txt
index 1c5a37c4c5..420e836e36 100644
--- a/indra/mac_crash_logger/CMakeLists.txt
+++ b/indra/mac_crash_logger/CMakeLists.txt
@@ -75,8 +75,6 @@ add_custom_command(
${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/mac-crash-logger.app/Contents/Resources/CrashReporter.nib
)
-ll_deploy_sharedlibs_command(
- mac-crash-logger
- "${SHARED_LIB_STAGING_DIR}/${CMAKE_CFG_INTDIR};${ARCH_PREBUILT_DIRS}"
- "../Resources")
+ll_deploy_sharedlibs_command(mac-crash-logger)
+
diff --git a/indra/mac_updater/CMakeLists.txt b/indra/mac_updater/CMakeLists.txt
index d7bd6f993c..57d426aa24 100644
--- a/indra/mac_updater/CMakeLists.txt
+++ b/indra/mac_updater/CMakeLists.txt
@@ -77,7 +77,4 @@ add_custom_command(
${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/mac-updater.app/Contents/Resources/AutoUpdater.nib
)
-ll_deploy_sharedlibs_command(
- mac-updater
- "${SHARED_LIB_STAGING_DIR}/${CMAKE_CFG_INTDIR};${ARCH_PREBUILT_DIRS}"
- "../Resources")
+ll_deploy_sharedlibs_command(mac-updater)
diff --git a/indra/test_apps/llplugintest/CMakeLists.txt b/indra/test_apps/llplugintest/CMakeLists.txt
index 400f63cef0..0011daaec6 100644
--- a/indra/test_apps/llplugintest/CMakeLists.txt
+++ b/indra/test_apps/llplugintest/CMakeLists.txt
@@ -488,8 +488,4 @@ if(WINDOWS)
endif(WINDOWS)
-ll_deploy_sharedlibs_command(
- llmediaplugintest
- "${SHARED_LIB_STAGING_DIR}/${CMAKE_CFG_INTDIR};${ARCH_PREBUILT_DIRS}"
- ${SHARED_LIB_REL_PATH}
- )
+ll_deploy_sharedlibs_command(llmediaplugintest)
diff --git a/indra/win_crash_logger/CMakeLists.txt b/indra/win_crash_logger/CMakeLists.txt
index e141d7aa52..990dc6783e 100644
--- a/indra/win_crash_logger/CMakeLists.txt
+++ b/indra/win_crash_logger/CMakeLists.txt
@@ -89,7 +89,4 @@ if (WINDOWS)
)
endif (WINDOWS)
-ll_deploy_sharedlibs_command(
- windows-crash-logger
- "${SHARED_LIB_STAGING_DIR}/${CMAKE_CFG_INTDIR}"
- ".")
+ll_deploy_sharedlibs_command(windows-crash-logger) \ No newline at end of file
diff --git a/indra/win_updater/CMakeLists.txt b/indra/win_updater/CMakeLists.txt
index 9e18555ea9..82347adf20 100644
--- a/indra/win_updater/CMakeLists.txt
+++ b/indra/win_updater/CMakeLists.txt
@@ -34,8 +34,5 @@ set_target_properties(windows-updater
LINK_FLAGS_DEBUG "/NODEFAULTLIB:\"LIBCMT;LIBCMTD;MSVCRT\""
)
-# The windows-updater
-#ll_deploy_sharedlibs_command(
-# windows-updater
-# "${SHARED_LIB_STAGING_DIR}/${CMAKE_CFG_INTDIR}"
-# ".")
+# The windows-updater doesn't link against anything non-system, apparently
+#ll_deploy_sharedlibs_command(windows-updater) \ No newline at end of file