Skip to content

Commit

Permalink
refs #5103. Now works on Ubuntu 10.04
Browse files Browse the repository at this point in the history
  • Loading branch information
OwenArnold committed Apr 17, 2012
1 parent a223694 commit 68b62cf
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 121 deletions.
19 changes: 14 additions & 5 deletions Code/Mantid/Framework/Kernel/src/ConfigService.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1741,18 +1741,27 @@ bool ConfigServiceImpl::quickParaViewCheck() const

try
{
//Try to run "paraview -V", which will succeed if ParaView is installed.
std::string cmd("paraview");
std::vector<std::string> args;
args.push_back("-V");
Poco::Pipe outPipe;
Poco::ProcessHandle ph = Poco::Process::launch(cmd, args, 0, &outPipe, 0);
isAvailable = true;
this->g_log.information("ParaView is available");
const int rc = ph.wait();
if(rc == 1)
{
isAvailable = true;
this->g_log.notice("ParaView is available");
}
else
{
this->g_log.notice("ParaView is not available");
}
}
catch(Poco::RuntimeException& e)
catch(Poco::SystemException &e)
{
g_log.information(e.what());
this->g_log.information("ParaView is not available");
g_log.notice(e.what());
this->g_log.notice("ParaView is not available");
}
return isAvailable;
}
Expand Down
116 changes: 0 additions & 116 deletions Code/Mantid/Vates/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -24,122 +24,6 @@ set( USE_PARAVIEW ON CACHE BOOL "Create paraview plugins. " )
find_package( ParaView )
if( ParaView_FOUND AND USE_PARAVIEW )

if( ENABLE_CPACK )
message( STATUS "In Vates CPack" )
set( CPACK_PACKAGE_NAME "mantid_vates${CPACK_PACKAGE_SUFFIX}" )
include( CPackCommon )
set( CPACK_OUTPUT_CONFIG_FILE "${CMAKE_BINARY_DIR}/CPackVatesConfig.cmake" )

if( ${CMAKE_SYSTEM_NAME} STREQUAL "Linux" )
include( CPackLinuxSetup )
endif()

set( CPACK_PACKAGE_ICON "${CMAKE_SOURCE_DIR}/Images/MantidPlot_Icon_32offset.png" )
set( CPACK_RESOURCE_FILE_LICENSE ${CMAKE_SOURCE_DIR}/Installers/WinInstaller/License.txt )

if( ${CMAKE_SYSTEM_NAME} STREQUAL "Linux" )
set( TARGET_TYPE LIBRARY )
message( STATUS "VATES CPACK_PACKAGE_FILE_NAME = ${CPACK_PACKAGE_FILE_NAME}" )
message( STATUS "Linux installer available for Mantid-Vates")
endif()

if( WIN32 )
# Windows needs to have this for shared libraries install targets
set( TARGET_TYPE RUNTIME)
# This is a bug in NSIS itself, so it's not CPack's fault
set( CPACK_PACKAGE_ICON "${CMAKE_SOURCE_DIR}/Images\\\\MantidPlot_Icon_32offset.png" )
set( CPACK_NSIS_MUI_ICON "${CMAKE_SOURCE_DIR}/Images\\\\MantidPlot_Icon_32offset.ico" )
set( CPACK_NSIS_MUI_UNIICON "${CMAKE_SOURCE_DIR}/Images\\\\MantidPlot_Icon_32offset.ico" )

#On install commands.
#1) Check that MantidPath exists.
#2) Append MantidPath/../plugins directory onto path, as it contains libs MDAlgorithms, etc.
#3) Append the installdir/bin directory onto path as it contains libs MantidVatesAPI etc (required for advanced Paraview plugin loading).
#4) Point to the location of the plubin libs. Paraview will then autoload these.
set (CPACK_NSIS_EXTRA_INSTALL_COMMANDS "
ClearErrors
ReadEnvStr $R0 'MANTIDPATH'
IfErrors 0 +2
messagebox mb_ok 'Mantid may not be installed. Please check that you have installed Mantid properly.'
Push \\\"PATH\\\"
Push \\\"A\\\"
Push \\\"HKCU\\\"
Push \\\"%MANTIDPATH%\\\\..\\\\plugins\\\"
Call EnvVarUpdate
Pop \\\$0
Push \\\"PATH\\\"
Push \\\"A\\\"
Push \\\"HKCU\\\"
Push \\\"$INSTDIR\\\\plugins\\\"
Call EnvVarUpdate
Pop \\\$0
Push \\\"PATH\\\"
Push \\\"A\\\"
Push \\\"HKCU\\\"
Push \\\"$INSTDIR\\\\bin\\\"
Call EnvVarUpdate
Pop \\\$0
Push \\\"PV_PLUGIN_PATH\\\"
Push \\\"A\\\"
Push \\\"HKCU\\\"
Push \\\"$INSTDIR\\\\${PVPLUGINS_DIR}\\\"
Call EnvVarUpdate
Pop \\\$0
")

# On unistall reverse stages listed above.
set (CPACK_NSIS_EXTRA_UNINSTALL_COMMANDS "Push \\\"PATH\\\"
Push \\\"R\\\"
Push \\\"HKCU\\\"
Push \\\"%MANTIDPATH%\\\\..\\\\plugins\\\"
Call un.EnvVarUpdate
Pop \\\$0
Push \\\"PATH\\\"
Push \\\"R\\\"
Push \\\"HKCU\\\"
Push \\\"$INSTDIR\\\\plugins\\\"
Call un.EnvVarUpdate
Pop \\\$0
Push \\\"PATH\\\"
Push \\\"R\\\"
Push \\\"HKCU\\\"
Push \\\"$INSTDIR\\\\bin\\\"
Call un.EnvVarUpdate
Pop \\\$0
Push \\\"PV_PLUGIN_PATH\\\"
Push \\\"R\\\"
Push \\\"HKCU\\\"
Push \\\"$INSTDIR\\\\${PVPLUGINS_DIR}\\\"
Call un.EnvVarUpdate
Pop \\\$0
")

set( CPACK_GENERATOR "NSIS" )
message( STATUS "Windows-NSIS installer available for Mantid-Vates")
endif()

# Pickup all Vates projects
set( CPACK_INSTALL_CMAKE_PROJECTS "${CMAKE_BINARY_DIR}/Vates" "Vates" "ALL" "/" )
set( CPACK_PACKAGE_EXECUTABLES "VatesSimpleGui" "VatesSimpleGui" )

# Set dependency on Mantid. Need to add ParaView
set( CPACK_RPM_PACKAGE_REQUIRES "mantid${CPACK_PACKAGE_SUFFIX} = ${CPACK_PACKAGE_VERSION}" )
set( CPACK_DEBIAN_PACKAGE_DEPENDS "mantid${CPACK_PACKAGE_SUFFIX} (=${CPACK_PACKAGE_VERSION})" )

# Create target for Vates package creation
add_custom_target( package-vates COMMAND ${CMAKE_CPACK_COMMAND} --config ${CPACK_OUTPUT_CONFIG_FILE} )

# run cpack configuration
include( CPack )
endif()

include( ${PARAVIEW_USE_FILE} )
add_subdirectory( VatesAPI )
add_subdirectory( ParaviewPlugins )
Expand Down

0 comments on commit 68b62cf

Please sign in to comment.