Commit f4d3c4d7 authored by jcfr's avatar jcfr

ENH: BuildSystem: Generalize SlicerVersion module

Source checkout properties are now extracted from the source directory
associated with the top-level CMake project.

This commit also simplifies how major/minor/patch version values are
passed to the inner build. Version variables are now always expected to
be Slicer_VERSION_(MAJOR,MINOR,PATCH).

git-svn-id: http://svn.slicer.org/Slicer4/trunk@26536 3bd1e089-480b-0410-8dfb-8563597acbee
parent e4979910
......@@ -28,6 +28,7 @@
# Slicer_BINARY_DIR
# Slicer_CMAKE_DIR
# Slicer_MAIN_PROJECT_APPLICATION_NAME
# <Slicer_MAIN_PROJECT_APPLICATION_NAME>_SOURCE_DIR
# Slicer_RELEASE_TYPE
# Slicer_SOURCE_DIR
# Slicer_VERSION_MAJOR
......@@ -48,6 +49,7 @@ set(expected_defined_vars
Slicer_BINARY_DIR
Slicer_CMAKE_DIR
Slicer_MAIN_PROJECT_APPLICATION_NAME # Used by SlicerVersion.cmake
${Slicer_MAIN_PROJECT_APPLICATION_NAME}_SOURCE_DIR
Slicer_RELEASE_TYPE
Slicer_SOURCE_DIR
Slicer_VERSION_MAJOR
......
......@@ -3,7 +3,7 @@
# This module will set the variables Slicer_VERSION and Slicer_VERSION_FULL.
#
# It will also set all variables describing the SCM associated
# with Slicer_SOURCE_DIR.
# with <Slicer_MAIN_PROJECT_APPLICATION_NAME>_SOURCE_DIR.
#
# It has been designed to be included in the build system of Slicer.
#
......@@ -11,8 +11,8 @@
# GIT_EXECUTABLE
# Slicer_CMAKE_DIR
# Slicer_MAIN_PROJECT_APPLICATION_NAME
# <Slicer_MAIN_PROJECT_APPLICATION_NAME>_SOURCE_DIR
# Slicer_RELEASE_TYPE
# Slicer_SOURCE_DIR
# Slicer_VERSION_MAJOR
# Slicer_VERSION_MINOR
# Slicer_VERSION_PATCH
......@@ -26,8 +26,8 @@ set(expected_defined_vars
GIT_EXECUTABLE
Slicer_CMAKE_DIR
Slicer_MAIN_PROJECT_APPLICATION_NAME
${Slicer_MAIN_PROJECT_APPLICATION_NAME}_SOURCE_DIR
Slicer_RELEASE_TYPE
Slicer_SOURCE_DIR
Slicer_VERSION_MAJOR
Slicer_VERSION_MINOR
Slicer_VERSION_PATCH
......@@ -55,7 +55,7 @@ include(SlicerMacroExtractRepositoryInfo)
SlicerMacroExtractRepositoryInfo(
VAR_PREFIX Slicer
SOURCE_DIR ${Slicer_SOURCE_DIR}
SOURCE_DIR ${${Slicer_MAIN_PROJECT_APPLICATION_NAME}_SOURCE_DIR}
)
if(NOT Slicer_FORCED_WC_LAST_CHANGED_DATE STREQUAL "")
......
......@@ -273,9 +273,11 @@ mark_as_superbuild(Slicer_UPDATE_TRANSLATION)
set(Slicer_FORCED_WC_LAST_CHANGED_DATE "" CACHE STRING "Overwrite value of auto-discovered Slicer_WC_LAST_CHANGED_DATE (format: YYYY-MM-DD)")
mark_as_advanced(Slicer_FORCED_WC_LAST_CHANGED_DATE)
mark_as_superbuild(Slicer_FORCED_WC_LAST_CHANGED_DATE)
set(Slicer_FORCED_WC_REVISION "" CACHE STRING "Overwrite value of auto-discovered Slicer_WC_REVISION")
mark_as_advanced(Slicer_FORCED_WC_REVISION)
mark_as_superbuild(Slicer_FORCED_WC_REVISION)
option(Slicer_USE_FOLDERS "Organize build targets into folders" ON)
mark_as_superbuild(Slicer_USE_FOLDERS)
......@@ -433,6 +435,12 @@ include(SlicerApplicationOptions)
# Slicer version number.
#-----------------------------------------------------------------------------
include(SlicerVersion)
mark_as_superbuild(
VARS
Slicer_VERSION_MAJOR:STRING
Slicer_VERSION_MINOR:STRING
Slicer_VERSION_PATCH:STRING
)
#-----------------------------------------------------------------------------
# Slicer sub-directories
......
......@@ -454,11 +454,6 @@ ExternalProject_Add(${proj}
-DSlicer_SUPERBUILD:BOOL=OFF
-DSlicer_SUPERBUILD_DIR:PATH=${Slicer_BINARY_DIR}
-D${Slicer_MAIN_PROJECT}_APPLICATION_NAME:STRING=${${Slicer_MAIN_PROJECT}_APPLICATION_NAME}
-D${Slicer_MAIN_PROJECT_APPLICATION_NAME}_VERSION_MAJOR:STRING=${${Slicer_MAIN_PROJECT_APPLICATION_NAME}_VERSION_MAJOR}
-D${Slicer_MAIN_PROJECT_APPLICATION_NAME}_VERSION_MINOR:STRING=${${Slicer_MAIN_PROJECT_APPLICATION_NAME}_VERSION_MINOR}
-D${Slicer_MAIN_PROJECT_APPLICATION_NAME}_VERSION_PATCH:STRING=${${Slicer_MAIN_PROJECT_APPLICATION_NAME}_VERSION_PATCH}
-DSlicer_FORCED_WC_LAST_CHANGED_DATE:STRING=${Slicer_FORCED_WC_LAST_CHANGED_DATE}
-DSlicer_FORCED_WC_REVISION:STRING=${Slicer_FORCED_WC_REVISION}
-DSlicer_EXTENSION_SOURCE_DIRS:STRING=${Slicer_EXTENSION_SOURCE_DIRS}
-DSlicer_EXTENSION_INSTALL_DIRS:STRING=${Slicer_EXTENSION_INSTALL_DIRS}
-DExternalData_OBJECT_STORES:PATH=${ExternalData_OBJECT_STORES}
......
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