CMake/Source/CPack/cmCPackNSISGenerator.h

90 lines
2.9 KiB
C
Raw Normal View History

Simplify CMake per-source license notices Per-source copyright/license notice headers that spell out copyright holder names and years are hard to maintain and often out-of-date or plain wrong. Precise contributor information is already maintained automatically by the version control tool. Ultimately it is the receiver of a file who is responsible for determining its licensing status, and per-source notices are merely a convenience. Therefore it is simpler and more accurate for each source to have a generic notice of the license name and references to more detailed information on copyright holders and full license terms. Our `Copyright.txt` file now contains a list of Contributors whose names appeared source-level copyright notices. It also references version control history for more precise information. Therefore we no longer need to spell out the list of Contributors in each source file notice. Replace CMake per-source copyright/license notice headers with a short description of the license and links to `Copyright.txt` and online information available from "https://cmake.org/licensing". The online URL also handles cases of modules being copied out of our source into other projects, so we can drop our notices about replacing links with full license text. Run the `Utilities/Scripts/filter-notices.bash` script to perform the majority of the replacements mechanically. Manually fix up shebang lines and trailing newlines in a few files. Manually update the notices in a few files that the script does not handle.
2016-09-27 22:01:08 +03:00
/* Distributed under the OSI-approved BSD 3-Clause License. See accompanying
file Copyright.txt or https://cmake.org/licensing for details. */
2006-01-02 07:21:05 +03:00
#ifndef cmCPackNSISGenerator_h
#define cmCPackNSISGenerator_h
2016-09-07 01:21:35 +03:00
#include <cmConfigure.h>
2007-11-06 00:55:45 +03:00
#include "cmCPackGenerator.h"
2016-09-07 01:21:35 +03:00
#include "cmTypeMacro.h"
2016-09-07 01:21:35 +03:00
#include <iosfwd>
#include <set>
2016-09-07 01:21:35 +03:00
#include <string>
#include <vector>
class cmCPackComponent;
class cmCPackComponentGroup;
2006-01-02 07:21:05 +03:00
/** \class cmCPackNSISGenerator
* \brief A generator for NSIS files
*
* http://people.freebsd.org/~kientzle/libarchive/
*/
2007-11-06 00:55:45 +03:00
class cmCPackNSISGenerator : public cmCPackGenerator
2006-01-02 07:21:05 +03:00
{
public:
2007-11-06 00:55:45 +03:00
cmCPackTypeMacro(cmCPackNSISGenerator, cmCPackGenerator);
2006-01-02 07:21:05 +03:00
static cmCPackGenerator* CreateGenerator64()
{
return new cmCPackNSISGenerator(true);
}
2006-01-02 07:21:05 +03:00
/**
* Construct generator
*/
cmCPackNSISGenerator(bool nsis64 = false);
2016-06-27 22:25:27 +03:00
~cmCPackNSISGenerator() CM_OVERRIDE;
2006-01-02 07:21:05 +03:00
protected:
2016-06-27 22:25:27 +03:00
int InitializeInternal() CM_OVERRIDE;
void CreateMenuLinks(std::ostream& str, std::ostream& deleteStr);
2016-06-27 22:25:27 +03:00
int PackageFiles() CM_OVERRIDE;
const char* GetOutputExtension() CM_OVERRIDE { return ".exe"; }
const char* GetOutputPostfix() CM_OVERRIDE { return "win32"; }
bool GetListOfSubdirectories(const char* dir,
std::vector<std::string>& dirs);
2016-06-27 22:25:27 +03:00
enum cmCPackGenerator::CPackSetDestdirSupport SupportsSetDestdir() const
CM_OVERRIDE;
bool SupportsAbsoluteDestination() const CM_OVERRIDE;
bool SupportsComponentInstallation() const CM_OVERRIDE;
2011-10-13 21:51:18 +04:00
/// Produce a string that contains the NSIS code to describe a
/// particular component. Any added macros will be emitted via
ENH: Further refinement of the CPack components functionality from Doug Gregor. Details: ========== - New cpack_add_component, cpack_add_component_group, and cpack_add_install_type "commands" defined as macros in the CPack module. - Documentation for all of the variables and commands in the CPack module. - Added get_cmake_property(... COMPONENTS) to CMake to ask for the names of all components. Used in the CPack module to automatically build component-based installers. (Set CPACK_MONOLITHIC_INSTALL to turn off component-based installation). - A group can declare its PARENT_GROUP, to build an arbitrary hierarchy of groups. - New CPack command cpack_configure_downloads, which creates an installer that downloads only the selected components on-the-fly. Those components marked DOWNLOADED will be separate packages downloaded on-the-fly (or, all packages can be marked as such with the ALL option to cpack_configure_downloads). Individual components are compressed with ZIP at installer-creation time and downloaded/uncompressed by the installer as needed. This feature is only available on Windows with NSIS at the moment. - NSIS installers can install themselves and enable the "Change" button in Add/Remove programs, allowing users to go back and install or remove components. This can be disabled through cpack_configure_downloads, because it's only really useful is most of the application's functionality is in downloaded components. - Bug fix: automatically install everything whose COMPONENT was not specified (it's a hidden, required group) - Bug fix: fixed removal of components when re-running the NSIS installer and unchecking components - Bug fix: NSIS installers now only install/remove the minimal number of files when re-run to update the installation (or by clicking "Change" in Add/Remove programs)
2008-07-08 19:52:25 +04:00
/// macrosOut.
std::string CreateComponentDescription(cmCPackComponent* component,
std::ostream& macrosOut);
/// Produce NSIS code that selects all of the components that this component
/// depends on, recursively.
std::string CreateSelectionDependenciesDescription(
cmCPackComponent* component, std::set<cmCPackComponent*>& visited);
/// Produce NSIS code that de-selects all of the components that are
/// dependent on this component, recursively.
std::string CreateDeselectionDependenciesDescription(
cmCPackComponent* component, std::set<cmCPackComponent*>& visited);
2011-10-13 21:51:18 +04:00
/// Produce a string that contains the NSIS code to describe a
ENH: Further refinement of the CPack components functionality from Doug Gregor. Details: ========== - New cpack_add_component, cpack_add_component_group, and cpack_add_install_type "commands" defined as macros in the CPack module. - Documentation for all of the variables and commands in the CPack module. - Added get_cmake_property(... COMPONENTS) to CMake to ask for the names of all components. Used in the CPack module to automatically build component-based installers. (Set CPACK_MONOLITHIC_INSTALL to turn off component-based installation). - A group can declare its PARENT_GROUP, to build an arbitrary hierarchy of groups. - New CPack command cpack_configure_downloads, which creates an installer that downloads only the selected components on-the-fly. Those components marked DOWNLOADED will be separate packages downloaded on-the-fly (or, all packages can be marked as such with the ALL option to cpack_configure_downloads). Individual components are compressed with ZIP at installer-creation time and downloaded/uncompressed by the installer as needed. This feature is only available on Windows with NSIS at the moment. - NSIS installers can install themselves and enable the "Change" button in Add/Remove programs, allowing users to go back and install or remove components. This can be disabled through cpack_configure_downloads, because it's only really useful is most of the application's functionality is in downloaded components. - Bug fix: automatically install everything whose COMPONENT was not specified (it's a hidden, required group) - Bug fix: fixed removal of components when re-running the NSIS installer and unchecking components - Bug fix: NSIS installers now only install/remove the minimal number of files when re-run to update the installation (or by clicking "Change" in Add/Remove programs)
2008-07-08 19:52:25 +04:00
/// particular component group, including its components. Any
/// added macros will be emitted via macrosOut.
std::string CreateComponentGroupDescription(cmCPackComponentGroup* group,
std::ostream& macrosOut);
/// Returns the custom install directory if available for the specified
/// component, otherwise $INSTDIR is returned.
std::string CustomComponentInstallDirectory(
const std::string& componentName);
2011-03-20 16:22:39 +03:00
/// Translations any newlines found in the string into \\r\\n, so that the
/// resulting string can be used within NSIS.
static std::string TranslateNewlines(std::string str);
bool Nsis64;
2006-01-02 07:21:05 +03:00
};
#endif