Commit 574fdec9 authored by Utkarsh Ayachit's avatar Utkarsh Ayachit

Installing pvserver etc. in the app bundle on make install.

1. Disabling generation of shared forwarding executables on mac. That's no
   longer necessary on Mac. We should use install_name_dir even when not
   installing apps (that's not currently supported, however).

2. Adding all executables to the export targets list so that projects can use
   those targets.

3. Updating ParaViewBrandingInstallApp.cmake to ensure that all executables in
   the <install_prefix>/bin directory get placed in the app bundle under
   App/Contents/bin. Since these executables already have their install_name_dir
   set to point to @executable_path/../Libraries, we don't need any shared
   forwarding and the executables find the libraries just fine.

Change-Id: I63454a5abc03ff71a076cbe56a5936097f3c8b25
parent a9913f3e
......@@ -39,4 +39,15 @@ macro(cleanup_bundle app app_root libdir pluginsdir)
TYPE DIRECTORY FILES "${python_packages_dir}"
USE_SOURCE_PERMISSIONS)
endif()
# package other executables such as pvserver.
get_filename_component(bin_dir "${app_root}" PATH)
file(GLOB executables "${bin_dir}/*")
foreach(exe IN LISTS executables)
if (EXISTS "${exe}" AND NOT IS_DIRECTORY "${exe}")
file(INSTALL "${exe}"
DESTINATION "${app_root}/Contents/bin"
USE_SOURCE_PERMISSIONS)
endif()
endforeach()
endmacro()
......@@ -389,23 +389,42 @@ macro(pv_set_link_interface_libs target)
endif()
endmacro()
#------------------------------------------------------------------------------
# replacement for vtk-add executable that also adds the install rules.
#------------------------------------------------------------------------------
include(vtkForwardingExecutable)
function(pv_add_executable name)
set (VTK_EXE_SUFFIX)
if(UNIX AND VTK_BUILD_FORWARDING_EXECUTABLES)
vtk_add_executable_with_forwarding(VTK_EXE_SUFFIX ${name} ${ARGN})
set_property(GLOBAL APPEND PROPERTY VTK_TARGETS ${name})
else()
add_executable(${name} ${ARGN})
set_property(GLOBAL APPEND PROPERTY VTK_TARGETS ${name})
endif()
pv_executable_install(${name} "${VTK_EXE_SUFFIX}")
endfunction()
#------------------------------------------------------------------------------
# Function used to add install rules for executables.
#------------------------------------------------------------------------------
function (pv_executable_install name exe_suffix)
if (exe_suffix)
# we have two executables to install, one in the bin dir and another in the
# lib dir
# install the real-binary in the lib-dir
install(TARGETS ${name}
DESTINATION ${VTK_INSTALL_LIBRARY_DIR}
if (NOT VTK_INSTALL_NO_RUNTIME)
if (exe_suffix)
# we have two executables to install, one in the bin dir and another in the
# lib dir
# install the real-binary in the lib-dir
install(TARGETS ${name}
DESTINATION ${VTK_INSTALL_LIBRARY_DIR}
COMPONENT Runtime)
endif()
# install the launcher binary in the binary dir. When exe_suffix is empty, the
# launcher binary is same as the real binary.
install(TARGETS ${name}${exe_suffix}
DESTINATION ${VTK_INSTALL_RUNTIME_DIR}
COMPONENT Runtime)
endif()
# install the launcher binary in the binary dir. When exe_suffix is empty, the
# launcher binary is same as the real binary.
install(TARGETS ${name}${exe_suffix}
DESTINATION ${VTK_INSTALL_RUNTIME_DIR}
COMPONENT Runtime)
endfunction()
......@@ -73,7 +73,6 @@ set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/lib")
include(Utilities/Git/Git.cmake)
include(ParaViewDetermineVersion)
include(CMakeDependentOption)
include(ParaViewMacros)
#------------------------------------------------------------------------------
......@@ -267,8 +266,14 @@ if (APPLE)
"Location where the *.app bundle must be installed.")
set(CMAKE_INSTALL_NAME_DIR "@executable_path/../Libraries")
set(PV_INSTALL_PLUGIN_DIR "plugins")
# ensure that we don't build forwarding executables on apple.
set(VTK_BUILD_FORWARDING_EXECUTABLES FALSE)
endif()
if (UNIX AND NOT APPLE)
set(VTK_BUILD_FORWARDING_EXECUTABLES TRUE)
endif()
#------------------------------------------------------------------------------
......@@ -380,6 +385,7 @@ else()
set (CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${VTK_CMAKE_DIR})
include(vtkModuleAPI)
include(vtkModuleMacros)
include(ParaViewMacros)
# Change VTK default, since VTK is set up to enable TK when python wrapping is
# enabled.
......
......@@ -38,21 +38,9 @@ vtk_module_dep_includes(vtkPVServerManagerApplication)
include_directories(${vtkPVServerManagerApplication_DEPENDS_INCLUDE_DIRS}
${vtkPVServerManagerApplication_INCLUDE_DIRS})
include (vtkForwardingExecutable)
# these will be removed once vtkForwardingExecutable is fixed.
set(VTK_INSTALL_BIN_DIR_CM24 ${VTK_INSTALL_RUNTIME_DIR})
set(VTK_INSTALL_LIB_DIR_CM24 ${VTK_INSTALL_LIBRARY_DIR})
foreach (name pvserver pvdataserver pvrenderserver)
vtk_add_executable_with_forwarding(exe_suffix ${name} ${name}.cxx)
#vtk_target_name(${name})
#vtk_target_label(${name})
#vtk_target_install(${name})
if (NOT VTK_INSTALL_NO_RUNTIME)
pv_executable_install(${name} "${exe_suffix}")
endif()
target_link_libraries(${name}
vtkPVServerManagerApplication)
pv_add_executable(${name} ${name}.cxx)
target_link_libraries(${name} vtkPVServerManagerApplication)
if (NOT BUILD_SHARED_LIBS)
target_link_libraries(${name} ${PARAVIEW_PLUGINLIST})
endif()
......@@ -77,13 +65,7 @@ if (PARAVIEW_ENABLE_PYTHON)
dependencies)
foreach (name pvbatch pvpython)
vtk_add_executable_with_forwarding(exe_suffix ${name} ${name}.cxx)
#vtk_target_name(${name})
#vtk_target_label(${name})
#vtk_target_install(${name})
if (NOT VTK_INSTALL_NO_RUNTIME)
pv_executable_install(${name} "${exe_suffix}")
endif()
pv_add_executable(${name} ${name}.cxx)
target_link_libraries(${name}
vtkPVServerManagerApplication
vtkPVPythonSupport
......
......@@ -57,6 +57,7 @@ vtk_add_executable_with_forwarding(out_exe_suffix
smTestDriver
vtkSMTestDriver.cxx
vtkSMTestDriver.h)
set_property(GLOBAL APPEND PROPERTY VTK_TARGETS smTestDriver)
target_link_libraries(smTestDriver
vtksys
......
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