Commit d4f96d3e authored by Sebastien Jourdain's avatar Sebastien Jourdain

Use NONRELOCATABLE_INSTALL to track PREFIX_PATH in config

parent 04d2b0c4
......@@ -124,7 +124,7 @@ if (CMAKE_CROSSCOMPILING
AND NOT PARAVIEW_COMPILE_TOOLS_IMPORTED
AND NOT DEFINED CMAKE_CROSSCOMPILING_EMULATOR
AND CMAKE_VERSION VERSION_LESS 3.8)
# if CMAKE_CROSSCOMPILING is true and full crosscompiling support is not available
# if CMAKE_CROSSCOMPILING is true and full crosscompiling support is not available
# we need to import build-tools targets.
find_package (ParaViewCompileTools REQUIRED)
# this keeps VTK sub-dir from trying to import VTKCompileTools.
......@@ -829,11 +829,25 @@ endforeach()
# We create two versions of ParaViewConfig.cmake for the build tree and the
# install tree.
# When PARAVIEW_NONRELOCATABLE_INSTALL=ON we add to ParaViewConfig.cmake
# set(PARAVIEW_PREFIX_PATH "${CMAKE_PREFIX_PATH}")
option(
PARAVIEW_NONRELOCATABLE_INSTALL
"Capture CMAKE_PREFIX_PATH in Config.cmake file for external project"
OFF
)
mark_as_advanced(PARAVIEW_NONRELOCATABLE_INSTALL)
set (paraview_prefix_path "${CMAKE_PREFIX_PATH}")
# For build tree.
set (PARAVIEW_CONFIG_INSTALLED FALSE)
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/ParaViewConfig.cmake.in
${CMAKE_CURRENT_BINARY_DIR}/ParaViewConfig.cmake @ONLY)
if (NOT PARAVIEW_NONRELOCATABLE_INSTALL)
set(paraview_prefix_path)
endif()
set (PARAVIEW_CONFIG_INSTALLED TRUE)
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/ParaViewConfig.cmake.in
${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/ParaViewConfig.cmake @ONLY)
......
......@@ -17,6 +17,14 @@ else()
set (PARAVIEW_CONFIG_TARGETS_FILE "@ParaView_BINARY_DIR@/ParaViewTargets.cmake")
endif()
#------------------------------------------------------------------------------
# Update CMAKE_PREFIX_PATH locally when PARAVIEW_NONRELOCATABLE_INSTALL=ON
#------------------------------------------------------------------------------
set(PARAVIEW_PREFIX_PATH "@paraview_prefix_path@")
set(CMAKE_PREFIX_PATH_save "${CMAKE_PREFIX_PATH}")
list(APPEND CMAKE_PREFIX_PATH "${PARAVIEW_PREFIX_PATH}")
#------------------------------------------------------------------------------
# Version information for ParaView
SET(PARAVIEW_VERSION_MAJOR "@PARAVIEW_VERSION_MAJOR@")
......@@ -122,3 +130,10 @@ endif()
# cleanup
unset(__pv_install_tree)
#------------------------------------------------------------------------------
# restore CMAKE_PREFIX_PATH
#------------------------------------------------------------------------------
set(CMAKE_PREFIX_PATH "${CMAKE_PREFIX_PATH_save}")
unset(CMAKE_PREFIX_PATH_save)
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