diff options
-rw-r--r-- | Help/cpack_gen/innosetup.rst | 6 | ||||
-rw-r--r-- | Help/release/dev/cpack-innosetup-linux.rst | 5 | ||||
-rw-r--r-- | Source/CPack/cmCPackInnoSetupGenerator.cxx | 22 | ||||
-rw-r--r-- | Source/CPack/cmCPackInnoSetupGenerator.h | 9 |
4 files changed, 31 insertions, 11 deletions
diff --git a/Help/cpack_gen/innosetup.rst b/Help/cpack_gen/innosetup.rst index f48e7f5..ffdf508 100644 --- a/Help/cpack_gen/innosetup.rst +++ b/Help/cpack_gen/innosetup.rst @@ -12,7 +12,11 @@ The generator provides a lot of options like components. Unfortunately, not all features (e.g. component dependencies) are currently supported by Inno Setup and they're ignored by the generator for now. -CPack requires Inno Setup 6 or greater and only works on Windows. +CPack requires Inno Setup 6 or greater. + +.. versionadded:: 3.30 + The generator is now available on non-Windows hosts, + but requires Wine to run the Inno Setup tools. Variables specific to CPack Inno Setup generator ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ diff --git a/Help/release/dev/cpack-innosetup-linux.rst b/Help/release/dev/cpack-innosetup-linux.rst new file mode 100644 index 0000000..8909ca9 --- /dev/null +++ b/Help/release/dev/cpack-innosetup-linux.rst @@ -0,0 +1,5 @@ +cpack-innosetup-linux +--------------------- + +* The :cpack_gen:`CPack Inno Setup Generator` is now available + on non-Windows hosts. diff --git a/Source/CPack/cmCPackInnoSetupGenerator.cxx b/Source/CPack/cmCPackInnoSetupGenerator.cxx index dd0065f..17ea89f 100644 --- a/Source/CPack/cmCPackInnoSetupGenerator.cxx +++ b/Source/CPack/cmCPackInnoSetupGenerator.cxx @@ -24,12 +24,7 @@ cmCPackInnoSetupGenerator::~cmCPackInnoSetupGenerator() = default; bool cmCPackInnoSetupGenerator::CanGenerate() { - // Inno Setup is only available for Windows -#ifdef _WIN32 return true; -#else - return false; -#endif } int cmCPackInnoSetupGenerator::InitializeInternal() @@ -63,7 +58,8 @@ int cmCPackInnoSetupGenerator::InitializeInternal() return 0; } - const std::string isccCmd = cmStrCat(QuotePath(isccPath), "/?"); + const std::string isccCmd = + cmStrCat(QuotePath(isccPath, PathType::Native), "/?"); cmCPackLogger(cmCPackLog::LOG_VERBOSE, "Test Inno Setup version: " << isccCmd << std::endl); std::string output; @@ -869,8 +865,8 @@ bool cmCPackInnoSetupGenerator::Compile() } const std::string& isccCmd = - cmStrCat(QuotePath(GetOption("CPACK_INSTALLER_PROGRAM")), ' ', - cmJoin(isccArgs, " "), ' ', QuotePath(isScriptFile)); + cmStrCat(QuotePath(GetOption("CPACK_INSTALLER_PROGRAM"), PathType::Native), + ' ', cmJoin(isccArgs, " "), ' ', QuotePath(isScriptFile)); cmCPackLogger(cmCPackLog::LOG_VERBOSE, "Execute: " << isccCmd << std::endl); @@ -1136,8 +1132,16 @@ std::string cmCPackInnoSetupGenerator::Quote(const std::string& string) return cmStrCat('"', nString, '"'); } -std::string cmCPackInnoSetupGenerator::QuotePath(const std::string& path) +std::string cmCPackInnoSetupGenerator::QuotePath(const std::string& path, + PathType type) { +#ifdef _WIN32 + static_cast<void>(type); +#else + if (type == PathType::Native) { + return Quote(cmSystemTools::ConvertToUnixOutputPath(path)); + } +#endif return Quote(cmSystemTools::ConvertToWindowsOutputPath(path)); } diff --git a/Source/CPack/cmCPackInnoSetupGenerator.h b/Source/CPack/cmCPackInnoSetupGenerator.h index 342f227..e057e6c 100644 --- a/Source/CPack/cmCPackInnoSetupGenerator.h +++ b/Source/CPack/cmCPackInnoSetupGenerator.h @@ -49,6 +49,12 @@ protected: inline bool SupportsComponentInstallation() const override { return true; } private: + enum class PathType + { + Windows, + Native, + }; + bool ProcessSetupSection(); bool ProcessFiles(); bool ProcessComponents(); @@ -92,7 +98,8 @@ private: * Paths are converted into the format used by Windows before. */ std::string Quote(const std::string& string); - std::string QuotePath(const std::string& path); + std::string QuotePath(const std::string& path, + PathType type = PathType::Windows); /** * This function replaces the following 5 characters with their %-encoding: |