diff options
author | Nils Gladitz <nilsgladitz@gmail.com> | 2015-02-21 11:38:14 (GMT) |
---|---|---|
committer | Nils Gladitz <nilsgladitz@gmail.com> | 2015-02-21 11:38:14 (GMT) |
commit | 53d7dafface62d40ea795456394f7ab1d5ee6712 (patch) | |
tree | 6c8e3c7038b1831b857b481c16071d493775e123 /Source/CPack/WiX/cmWIXShortcut.h | |
parent | dc0f3fb44fb9384438ece513c12d83a36e385802 (diff) | |
download | CMake-53d7dafface62d40ea795456394f7ab1d5ee6712.zip CMake-53d7dafface62d40ea795456394f7ab1d5ee6712.tar.gz CMake-53d7dafface62d40ea795456394f7ab1d5ee6712.tar.bz2 |
CPackWIX: Refactor start menu and desktop shortcut creation.
Diffstat (limited to 'Source/CPack/WiX/cmWIXShortcut.h')
-rw-r--r-- | Source/CPack/WiX/cmWIXShortcut.h | 49 |
1 files changed, 40 insertions, 9 deletions
diff --git a/Source/CPack/WiX/cmWIXShortcut.h b/Source/CPack/WiX/cmWIXShortcut.h index 93095e0..a18cbb3 100644 --- a/Source/CPack/WiX/cmWIXShortcut.h +++ b/Source/CPack/WiX/cmWIXShortcut.h @@ -1,6 +1,6 @@ /*============================================================================ CMake - Cross Platform Makefile Generator - 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. @@ -10,20 +10,51 @@ See the License for more information. ============================================================================*/ -#ifndef cmWIXFilesShortcut_h -#define cmWIXFilesShortcut_h +#ifndef cmWIXShortcut_h +#define cmWIXShortcut_h #include <string> +#include <map> +#include <set> +#include <vector> + +class cmWIXFilesSourceWriter; struct cmWIXShortcut { - cmWIXShortcut() - :desktop(false) - {} - - std::string textLabel; + std::string label; std::string workingDirectoryId; - bool desktop; +}; + +class cmWIXShortcuts +{ +public: + enum Type + { + START_MENU, + DESKTOP + }; + + typedef std::vector<cmWIXShortcut> shortcut_list_t; + typedef std::map<std::string, shortcut_list_t> shortcut_id_map_t; + + void insert(Type type, std::string const& id, cmWIXShortcut const& shortcut); + + bool empty(Type type) const; + + bool EmitShortcuts( + Type type, + std::string const& registryKey, + std::string const& cpackComponentName, + cmWIXFilesSourceWriter& fileDefinitions) const; + + void AddShortcutTypes(std::set<Type>& types); + +private: + typedef std::map<Type, shortcut_id_map_t> shortcut_type_map_t; + + shortcut_type_map_t Shortcuts; + shortcut_id_map_t EmptyIdMap; }; #endif |