Commit 8995e1c5 authored by jcfr's avatar jcfr

COMP: Simplify and fix definition of INSTALL dir

FreeSurfer library use INSTALL_SHARE_DIR instead of directly relying on
the value of Slicer_INSTALL_ROOT

BIN and LIB directory of either plugins, qt loadable and scripted modules
should be the same.

git-svn-id: http://svn.slicer.org/Slicer4/trunk@16772 3bd1e089-480b-0410-8dfb-8563597acbee
parent 3aff076b
......@@ -190,26 +190,21 @@ SET(Slicer_LIB_DIR "lib/Slicer3")
SET(Slicer_INCLUDE_DIR "include/Slicer")
SET(Slicer_SHARE_DIR "share/Slicer")
SET(Slicer_ITKFACTORIES_DIR "${Slicer_LIB_DIR}/ITKFactories")
SET(Slicer_INSTALL_ROOT "")
SET(Slicer_INSTALL_ROOT "")
IF(APPLE)
# Set to create Bundle
SET(Slicer_BUNDLE_LOCATION "Slicer.app/Contents")
SET(Slicer_INSTALL_ROOT "${Slicer_BUNDLE_LOCATION}")
SET(Slicer_INSTALL_BIN_DIR "${Slicer_BUNDLE_LOCATION}/${Slicer_BIN_DIR}")
SET(Slicer_INSTALL_LIB_DIR "${Slicer_BUNDLE_LOCATION}/${Slicer_LIB_DIR}")
SET(Slicer_INSTALL_INCLUDE_DIR "${Slicer_BUNDLE_LOCATION}/${Slicer_INCLUDE_DIR}")
SET(Slicer_PYTHON_INSTALL_DIR "${Slicer_INSTALL_BIN_DIR}")
SET(Slicer_INSTALL_SHARE_DIR "${Slicer_BUNDLE_LOCATION}/${Slicer_SHARE_DIR}")
SET(Slicer_INSTALL_ITKFACTORIES_DIR "${Slicer_INSTALL_LIB_DIR}/ITKFactories")
ELSE()
SET(Slicer_INSTALL_BIN_DIR "bin")
SET(Slicer_INSTALL_LIB_DIR "lib/Slicer3")
SET(Slicer_PYTHON_INSTALL_DIR ${Slicer_INSTALL_BIN_DIR})
SET(Slicer_INSTALL_ITKFACTORIES_DIR "${Slicer_INSTALL_LIB_DIR}/ITKFactories")
SET(Slicer_INSTALL_ROOT "${Slicer_BUNDLE_LOCATION}/")
ENDIF()
SET(Slicer_INSTALL_BIN_DIR "${Slicer_INSTALL_ROOT}${Slicer_BIN_DIR}")
SET(Slicer_INSTALL_LIB_DIR "${Slicer_INSTALL_ROOT}${Slicer_LIB_DIR}")
SET(Slicer_INSTALL_INCLUDE_DIR "${Slicer_INSTALL_ROOT}${Slicer_INCLUDE_DIR}")
SET(Slicer_INSTALL_SHARE_DIR "${Slicer_INSTALL_ROOT}${Slicer_SHARE_DIR}")
SET(Slicer_PYTHON_INSTALL_DIR ${Slicer_INSTALL_BIN_DIR})
SET(Slicer_INSTALL_ITKFACTORIES_DIR "${Slicer_INSTALL_LIB_DIR}/ITKFactories")
#-----------------------------------------------------------------------------
# Qt - Slicer_REQUIRED_QT_MODULES
#-----------------------------------------------------------------------------
......@@ -262,17 +257,17 @@ SET(Slicer_VERSION_FULL "${Slicer_VERSION}.${Slicer_VERSION_PATCH}")
# Plugins and Modules install directories
#------------------------------------------------------------------------------
SET(Slicer_PLUGINS_BIN_DIR "${Slicer_BIN_DIR}")
SET(Slicer_PLUGINS_BIN_DIR "${Slicer_LIB_DIR}/Plugins")
SET(Slicer_PLUGINS_LIB_DIR "${Slicer_LIB_DIR}/Plugins")
SET(Slicer_PLUGINS_INCLUDE_DIR "${Slicer_INCLUDE_DIR}/Plugins")
SET(Slicer_PLUGINS_SHARE_DIR "${Slicer_SHARE_DIR}/Plugins")
SET(Slicer_PLUGINS_CACHE_DIR "${Slicer_LIB_DIR}/PluginsCache")
SET(Slicer_INSTALL_PLUGINS_BIN_DIR "${Slicer_INSTALL_BIN_DIR}")
SET(Slicer_INSTALL_PLUGINS_LIB_DIR "${Slicer_INSTALL_LIB_DIR}/Plugins")
SET(Slicer_INSTALL_PLUGINS_INCLUDE_DIR "${Slicer_INSTALL_INCLUDE_DIR}/Plugins")
SET(Slicer_INSTALL_PLUGINS_SHARE_DIR "${Slicer_INSTALL_SHARE_DIR}/Plugins")
SET(Slicer_INSTALL_PLUGINS_CACHE_DIR "${Slicer_INSTALL_LIB_DIR}/PluginsCache")
SET(Slicer_INSTALL_PLUGINS_BIN_DIR "${Slicer_INSTALL_ROOT}${Slicer_PLUGINS_BIN_DIR}")
SET(Slicer_INSTALL_PLUGINS_LIB_DIR "${Slicer_INSTALL_ROOT}${Slicer_PLUGINS_LIB_DIR}")
SET(Slicer_INSTALL_PLUGINS_INCLUDE_DIR "${Slicer_INSTALL_ROOT}${Slicer_PLUGINS_INCLUDE_DIR}")
SET(Slicer_INSTALL_PLUGINS_SHARE_DIR "${Slicer_INSTALL_ROOT}${Slicer_PLUGINS_SHARE_DIR}")
SET(Slicer_INSTALL_PLUGINS_CACHE_DIR "${Slicer_INSTALL_ROOT}${Slicer_PLUGINS_CACHE_DIR}")
SET(Slicer_HOME "${Slicer_BINARY_DIR}")
......@@ -460,27 +455,27 @@ SET(vtkITK_DIR ${Slicer_BINARY_DIR}/Libs/vtkITK)
# Qt Loadable and Scripted Modules
#-----------------------------------------------------------------------------
IF(Slicer_BUILD_QTLOADABLEMODULES)
SET(Slicer_QTLOADABLEMODULES_BIN_DIR "${Slicer_BIN_DIR}/QTLoadableModules")
SET(Slicer_QTLOADABLEMODULES_BIN_DIR "${Slicer_LIB_DIR}/QTLoadableModules")
SET(Slicer_QTLOADABLEMODULES_LIB_DIR "${Slicer_LIB_DIR}/QTLoadableModules")
SET(Slicer_QTLOADABLEMODULES_INCLUDE_DIR "${Slicer_INCLUDE_DIR}/QTLoadableModules")
SET(Slicer_QTLOADABLEMODULES_SHARE_DIR "${Slicer_SHARE_DIR}/QTLoadableModules")
SET(Slicer_INSTALL_QTLOADABLEMODULES_BIN_DIR "${Slicer_INSTALL_LIB_DIR}/QTLoadableModules")
SET(Slicer_INSTALL_QTLOADABLEMODULES_LIB_DIR "${Slicer_INSTALL_LIB_DIR}/QTLoadableModules")
SET(Slicer_INSTALL_QTLOADABLEMODULES_INCLUDE_DIR "${Slicer_INSTALL_INCLUDE_DIR}/QTLoadableModules")
SET(Slicer_INSTALL_QTLOADABLEMODULES_SHARE_DIR "${Slicer_INSTALL_SHARE_DIR}/QTLoadableModules")
SET(Slicer_INSTALL_QTLOADABLEMODULES_BIN_DIR "${Slicer_INSTALL_ROOT}${Slicer_QTLOADABLEMODULES_BIN_DIR}")
SET(Slicer_INSTALL_QTLOADABLEMODULES_LIB_DIR "${Slicer_INSTALL_ROOT}${Slicer_QTLOADABLEMODULES_LIB_DIR}")
SET(Slicer_INSTALL_QTLOADABLEMODULES_INCLUDE_DIR "${Slicer_INSTALL_ROOT}${Slicer_QTLOADABLEMODULES_INCLUDE_DIR}")
SET(Slicer_INSTALL_QTLOADABLEMODULES_SHARE_DIR "${Slicer_INSTALL_ROOT}${Slicer_QTLOADABLEMODULES_SHARE_DIR}")
ENDIF()
IF(Slicer_BUILD_QTSCRIPTEDMODULES)
SET(Slicer_QTSCRIPTEDMODULES_BIN_DIR "${Slicer_BIN_DIR}/QTScriptedModules")
SET(Slicer_QTSCRIPTEDMODULES_BIN_DIR "${Slicer_LIB_DIR}/QTScriptedModules")
SET(Slicer_QTSCRIPTEDMODULES_LIB_DIR "${Slicer_LIB_DIR}/QTScriptedModules")
SET(Slicer_QTSCRIPTEDMODULES_INCLUDE_DIR "${Slicer_INCLUDE_DIR}/QTScriptedModules")
SET(Slicer_QTSCRIPTEDMODULES_SHARE_DIR "${Slicer_SHARE_DIR}/QTScriptedModules")
SET(Slicer_INSTALL_QTSCRIPTEDMODULES_BIN_DIR "${Slicer_INSTALL_BIN_DIR}/QTScriptedModules")
SET(Slicer_INSTALL_QTSCRIPTEDMODULES_LIB_DIR "${Slicer_INSTALL_LIB_DIR}/QTScriptedModules")
SET(Slicer_INSTALL_QTSCRIPTEDMODULES_INCLUDE_DIR "${Slicer_INSTALL_INCLUDE_DIR}/QTScriptedModules")
SET(Slicer_INSTALL_QTSCRIPTEDMODULES_SHARE_DIR "${Slicer_INSTALL_SHARE_DIR}/QTScriptedModules")
SET(Slicer_INSTALL_QTSCRIPTEDMODULES_BIN_DIR "${Slicer_INSTALL_ROOT}${Slicer_QTSCRIPTEDMODULES_BIN_DIR}")
SET(Slicer_INSTALL_QTSCRIPTEDMODULES_LIB_DIR "${Slicer_INSTALL_ROOT}${Slicer_QTSCRIPTEDMODULES_LIB_DIR}")
SET(Slicer_INSTALL_QTSCRIPTEDMODULES_INCLUDE_DIR "${Slicer_INSTALL_ROOT}${Slicer_QTSCRIPTEDMODULES_INCLUDE_DIR}")
SET(Slicer_INSTALL_QTSCRIPTEDMODULES_SHARE_DIR "${Slicer_INSTALL_ROOT}${Slicer_QTSCRIPTEDMODULES_SHARE_DIR}")
ENDIF()
......
......@@ -114,6 +114,7 @@ SET(Slicer_Libs_VTK_WRAPPED_LIBRARIES
FOREACH(dir ${dirs})
SET(${dir}_INSTALL_BIN_DIR ${Slicer_INSTALL_LIB_DIR})
SET(${dir}_INSTALL_LIB_DIR ${Slicer_INSTALL_LIB_DIR})
SET(${dir}_INSTALL_SHARE_DIR ${Slicer_INSTALL_ROOT}share/${dir})
SET(${dir}_INSTALL_NO_DEVELOPMENT ${Slicer_INSTALL_NO_DEVELOPMENT})
SET(${dir}_EXPORT_FILE ${Slicer_BINARY_DIR}/SlicerTargets.cmake)
ADD_SUBDIRECTORY(${dir})
......
......@@ -107,6 +107,9 @@ ENDIF()
IF(NOT DEFINED ${PROJECT_NAME}_INSTALL_LIB_DIR)
SET(${PROJECT_NAME}_INSTALL_LIB_DIR lib/${PROJECT_NAME})
ENDIF()
IF(NOT DEFINED ${PROJECT_NAME}_INSTALL_SHARE_DIR)
SET(${PROJECT_NAME}_INSTALL_SHARE_DIR share/${PROJECT_NAME})
ENDIF()
INSTALL(TARGETS ${lib_name}
RUNTIME DESTINATION ${${PROJECT_NAME}_INSTALL_BIN_DIR} COMPONENT RuntimeLibraries
......@@ -147,7 +150,7 @@ endforeach()
install(
FILES ${RESFILES}
DESTINATION ${Slicer_INSTALL_ROOT}/share/${PROJECT_NAME}
DESTINATION ${${PROJECT_NAME}_INSTALL_SHARE_DIR}
)
# --------------------------------------------------------------------------
......@@ -184,7 +187,7 @@ IF(NOT ${PROJECT_NAME}_INSTALL_NO_DEVELOPMENT)
install(DIRECTORY
Testing
DESTINATION ${Slicer_INSTALL_SHARE_DIR}/${PROJECT_NAME} COMPONENT Development
DESTINATION ${${PROJECT_NAME}_INSTALL_SHARE_DIR} COMPONENT Development
PATTERN "*.cxx" EXCLUDE
PATTERN ".svn" EXCLUDE
PATTERN "*.tcl" EXCLUDE
......
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