summaryrefslogtreecommitdiffstats
path: root/Packaging
diff options
context:
space:
mode:
authorKonstantin Podsvirov <konstantin@podsvirov.pro>2017-01-11 11:06:00 (GMT)
committerKonstantin Podsvirov <konstantin@podsvirov.pro>2017-01-12 16:29:52 (GMT)
commit4971799360b5ec7c99f94810f2fa5cb9f80dcebf (patch)
tree488e2e136a9101741a30ae90d1e155f5f252bb2a /Packaging
parent728820f3ea0faf55ffe1236a44a35e9197fc6291 (diff)
downloadCMake-4971799360b5ec7c99f94810f2fa5cb9f80dcebf.zip
CMake-4971799360b5ec7c99f94810f2fa5cb9f80dcebf.tar.gz
CMake-4971799360b5ec7c99f94810f2fa5cb9f80dcebf.tar.bz2
QtIFW: Improved packaging
Now cpack_ifw_configure_file command used to configure template files of component's scripts. Now for these template files we can use QtIFW predefined variables (like @VAR@) and template variables in Qt/IFW/SDK/Creator templates style (like %VAR%). Now CMake_INSTALL_INFIX advanced variable used to configure CMake installation destination when package as part of QtSDK.
Diffstat (limited to 'Packaging')
-rw-r--r--Packaging/QtSDK/ToolsCMakeXX.cmake49
-rw-r--r--Packaging/QtSDK/qt.tools.cmake.xx.qs.in12
2 files changed, 19 insertions, 42 deletions
diff --git a/Packaging/QtSDK/ToolsCMakeXX.cmake b/Packaging/QtSDK/ToolsCMakeXX.cmake
index e227b73..c5f8f34 100644
--- a/Packaging/QtSDK/ToolsCMakeXX.cmake
+++ b/Packaging/QtSDK/ToolsCMakeXX.cmake
@@ -3,38 +3,29 @@
# CMake version
include("${CMAKE_CURRENT_LIST_DIR}/../../Source/CMakeVersion.cmake")
-set(CM_VER_XY ${CMake_VERSION_MAJOR}${CMake_VERSION_MINOR})
-set(CM_VER_X_Y ${CMake_VERSION_MAJOR}.${CMake_VERSION_MINOR})
-set(CM_VER_X_Y_Z ${CMake_VERSION_MAJOR}.${CMake_VERSION_MINOR}.${CMake_VERSION_PATH})
-# Destiantion
-set(CM_INST_PREF "Tools/CMake/${CM_VER_X_Y}")
-set(CMAKE_BIN_DIR "${CM_INST_PREF}/bin"
- CACHE STRING "Location under install bin")
-set(CMAKE_DATA_DIR "${CM_INST_PREF}/share/cmake-${CM_VER_X_Y}"
- CACHE STRING "Location under install data")
-set(CMAKE_DOC_DIR "${CM_INST_PREF}/doc/cmake-${CM_VER_X_Y}"
- CACHE STRING "Location under install docs")
-set(CMAKE_MAN_DIR "${CM_INST_PREF}/man"
- CACHE STRING "Location under install man pages")
-set(CMAKE_XDGDATA_DIR "${CM_INST_PREF}/share"
- CACHE STRING "Location under install XDG specific files")
+# Install destinations
+set(CMake_INSTALL_INFIX "Tools/CMake/${CMake_VERSION_MAJOR}.${CMake_VERSION_MINOR}/"
+ CACHE STRING "Location under install CMake tools")
# Package
set(CMake_IFW_ROOT_COMPONENT_NAME
- "qt.tools.cmake.${CM_VER_XY}"
+ "qt.tools.cmake.${CMake_VERSION_MAJOR}${CMake_VERSION_MINOR}"
CACHE STRING "QtSDK CMake tools component name")
set(CMake_IFW_ROOT_COMPONENT_DISPLAY_NAME
- "CMake ${CM_VER_X_Y}"
+ "CMake ${CMake_VERSION_MAJOR}.${CMake_VERSION_MINOR}"
CACHE STRING "QtSDK CMake tools component display name")
set(CMake_IFW_ROOT_COMPONENT_DESCRIPTION
- "CMake Build Tools ${CM_VER_X_Y_Z}"
+ "CMake Build Tools ${CMake_VERSION_MAJOR}.${CMake_VERSION_MINOR}.${CMake_VERSION_PATH}"
CACHE STRING "QtSDK CMake tools component description")
-set(CMake_IFW_ROOT_COMPONENT_SCRIPT
- "${CMAKE_CURRENT_BINARY_DIR}/qt.tools.cmake.${CM_VER_XY}.qs"
- CACHE STRING "QtSDK CMake tools component display name")
+set(CMake_IFW_ROOT_COMPONENT_SCRIPT_TEMPLATE
+ "${CMAKE_CURRENT_LIST_DIR}/qt.tools.cmake.xx.qs.in"
+ CACHE FILEPATH "QtSDK CMake tools script template")
+set(CMake_IFW_ROOT_COMPONENT_SCRIPT_GENERATED
+ "${CMAKE_CURRENT_BINARY_DIR}/qt.tools.cmake.${CMake_VERSION_MAJOR}${CMake_VERSION_MINOR}.qs"
+ CACHE FILEPATH "QtSDK CMake tools script generated")
set(CMake_IFW_ROOT_COMPONENT_PRIORITY
- "${CM_VER_XY}"
+ "${CMake_VERSION_MAJOR}${CMake_VERSION_MINOR}"
CACHE STRING "QtSDK CMake tools component sorting priority")
set(CMake_IFW_ROOT_COMPONENT_DEFAULT ""
CACHE STRING "QtSDK CMake tools component default")
@@ -52,17 +43,3 @@ set(CPACK_IFW_DOWNLOAD_ALL "TRUE"
CACHE STRING "All QtSDK components is downloaded")
set(CPACK_DOWNLOAD_SITE "file:///${CMAKE_CURRENT_BINARY_DIR}/QtSDK/IFW/CMake/repository"
CACHE STRING "Local repository for testing")
-
-# Script
-set(SDKToolBinary "@SDKToolBinary@")
-set(CM_VER_XY_DIR "@CMAKE${CM_VER_XY}_DIR@")
-configure_file("${CMAKE_CURRENT_LIST_DIR}/qt.tools.cmake.xx.qs.in"
- "${CMAKE_CURRENT_BINARY_DIR}/qt.tools.cmake.${CM_VER_XY}.qs"
- @ONLY)
-
-# Unset temporary variables
-unset(CM_VER_XY)
-unset(CM_VER_X_Y)
-unset(CM_VER_X_Y_Z)
-unset(CM_INST_PREF)
-unset(SDKToolBinary)
diff --git a/Packaging/QtSDK/qt.tools.cmake.xx.qs.in b/Packaging/QtSDK/qt.tools.cmake.xx.qs.in
index cb42a71..81ce157 100644
--- a/Packaging/QtSDK/qt.tools.cmake.xx.qs.in
+++ b/Packaging/QtSDK/qt.tools.cmake.xx.qs.in
@@ -9,15 +9,15 @@
function Component()
{
installer.valueChanged.connect( this, Component.prototype.reactOnTargetDirChange );
- // set the default values to CMAKE@CM_VER_XY@_DIR
+ // set the default values to CMAKE%CMake_VERSION_MAJOR%%CMake_VERSION_MINOR%_BIN_DIR
Component.prototype.reactOnTargetDirChange("TargetDir", installer.value("TargetDir"));
}
Component.prototype.reactOnTargetDirChange = function(key, value)
{
if (key == "TargetDir") {
- var path = value + "/@CM_INST_PREF@";
- installer.setValue("CMAKE@CM_VER_XY@_DIR", path.replace(/\\/g, "/"));
+ var path = value + "/%CMAKE_BIN_DIR%";
+ installer.setValue("CMAKE%CMake_VERSION_MAJOR%%CMake_VERSION_MINOR%_BIN_DIR", path.replace(/\\/g, "/"));
}
}
@@ -31,13 +31,13 @@ Component.prototype.createOperations = function()
return;
var cmId = component.name;
- installer.setValue("CMAKE@CM_VER_XY@_ID", cmId);
+ installer.setValue("CMAKE%CMake_VERSION_MAJOR%%CMake_VERSION_MINOR%_ID", cmId);
component.addOperation("Execute",
["{0,2}", "@SDKToolBinary@", "addCMake",
"--id", cmId,
- "--name", "@CMake_IFW_ROOT_COMPONENT_DISPLAY_NAME@",
- "--path", "@CM_VER_XY_DIR@/bin/cmake.exe",
+ "--name", "%CMake_IFW_ROOT_COMPONENT_DISPLAY_NAME%",
+ "--path", "@CMAKE%CMake_VERSION_MAJOR%%CMake_VERSION_MINOR%_BIN_DIR@/cmake.exe",
"UNDOEXECUTE",
"@SDKToolBinary@", "rmCMake", "--id", cmId]);