Permalink
Browse files

COMP: Prevent confusion by consistently using platform as concatenati…

…on of "Os" and "architecture". See #1204

* Rename macro SlicerMacroGetPlatformArchitectureBitness and change its
associate return value from PLATFORM to OS.

git-svn-id: http://svn.slicer.org/Slicer4/trunk@19949 3bd1e089-480b-0410-8dfb-8563597acbee
  • Loading branch information...
1 parent 9dbe3a7 commit 7335e4d7b0bd30e516126fa46d4f4648c6700951 @jcfr jcfr committed Apr 26, 2012
@@ -1193,7 +1193,7 @@ int qSlicerCoreApplication::minorVersion() const
//-----------------------------------------------------------------------------
QString qSlicerCoreApplication::platform()const
{
- return QString("%1-%2").arg(Slicer_PLATFORM).arg(Slicer_ARCHITECTURE);
+ return QString("%1-%2").arg(Slicer_OS).arg(Slicer_ARCHITECTURE);
}
//-----------------------------------------------------------------------------
@@ -1205,7 +1205,7 @@ QString qSlicerCoreApplication::arch()const
//-----------------------------------------------------------------------------
QString qSlicerCoreApplication::os()const
{
- return Slicer_PLATFORM;
+ return Slicer_OS;
}
//-----------------------------------------------------------------------------
View
@@ -78,7 +78,7 @@ set(CPACK_PACKAGE_VERSION_MAJOR "${Slicer_VERSION_MAJOR}")
set(CPACK_PACKAGE_VERSION_MINOR "${Slicer_VERSION_MINOR}")
set(CPACK_PACKAGE_VERSION_PATCH "${Slicer_VERSION_PATCH}")
SET(CPACK_PACKAGE_VERSION "${Slicer_VERSION_FULL}")
-set(CPACK_SYSTEM_NAME "${Slicer_PLATFORM}-${Slicer_ARCHITECTURE}")
+set(CPACK_SYSTEM_NAME "${Slicer_OS}-${Slicer_ARCHITECTURE}")
if(APPLE)
set(CPACK_PACKAGE_ICON "${Slicer_SOURCE_DIR}/Applications/SlicerQT/Resources/Slicer.icns")
@@ -35,8 +35,8 @@ set(Slicer_WC_REVISION "@Slicer_WC_REVISION@")
set(Slicer_WC_URL "@Slicer_WC_URL@")
set(Slicer_WC_ROOT "@Slicer_WC_ROOT@")
-# Slicer platform and architecture
-set(Slicer_PLATFORM "@Slicer_PLATFORM@")
+# Slicer os and architecture
+set(Slicer_OS "@Slicer_OS@")
set(Slicer_ARCHITECTURE "@Slicer_ARCHITECTURE@")
# License and Readme file
@@ -24,7 +24,7 @@ include(SlicerBlockModuleToExtensionMetadata)
# -------------------------------------------------------------------------
# Sanity checks
# -------------------------------------------------------------------------
-set(expected_nonempty_vars EXTENSION_NAME Slicer_WC_REVISION Slicer_PLATFORM Slicer_ARCHITECTURE)
+set(expected_nonempty_vars EXTENSION_NAME Slicer_WC_REVISION Slicer_OS Slicer_ARCHITECTURE)
foreach(var ${expected_nonempty_vars})
if("${${var}}" STREQUAL "")
message(FATAL_ERROR "error: ${var} is either NOT defined or empty.")
@@ -89,7 +89,7 @@ set(CMAKE_PROJECT_NAME ${EXTENSION_NAME})
set(CPACK_PACKAGE_VENDOR "NA-MIC")
set(CPACK_PACKAGE_DESCRIPTION_FILE "${EXTENSION_README_FILE}")
set(CPACK_RESOURCE_FILE_LICENSE "${EXTENSION_LICENSE_FILE}")
-set(CPACK_PACKAGE_FILE_NAME "${Slicer_WC_REVISION}-${Slicer_PLATFORM}-${Slicer_ARCHITECTURE}-${EXTENSION_NAME}-${${EXTENSION_NAME}_WC_TYPE}${${EXTENSION_NAME}_WC_REVISION}-${${EXTENSION_NAME}_BUILDDATE}")
+set(CPACK_PACKAGE_FILE_NAME "${Slicer_WC_REVISION}-${Slicer_OS}-${Slicer_ARCHITECTURE}-${EXTENSION_NAME}-${${EXTENSION_NAME}_WC_TYPE}${${EXTENSION_NAME}_WC_REVISION}-${${EXTENSION_NAME}_BUILDDATE}")
#set(CPACK_PACKAGE_VERSION_MAJOR "${Slicer_VERSION_MAJOR}")
#set(CPACK_PACKAGE_VERSION_MINOR "${Slicer_VERSION_MINOR}")
#set(CPACK_PACKAGE_VERSION_PATCH "${Slicer_VERSION_PATCH}")
@@ -19,17 +19,17 @@
################################################################################
#
-# SlicerMacroGetPlatformArchitectureBitness(<var-prefix>)
+# SlicerMacroGetOperatingSystemArchitectureBitness(<var-prefix>)
# is used to extract information associated with the current platform.
#
# The macro defines the following variables:
# <var-prefix>_BITNESS - bitness of the platform: 32 or 64
-# <var-prefix>_PLATFORM - which is on the this value: linux, macosx, win
+# <var-prefix>_OS - which is on the this value: linux, macosx, win
# <var-prefix>_ARCHITECTURE - which is on the this value: i386, amd64, ppc
include(${CMAKE_CURRENT_LIST_DIR}/SlicerBlockOperatingSystemNames.cmake)
-macro(SlicerMacroGetPlatformArchitectureBitness)
+macro(SlicerMacroGetOperatingSystemArchitectureBitness)
set(options)
set(oneValueArgs VAR_PREFIX)
set(multiValueArgs)
@@ -50,13 +50,13 @@ macro(SlicerMacroGetPlatformArchitectureBitness)
endif()
if(CMAKE_SYSTEM_NAME STREQUAL "Windows")
- set(${MY_VAR_PREFIX}_PLATFORM "${Slicer_OS_WIN_NAME}")
+ set(${MY_VAR_PREFIX}_OS "${Slicer_OS_WIN_NAME}")
elseif(CMAKE_SYSTEM_NAME STREQUAL "Linux")
- set(${MY_VAR_PREFIX}_PLATFORM "${Slicer_OS_LINUX_NAME}")
+ set(${MY_VAR_PREFIX}_OS "${Slicer_OS_LINUX_NAME}")
elseif(CMAKE_SYSTEM_NAME STREQUAL "Darwin")
- set(${MY_VAR_PREFIX}_PLATFORM "${Slicer_OS_MAC_NAME}")
+ set(${MY_VAR_PREFIX}_OS "${Slicer_OS_MAC_NAME}")
if(CMAKE_SYSTEM_PROCESSOR MATCHES "powerpc")
set(${MY_VAR_PREFIX}_ARCHITECTURE "ppc")
endif()
@@ -24,7 +24,7 @@
#define Slicer_OS_WIN_NAME "@Slicer_OS_WIN_NAME@"
#define Slicer_ARCHITECTURE "@Slicer_ARCHITECTURE@"
-#define Slicer_PLATFORM "@Slicer_PLATFORM@"
+#define Slicer_OS "@Slicer_OS@"
#define Slicer_BUILDDATE "@Slicer_BUILDDATE@"
#define Slicer_WC_URL "@Slicer_WC_URL@"
#define Slicer_WC_REVISION "@Slicer_WC_REVISION@"
View
@@ -83,7 +83,7 @@ include(CMakeDependentOption)
include(CMakeParseArguments)
include(Slicer3PluginsMacros)
include(SlicerMacroExtractRepositoryInfo)
-include(SlicerMacroGetPlatformArchitectureBitness)
+include(SlicerMacroGetOperatingSystemArchitectureBitness)
include(SlicerMacroParseArguments)
include(SlicerMacroEmptyExternalProject)
include(SlicerFunctionInstallLibrary)
@@ -472,10 +472,10 @@ set(Slicer_ModuleMRML_INCLUDE_DIRS CACHE INTERNAL "Slicer Module MRML includes"
set(Slicer_ModuleWidgets_INCLUDE_DIRS CACHE INTERNAL "Slicer Module Widgets includes" FORCE)
#-----------------------------------------------------------------------------
-# Get platform, architecture and bitness
+# Get operating system, architecture and bitness
#-----------------------------------------------------------------------------
-SlicerMacroGetPlatformArchitectureBitness(VAR_PREFIX Slicer)
-message(STATUS "Configuring Slicer for ${Slicer_PLATFORM}-${Slicer_ARCHITECTURE}")
+SlicerMacroGetOperatingSystemArchitectureBitness(VAR_PREFIX Slicer)
+message(STATUS "Configuring Slicer for ${Slicer_OS}-${Slicer_ARCHITECTURE}")
#-----------------------------------------------------------------------------
# Testing
@@ -20,15 +20,15 @@ if(Slicer_USE_CTKAPPLAUNCHER)
set(proj CTKAPPLAUNCHER)
if(NOT DEFINED CTKAPPLAUNCHER_DIR)
- SlicerMacroGetPlatformArchitectureBitness(VAR_PREFIX CTKAPPLAUNCHER)
+ SlicerMacroGetOperatingSystemArchitectureBitness(VAR_PREFIX CTKAPPLAUNCHER)
set(launcher_version "0.1.5")
# On windows, use i386 launcher unconditionally
- if("${CTKAPPLAUNCHER_PLATFORM}" STREQUAL "win")
+ if("${CTKAPPLAUNCHER_OS}" STREQUAL "win")
set(CTKAPPLAUNCHER_ARCHITECTURE "i386")
endif()
#message(STATUS "${__indent}Adding project ${proj}")
ExternalProject_Add(${proj}
- URL http://cloud.github.com/downloads/commontk/AppLauncher/CTKAppLauncher-${launcher_version}-${CTKAPPLAUNCHER_PLATFORM}-${CTKAPPLAUNCHER_ARCHITECTURE}.tar.gz
+ URL http://cloud.github.com/downloads/commontk/AppLauncher/CTKAppLauncher-${launcher_version}-${CTKAPPLAUNCHER_OS}-${CTKAPPLAUNCHER_ARCHITECTURE}.tar.gz
SOURCE_DIR ${CMAKE_BINARY_DIR}/${proj}
CONFIGURE_COMMAND ""
BUILD_COMMAND ""

0 comments on commit 7335e4d

Please sign in to comment.