Commit 93b165f2 authored by Chuck Atkins's avatar Chuck Atkins
Browse files

Move ParaView CMake file fixup to a step in ParaView's build

parent 97f7b388
......@@ -172,3 +172,15 @@ endif ()
if (DEFINED CMAKE_BUILD_TYPE_save)
set(CMAKE_BUILD_TYPE "${CMAKE_BUILD_TYPE_save}")
endif ()
if (paraview_install_development_files)
find_program(SED_EXECUTABLE sed)
mark_as_advanced(SED_EXECUTABLE)
if (SED_EXECUTABLE)
superbuild_project_add_step("fixupcmakepaths"
COMMAND "${CMAKE_COMMAND}"
-P "${CMAKE_CURRENT_LIST_DIR}/scripts/paraview.fixupcmakepaths.cmake"
DEPENDEES install
WORKING_DIRECTORY <INSTALL_DIR>)
endif ()
endif ()
file(GLOB pv_cmake_dir "${CMAKE_CURRENT_BINARY_DIR}/lib/cmake/paraview-*")
file(GLOB cmake_files
"${pv_cmake_dir}/ParaViewTargets*.cmake"
"${pv_cmake_dir}/VTKConfig.cmake")
foreach (cmake_file IN LISTS cmake_files)
execute_process(
COMMAND sed -e "s|${CMAKE_CURRENT_BINARY_DIR}|\${_IMPORT_PREFIX}|g"
-i "${cmake_file}"
RESULT_VARIABLE RES)
if (NOT RES EQUAL 0)
message(FATAL_ERROR "Failed to patch ${cmake_file}")
endif ()
endforeach ()
set(cmake_file "${pv_cmake_dir}/Modules/vtkCommonCore.cmake")
execute_process(
COMMAND sed -e "s|${CMAKE_CURRENT_BINARY_DIR}|\${VTK_INSTALL_PREFIX}|g"
-i "${cmake_file}"
RESULT_VARIABLE RES)
if (NOT RES EQUAL 0)
message(FATAL_ERROR "Failed to patch ${cmake_file}")
endif ()
......@@ -5,17 +5,6 @@ include(paraview.bundle.common)
set(plugins_file "${CMAKE_CURRENT_BINARY_DIR}/paraview.plugins")
paraview_add_plugin("${plugins_file}" ${paraview_plugins})
# Workaround to patch any hard-coded paths to the build folder
install(CODE "
file(GLOB_RECURSE cmake_files \"${superbuild_install_location}/lib/*.cmake\")
foreach (cmake_file IN LISTS cmake_files)
execute_process(
COMMAND sed
-i
-e \"s|${superbuild_install_location}|\\\${_IMPORT_PREFIX}|g\"
\${cmake_file})
endforeach ()"
COMPONENT superbuild)
get_filename_component(real_superbuild_install_location "${superbuild_install_location}" REALPATH)
# Install ParaView CMake files
......@@ -97,7 +86,6 @@ foreach (cmake_file IN LISTS cmake_files)
file(STRINGS "${cmake_file}" lines REGEX "\\\${_IMPORT_PREFIX}[^;\\\">]+")
foreach (line IN LISTS lines)
string(REGEX MATCHALL "\\\${_IMPORT_PREFIX}[^;\\\">]+" fnames "${line}")
list(APPEND libraries_referenced_by_cmake
${fnames})
endforeach ()
......
Supports Markdown
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