summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Modules/CPackWIX.cmake5
-rw-r--r--Modules/WIX.template.in1
-rw-r--r--Source/CMakeVersion.cmake2
-rw-r--r--Source/CPack/WiX/cmCPackWIXGenerator.cxx14
-rw-r--r--Source/CPack/WiX/cmCPackWIXGenerator.h4
-rw-r--r--Tests/CMakeLists.txt25
-rw-r--r--Tests/RunCMake/CMakeLists.txt2
7 files changed, 38 insertions, 15 deletions
diff --git a/Modules/CPackWIX.cmake b/Modules/CPackWIX.cmake
index 0a47e19..105df96 100644
--- a/Modules/CPackWIX.cmake
+++ b/Modules/CPackWIX.cmake
@@ -148,6 +148,9 @@
# Currently fragments can be injected into most
# Component, File and Directory elements.
#
+# The special Id ``#PRODUCT`` can be used to inject content
+# into the ``<Product>`` element.
+#
# The following example illustrates how this works.
#
# Given that the WiX generator creates the following XML element:
@@ -233,7 +236,7 @@
# * ARPSIZE - Size (in kilobytes) of the application
#=============================================================================
-# Copyright 2014 Kitware, Inc.
+# Copyright 2014-2015 Kitware, Inc.
#
# Distributed under the OSI-approved BSD License (the "License");
# see accompanying file Copyright.txt for details.
diff --git a/Modules/WIX.template.in b/Modules/WIX.template.in
index bbb7c88..c4fc83a 100644
--- a/Modules/WIX.template.in
+++ b/Modules/WIX.template.in
@@ -42,5 +42,6 @@
<UIRef Id="$(var.CPACK_WIX_UI_REF)" />
<?include "properties.wxi"?>
+ <?include "product_fragment.wxi"?>
</Product>
</Wix>
diff --git a/Source/CMakeVersion.cmake b/Source/CMakeVersion.cmake
index dcd8191..46d0888 100644
--- a/Source/CMakeVersion.cmake
+++ b/Source/CMakeVersion.cmake
@@ -1,5 +1,5 @@
# CMake version number components.
set(CMake_VERSION_MAJOR 3)
set(CMake_VERSION_MINOR 2)
-set(CMake_VERSION_PATCH 20150213)
+set(CMake_VERSION_PATCH 20150216)
#set(CMake_VERSION_RC 1)
diff --git a/Source/CPack/WiX/cmCPackWIXGenerator.cxx b/Source/CPack/WiX/cmCPackWIXGenerator.cxx
index 59c38e9..11d5437 100644
--- a/Source/CPack/WiX/cmCPackWIXGenerator.cxx
+++ b/Source/CPack/WiX/cmCPackWIXGenerator.cxx
@@ -1,6 +1,6 @@
/*============================================================================
CMake - Cross Platform Makefile Generator
- Copyright 2000-2014 Kitware, Inc., Insight Software Consortium
+ Copyright 2012-2015 Kitware, Inc., Insight Software Consortium
Distributed under the OSI-approved BSD License (the "License");
see accompanying file Copyright.txt for details.
@@ -257,6 +257,7 @@ bool cmCPackWIXGenerator::PackageFilesImpl()
CreateWiXVariablesIncludeFile();
CreateWiXPropertiesIncludeFile();
+ CreateWiXProductFragmentIncludeFile();
if(!CreateWiXSourceFiles())
{
@@ -385,6 +386,17 @@ void cmCPackWIXGenerator::CreateWiXPropertiesIncludeFile()
}
}
+void cmCPackWIXGenerator::CreateWiXProductFragmentIncludeFile()
+{
+ std::string includeFilename =
+ this->CPackTopLevel + "/product_fragment.wxi";
+
+ cmWIXSourceWriter includeFile(
+ this->Logger, includeFilename, true);
+
+ this->Patch->ApplyFragment("#PRODUCT", includeFile);
+}
+
void cmCPackWIXGenerator::CopyDefinition(
cmWIXSourceWriter &source, std::string const& name)
{
diff --git a/Source/CPack/WiX/cmCPackWIXGenerator.h b/Source/CPack/WiX/cmCPackWIXGenerator.h
index 8705d40..7035297 100644
--- a/Source/CPack/WiX/cmCPackWIXGenerator.h
+++ b/Source/CPack/WiX/cmCPackWIXGenerator.h
@@ -1,6 +1,6 @@
/*============================================================================
CMake - Cross Platform Makefile Generator
- Copyright 2000-2012 Kitware, Inc.
+ Copyright 2012-2015 Kitware, Inc.
Distributed under the OSI-approved BSD License (the "License");
see accompanying file Copyright.txt for details.
@@ -76,6 +76,8 @@ private:
void CreateWiXPropertiesIncludeFile();
+ void CreateWiXProductFragmentIncludeFile();
+
void CopyDefinition(
cmWIXSourceWriter &source, std::string const& name);
diff --git a/Tests/CMakeLists.txt b/Tests/CMakeLists.txt
index 7e7aa2e..cb45e79 100644
--- a/Tests/CMakeLists.txt
+++ b/Tests/CMakeLists.txt
@@ -102,6 +102,17 @@ if(BUILD_TESTING)
list(APPEND build_options -DCMAKE_MAKE_PROGRAM:FILEPATH=${CMake_TEST_EXPLICIT_MAKE_PROGRAM})
endif()
+ # Look for rpmbuild to use for tests.
+ # The tool does not work with spaces in the path.
+ if (CMAKE_SYSTEM_NAME MATCHES "Linux" AND NOT CMAKE_CURRENT_BINARY_DIR MATCHES " ")
+ find_program(RPMBUILD_EXECUTABLE NAMES rpmbuild)
+ else()
+ set(RPMBUILD_EXECUTABLE "RPMBUILD_EXECUTABLE-NOTFOUND")
+ endif()
+
+ #---------------------------------------------------------------------------
+ # Add tests below here.
+
if(NOT CMake_TEST_EXTERNAL_CMAKE)
add_subdirectory(CMakeLib)
endif()
@@ -826,11 +837,8 @@ ${CMake_BINARY_DIR}/bin/cmake -DDIR=dev -P ${CMake_SOURCE_DIR}/Utilities/Release
set(CTEST_package_X11_TEST ${CTEST_TEST_CPACK})
set(CTEST_RUN_CPackComponentsForAll ${CTEST_TEST_CPACK})
- if (CMAKE_SYSTEM_NAME MATCHES "Linux" AND NOT CMAKE_CURRENT_BINARY_DIR MATCHES " ")
- find_program(RPMBUILD NAMES rpmbuild)
- endif()
# Do not try to build RPM
- if (NOT RPMBUILD)
+ if (NOT RPMBUILD_EXECUTABLE)
set(CPACK_BINARY_RPM OFF)
endif()
@@ -912,7 +920,6 @@ ${CMake_BINARY_DIR}/bin/cmake -DDIR=dev -P ${CMake_SOURCE_DIR}/Utilities/Release
if(CTEST_RUN_CPackComponentsForAll)
# Check whether if rpmbuild command is found
# before adding RPM tests
- find_program(RPMBUILD_EXECUTABLE NAMES rpmbuild)
if(RPMBUILD_EXECUTABLE)
list(APPEND ACTIVE_CPACK_GENERATORS RPM)
endif()
@@ -931,11 +938,9 @@ ${CMake_BINARY_DIR}/bin/cmake -DDIR=dev -P ${CMake_SOURCE_DIR}/Utilities/Release
if(APPLE)
list(APPEND GENLST "DragNDrop")
endif()
- if (NOT CMAKE_CURRENT_BINARY_DIR MATCHES " ")
- list(FIND ACTIVE_CPACK_GENERATORS "RPM" RPM_ACTIVE)
- if (NOT ${RPM_ACTIVE} EQUAL -1)
- list(APPEND GENLST "RPM")
- endif()
+ list(FIND ACTIVE_CPACK_GENERATORS "RPM" RPM_ACTIVE)
+ if (NOT ${RPM_ACTIVE} EQUAL -1)
+ list(APPEND GENLST "RPM")
endif()
list(FIND ACTIVE_CPACK_GENERATORS "DEB" DEB_ACTIVE)
if (NOT ${DEB_ACTIVE} EQUAL -1)
diff --git a/Tests/RunCMake/CMakeLists.txt b/Tests/RunCMake/CMakeLists.txt
index 2de82a7..f0426e5 100644
--- a/Tests/RunCMake/CMakeLists.txt
+++ b/Tests/RunCMake/CMakeLists.txt
@@ -195,6 +195,6 @@ add_RunCMake_test(IfacePaths_INCLUDE_DIRECTORIES TEST_DIR IfacePaths)
set(IfacePaths_SOURCES_ARGS -DTEST_PROP=SOURCES)
add_RunCMake_test(IfacePaths_SOURCES TEST_DIR IfacePaths)
-if(RPMBUILD)
+if(RPMBUILD_EXECUTABLE)
add_RunCMake_test(CPackRPM)
endif()