Commit b68dfcc4 authored by Chuck Atkins's avatar Chuck Atkins
Browse files

Rework unix dependencies for sdk to exclude external deps

parent 66918b07
set_property(GLOBAL PROPERTY superbuild_install_no_external_dependencies TRUE)
include(paraview-version)
set(CPACK_PACKAGE_NAME "ParaViewSDK")
......@@ -5,6 +6,7 @@ set(package_filename "${PARAVIEWSDK_PACKAGE_FILE_NAME}")
include(paraview.bundle)
get_filename_component(real_superbuild_install_location "${superbuild_install_location}" REALPATH)
string(LENGTH "${real_superbuild_install_location}" real_sbinst_len)
# Install ParaView CMake files
install(
......@@ -134,8 +136,20 @@ endfunction ()
function (_install_superbuild_file type fname)
get_filename_component(fname_dir "${fname}" DIRECTORY)
get_filename_component(fname_inst "${fname_dir}" REALPATH)
string(REPLACE "${real_superbuild_install_location}/" "" fname_inst "${fname_inst}")
get_filename_component(fname_dir_real "${fname_dir}" REALPATH)
# Verify that what we're installing is from the temporary install tree
string(SUBSTRING "${fname_dir}" 0 ${real_sbinst_len} fname_dir_prefix)
if (NOT (fname_dir_prefix STREQUAL real_superbuild_install_location))
return()
endif ()
string(SUBSTRING "${fname_dir_real}" 0 ${real_sbinst_len} fname_dir_real_prefix)
if (NOT (fname_dir_real_prefix STREQUAL real_superbuild_install_location))
return()
endif ()
math(EXPR real_sbinst_len_plus_one "${real_sbinst_len} + 1")
string(SUBSTRING "${fname_dir}" ${real_sbinst_len_plus_one} -1 fname_inst)
install(
"${type}" "${fname}"
DESTINATION "${fname_inst}"
......@@ -158,10 +172,6 @@ set(dependency_search_paths
"${real_superbuild_install_location}/lib/python2.7/site-packages"
"${real_superbuild_install_location}/lib/python2.7/lib-dynload")
foreach (fname IN LISTS libraries_to_install binaries_to_install)
if (NOT ("${fname}" MATCHES "^(${real_superbuild_install_location}|${superbuild_install_location})/"))
continue ()
endif ()
# Install static libraries separately.
if (fname MATCHES "\\${CMAKE_STATIC_LIBRARY_SUFFIX}$")
install_superbuild_static_library("${fname}")
......@@ -197,46 +207,21 @@ foreach (fname IN LISTS libraries_to_install binaries_to_install)
endif ()
endif ()
# The TBB libraries are special.
if (fname MATCHES "libtbb(|_malloc)")
install_superbuild_binary("${fname}")
continue ()
endif ()
list_append_unique(all_binaries
"${fname}")
# We still want to install a symlink but only perform dependency resolution
# on actual files.
if (IS_SYMLINK "${fname}")
continue ()
endif ()
get_prerequisites("${fname}" dependencies 1 1 "" "${dependency_search_paths}")
if (NOT dependencies)
continue ()
endif ()
# Drop any dependency outside the superbuild.
list(FILTER dependencies INCLUDE REGEX "^(${real_superbuild_install_location}|${superbuild_install_location})/")
foreach (dep IN LISTS dependencies)
if (IS_SYMLINK "${dep}")
# Symlinks better not cross the root directory. Bad install, bad.
get_filename_component(resolved_dep "${dep}" REALPATH)
list_append_unique(all_binaries
"${resolved_dep}")
endif ()
list_append_unique(all_binaries
"${dep}")
endforeach ()
list(APPEND bins_and_deps "${fname}")
execute_process(
COMMAND ldd "${fname}"
COMMAND grep -iv "not found"
COMMAND awk [=[($2 == "=>") && ($3 ~ /^\//) {print $3}]=]
ERROR_QUIET
OUTPUT_VARIABLE ldd_out
OUTPUT_STRIP_TRAILING_WHITESPACE
)
string(REPLACE "\n" ";" ldd_out "${ldd_out}")
list(APPEND bins_and_deps ${ldd_out})
endforeach ()
# Now install all dependencies in the same location they exist in the
# superbuild install tree.
foreach (fname IN LISTS all_binaries)
install_superbuild_binary("${fname}")
if (bins_and_deps)
list(REMOVE_DUPLICATES bins_and_deps)
endif ()
foreach (f IN LISTS bins_and_deps)
install_superbuild_binary("${f}")
endforeach ()
Subproject commit 51ec8e0ef43c5e540fa7ade4fe5f47b55abecae5
Subproject commit f1eed16d47adfc4b06b0ec898c88201b13d64783
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment