Commit 1a6cb606 authored by jcfr's avatar jcfr
Browse files

COMP: Update the main CMakeLists.txt script - Slicer3Version.txt.in is

now configured and installed in to Slicer_HOME/lib/Slicer3 at build time.

The following variable are discovered at build time:
 Slicer3_BUILD         -> Computed using CMake/DiscoverSystemNameAndBits.cmake
 Slicer3_BUILDDATE     -> Computed using macro TODAY from CMake/Slicer3TodayMacro.cmake
 Slicer3_WC_URL        -> Computed using either macro Subversion_WC_INFO (if slicer checkout using svn)
                          or Git_WC_INFO (if slicer is checkout using git-svn)
 Slicer3_WC_REVISION   -> idem

git-svn-id: http://svn.slicer.org/Slicer4/trunk@11900 3bd1e089-480b-0410-8dfb-8563597acbee
parent 896f01ff
......@@ -409,6 +409,50 @@ install(FILES
DESTINATION ${Slicer3_INSTALL_INCLUDE_DIR} COMPONENT Development
)
#-----------------------------------------------------------------------------
# Generate Slicer3Version.txt
INCLUDE(${Slicer3_CMAKE_DIR}/Slicer3TodayMacro.cmake)
# Get build time
TODAY(Slicer3_BUILDDATE)
# Get sytem name and architecture
SET(Slicer3_BUILD NA)
INCLUDE(${Slicer3_CMAKE_DIR}/DiscoverSystemNameAndBits.cmake)
SET(Slicer3_WC_URL NA)
SET(Slicer3_WC_REVISION 0)
# Get SVN info
FIND_PACKAGE(Subversion)
IF(NOT Subversion_FOUND)
MESSAGE(FATAL_ERROR "error: Install SVN and try to re-configure")
ENDIF(NOT Subversion_FOUND)
# Case where Slicer is checkout using SVN
IF (EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/.svn)
Subversion_WC_INFO(${CMAKE_CURRENT_SOURCE_DIR} Slicer3)
CONFIGURE_FILE(
${CMAKE_CURRENT_SOURCE_DIR}/Slicer3Version.txt.in
${Slicer3_HOME}/lib/Slicer3/Slicer3Version.txt
)
ENDIF()
# Case where Slicer is checkout using Git-SVN
IF (EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/.git)
FIND_PACKAGE(Git)
IF(NOT Git_FOUND)
MESSAGE(FATAL_ERROR "error: Failed to locate Git")
ENDIF(NOT Git_FOUND)
Git_WC_INFO(${CMAKE_CURRENT_SOURCE_DIR} Slicer3)
CONFIGURE_FILE(
${CMAKE_CURRENT_SOURCE_DIR}/Slicer3Version.txt.in
${Slicer3_HOME}/lib/Slicer3/Slicer3Version.txt
)
ENDIF()
MESSAGE(STATUS "Slicer3_BUILD:${Slicer3_BUILD}")
#-----------------------------------------------------------------------------
# Subdirectories
......@@ -531,6 +575,7 @@ CONFIGURE_FILE(
@ONLY
)
#-----------------------------------------------------------------------------
# Set up for building against a Slicer3 build tree and a Slicer3 installation
#
......
build @Slicer3_BUILD@
buildDate @Slicer3_BUILDDATE@
svnurl @Slicer3_WC_URL@
svnrevision @Slicer3_WC_REVISION@
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