1
0
mirror of https://github.com/Kitware/CMake.git synced 2025-06-16 17:03:54 +08:00
CMake/Source/cmFileInstaller.h
Felix Lelchuk 58d10cf6f1 Alternative symlink-creating mode for file(INSTALL ...)
An new environment variable 'CMAKE_INSTALL_MODE' is introduced,
which can be used to ask CMake to create symbolic links
instead of copying files during a file(INSTALL ...).

The operation is at the file level only, directory trees are
still created using actual directories, not links.

Signed-off-by: Felix Lelchuk <felix.lelchuk@gmx.de>
2021-08-02 19:42:26 +02:00

55 lines
1.5 KiB
C++

/* Distributed under the OSI-approved BSD 3-Clause License. See accompanying
file Copyright.txt or https://cmake.org/licensing for details. */
#pragma once
#include "cmConfigure.h" // IWYU pragma: keep
#include <string>
#include <vector>
#include "cmFileCopier.h"
#include "cmInstallMode.h"
#include "cmInstallType.h"
class cmExecutionStatus;
struct cmFileInstaller : public cmFileCopier
{
cmFileInstaller(cmExecutionStatus& status);
~cmFileInstaller() override;
protected:
cmInstallType InstallType;
cmInstallMode InstallMode;
bool Optional;
bool MessageAlways;
bool MessageLazy;
bool MessageNever;
int DestDirLength;
std::string Rename;
std::string Manifest;
void ManifestAppend(std::string const& file);
std::string const& ToName(std::string const& fromName) override;
void ReportCopy(const std::string& toFile, Type type, bool copy) override;
bool ReportMissing(const std::string& fromFile) override;
bool Install(const std::string& fromFile,
const std::string& toFile) override;
bool InstallFile(const std::string& fromFile, const std::string& toFile,
MatchProperties match_properties) override;
bool Parse(std::vector<std::string> const& args) override;
enum
{
DoingType = DoingLast1,
DoingRename,
DoingLast2
};
bool CheckKeyword(std::string const& arg) override;
bool CheckValue(std::string const& arg) override;
void DefaultFilePermissions() override;
bool GetTargetTypeFromString(const std::string& stype);
bool HandleInstallDestination();
};