Commit 3b168f50 authored by andy's avatar andy
Browse files

ENH: Start integrating packaging code

git-svn-id: http://svn.slicer.org/Slicer4/trunk@286 3bd1e089-480b-0410-8dfb-8563597acbee
parent 368503b5
......@@ -33,6 +33,7 @@ TARGET_LINK_LIBRARIES( Slicer3
ITKCommon
ITKIO
${KWWidgets_LIBRARIES} )
INSTALL_TARGETS(/bin Slicer3)
# Generate a lightweight C launcher for a *specific* executable.
# The launcher sets up all the environments variables (PATH, TCLLIBPATH,
......
......@@ -71,6 +71,10 @@ KWWidgets_WRAP_TCL(${LIB_NAME} LIB_TCL_SRCS "${LIB_SRCS}" "")
ADD_LIBRARY(${LIB_NAME} ${LIB_TCL_SRCS} ${LIB_SRCS})
TARGET_LINK_LIBRARIES(${LIB_NAME} ${KWWidgets_LIBRARIES} SlicerBaseLogic )
IF(BUILD_SHARED_LIBS)
INSTALL_TARGETS(${SLICER3_LIB_INSTALL_DIR} ${LIB_NAME})
ENDIF(BUILD_SHARED_LIBS)
# The name of our executable and the corresponding source file.
SET(EXE_NAME "${TARGET_BASE_NAME}")
......
......@@ -56,6 +56,10 @@ ADD_LIBRARY(SlicerBaseLogic
${SlicerBaseLogic_SRCS} ${SlicerBaseLogic_TCL_SRCS}
)
IF(BUILD_SHARED_LIBS)
INSTALL_TARGETS(${SLICER3_LIB_INSTALL_DIR} SlicerBaseLogic)
ENDIF(BUILD_SHARED_LIBS)
TARGET_LINK_LIBRARIES(SlicerBaseLogic
MRML
vtkITK
......
......@@ -14,6 +14,13 @@ SET(Slicer3_VERSION_FULL "${Slicer3_VERSION}.${Slicer3_VERSION_PATCH}")
# Build shared lib by default
OPTION(BUILD_SHARED_LIBS "Build Slicer3 with shared libraries." ON)
IF(BUILD_SHARED_LIBS)
IF(WIN32 AND NOT UNIX)
SET(SLICER3_LIB_INSTALL_DIR /bin)
ELSE(WIN32 AND NOT UNIX)
SET(SLICER3_LIB_INSTALL_DIR /lib)
ENDIF(WIN32 AND NOT UNIX)
ENDIF(BUILD_SHARED_LIBS)
#
# Top level slicer3 configurations
......@@ -104,3 +111,31 @@ ENDIF (Slicer3_BUILD_TESTING)
# include a test for endianness (used to be done by default)
INCLUDE (${CMAKE_ROOT}/Modules/TestBigEndian.cmake)
TEST_BIG_ENDIAN(CMAKE_WORDS_BIGENDIAN)
# If the cmake version includes cpack, use it
IF(EXISTS "${CMAKE_ROOT}/Modules/CPack.cmake")
IF(EXISTS "${CMAKE_ROOT}/Modules/InstallRequiredSystemLibraries.cmake")
INCLUDE(InstallRequiredSystemLibraries)
ENDIF(EXISTS "${CMAKE_ROOT}/Modules/InstallRequiredSystemLibraries.cmake")
SET(CPACK_PACKAGE_DESCRIPTION_SUMMARY "Medical Visualization and Processing Environment for Research")
SET(CPACK_PACKAGE_VENDOR "NA-MIC")
SET(CPACK_PACKAGE_DESCRIPTION_FILE "${CMAKE_CURRENT_SOURCE_DIR}/README.txt")
SET(CPACK_PACKAGE_VERSION_MAJOR "${Slicer3_VERSION_MAJOR}")
SET(CPACK_PACKAGE_VERSION_MINOR "${Slicer3_VERSION_MINOR}")
SET(CPACK_PACKAGE_VERSION_PATCH "${Slicer3_VERSION_PATCH}")
SET(CPACK_INSTALL_CMAKE_PROJECTS
"${Slicer3_BINARY_DIR};Slicer3;ALL;/")
IF(EXISTS "${VTK_DIR}/CMakeCache.txt")
SET(CPACK_INSTALL_CMAKE_PROJECTS "${CPACK_INSTALL_CMAKE_PROJECTS};${VTK_DIR};VTK;ALL;/")
ENDIF(EXISTS "${VTK_DIR}/CMakeCache.txt")
IF(EXISTS "${ITK_DIR}/CMakeCache.txt")
SET(CPACK_INSTALL_CMAKE_PROJECTS "${CPACK_INSTALL_CMAKE_PROJECTS};${ITK_DIR};ITK;ALL;/")
ENDIF(EXISTS "${ITK_DIR}/CMakeCache.txt")
IF(EXISTS "${KWWidgets_DIR}/CMakeCache.txt")
SET(CPACK_INSTALL_CMAKE_PROJECTS "${CPACK_INSTALL_CMAKE_PROJECTS};${KWWidgets_DIR};KWWidgets;ALL;/")
ENDIF(EXISTS "${KWWidgets_DIR}/CMakeCache.txt")
SET(CPACK_PACKAGE_EXECUTABLES "Slicer3" "Slicer")
INCLUDE(CPack)
ENDIF(EXISTS "${CMAKE_ROOT}/Modules/CPack.cmake")
......@@ -62,6 +62,9 @@ VTK_WRAP_TCL3(MRML MRML_TCL_SRCS "${MRML_SRCS}" "")
ADD_LIBRARY(MRML
${MRML_SRCS} ${MRML_TCL_SRCS}
)
IF(BUILD_SHARED_LIBS)
INSTALL_TARGETS(${SLICER3_LIB_INSTALL_DIR} MRML)
ENDIF(BUILD_SHARED_LIBS)
TARGET_LINK_LIBRARIES(MRML
vtkITK
......
......@@ -55,6 +55,9 @@ ADD_LIBRARY(vtkITK
${vtkITK_SRCS}
${vtkITK_TCL_SRCS}
)
IF(BUILD_SHARED_LIBS)
INSTALL_TARGETS(${SLICER3_LIB_INSTALL_DIR} vtkITK)
ENDIF(BUILD_SHARED_LIBS)
TARGET_LINK_LIBRARIES(vtkITK
vtkCommonTCL
......
......@@ -44,6 +44,10 @@ ADD_LIBRARY(ModulesBaseClasses
${ModulesBaseClasses_SRCS}
)
IF(BUILD_SHARED_LIBS)
INSTALL_TARGETS(${SLICER3_LIB_INSTALL_DIR} ModulesBaseClasses)
ENDIF(BUILD_SHARED_LIBS)
TARGET_LINK_LIBRARIES(ModulesBaseClasses
MRML
vtkCommonTCL
......
......@@ -64,6 +64,10 @@ ADD_LIBRARY(GradientAnisotropicDiffusionFilter
${GradientAnisotropicDiffusionFilter_TCL_SRCS}
)
IF(BUILD_SHARED_LIBS)
INSTALL_TARGETS(${SLICER3_LIB_INSTALL_DIR} GradientAnisotropicDiffusionFilter)
ENDIF(BUILD_SHARED_LIBS)
TARGET_LINK_LIBRARIES(GradientAnisotropicDiffusionFilter
ModulesBaseClasses
SlicerBaseLogic
......
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