ENH: determine the current system also in cpack, so the search paths are
loaded Additionally the makefile in cmCPackGenericGenerator is now protected instead of private, so with these two changes the cpack generators should now be able to find their tools and how to call these tools from cmake scripts, instead of hardcoding the search order and command line (as done e.g. in cmCPackZIPGenerator.cxx) Alex
This commit is contained in:
parent
8240cc006f
commit
8a6e2bb81d
|
@ -124,35 +124,40 @@ ENDMACRO(ADJUST_CMAKE_SYSTEM_VARIABLES _PREFIX)
|
||||||
ADJUST_CMAKE_SYSTEM_VARIABLES(CMAKE_SYSTEM)
|
ADJUST_CMAKE_SYSTEM_VARIABLES(CMAKE_SYSTEM)
|
||||||
ADJUST_CMAKE_SYSTEM_VARIABLES(CMAKE_HOST_SYSTEM)
|
ADJUST_CMAKE_SYSTEM_VARIABLES(CMAKE_HOST_SYSTEM)
|
||||||
|
|
||||||
# write entry to the log file
|
# this file is also executed from cpack, then we don't need to generate these files
|
||||||
IF(PRESET_CMAKE_SYSTEM_NAME)
|
# in this case there is no CMAKE_BINARY_DIR
|
||||||
FILE(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log
|
IF(CMAKE_BINARY_DIR)
|
||||||
"The target system is: ${CMAKE_SYSTEM_NAME} - ${CMAKE_SYSTEM_VERSION} - ${CMAKE_SYSTEM_PROCESSOR}\n")
|
# write entry to the log file
|
||||||
FILE(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log
|
IF(PRESET_CMAKE_SYSTEM_NAME)
|
||||||
"The host system is: ${CMAKE_HOST_SYSTEM_NAME} - ${CMAKE_HOST_SYSTEM_VERSION} - ${CMAKE_HOST_SYSTEM_PROCESSOR}\n")
|
FILE(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log
|
||||||
ELSE(PRESET_CMAKE_SYSTEM_NAME)
|
"The target system is: ${CMAKE_SYSTEM_NAME} - ${CMAKE_SYSTEM_VERSION} - ${CMAKE_SYSTEM_PROCESSOR}\n")
|
||||||
FILE(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log
|
FILE(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log
|
||||||
"The system is: ${CMAKE_SYSTEM_NAME} - ${CMAKE_SYSTEM_VERSION} - ${CMAKE_SYSTEM_PROCESSOR}\n")
|
"The host system is: ${CMAKE_HOST_SYSTEM_NAME} - ${CMAKE_HOST_SYSTEM_VERSION} - ${CMAKE_HOST_SYSTEM_PROCESSOR}\n")
|
||||||
ENDIF(PRESET_CMAKE_SYSTEM_NAME)
|
ELSE(PRESET_CMAKE_SYSTEM_NAME)
|
||||||
|
FILE(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log
|
||||||
|
"The system is: ${CMAKE_SYSTEM_NAME} - ${CMAKE_SYSTEM_VERSION} - ${CMAKE_SYSTEM_PROCESSOR}\n")
|
||||||
|
ENDIF(PRESET_CMAKE_SYSTEM_NAME)
|
||||||
|
|
||||||
|
|
||||||
# if a toolchain file is used use configure_file() to copy it into the
|
# if a toolchain file is used use configure_file() to copy it into the
|
||||||
# build tree, because this way e.g. ${CMAKE_SOURCE_DIR} will be replaced
|
# build tree, because this way e.g. ${CMAKE_SOURCE_DIR} will be replaced
|
||||||
# with its full path, and so it will also work when used in try_compile()
|
# with its full path, and so it will also work when used in try_compile()
|
||||||
IF (CMAKE_TOOLCHAIN_FILE)
|
IF (CMAKE_TOOLCHAIN_FILE)
|
||||||
|
|
||||||
SET(_OWN_DIR ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY})
|
SET(_OWN_DIR ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY})
|
||||||
CONFIGURE_FILE(${CMAKE_TOOLCHAIN_FILE}
|
CONFIGURE_FILE(${CMAKE_TOOLCHAIN_FILE}
|
||||||
${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeToolchainFile.cmake)
|
${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeToolchainFile.cmake)
|
||||||
|
|
||||||
CONFIGURE_FILE(${CMAKE_ROOT}/Modules/CMakeSystemWithToolchainFile.cmake.in
|
CONFIGURE_FILE(${CMAKE_ROOT}/Modules/CMakeSystemWithToolchainFile.cmake.in
|
||||||
${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeSystem.cmake
|
${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeSystem.cmake
|
||||||
IMMEDIATE @ONLY)
|
IMMEDIATE @ONLY)
|
||||||
ELSE (CMAKE_TOOLCHAIN_FILE)
|
ELSE (CMAKE_TOOLCHAIN_FILE)
|
||||||
|
|
||||||
# configure variables set in this file for fast reload, the template file is defined at the top of this file
|
# configure variables set in this file for fast reload, the template file is defined at the top of this file
|
||||||
CONFIGURE_FILE(${CMAKE_ROOT}/Modules/CMakeSystem.cmake.in
|
CONFIGURE_FILE(${CMAKE_ROOT}/Modules/CMakeSystem.cmake.in
|
||||||
${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeSystem.cmake
|
${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeSystem.cmake
|
||||||
IMMEDIATE @ONLY)
|
IMMEDIATE @ONLY)
|
||||||
|
|
||||||
ENDIF (CMAKE_TOOLCHAIN_FILE)
|
ENDIF (CMAKE_TOOLCHAIN_FILE)
|
||||||
|
|
||||||
|
ENDIF(CMAKE_BINARY_DIR)
|
||||||
|
|
|
@ -32,14 +32,14 @@
|
||||||
cmCPackGenericGenerator::cmCPackGenericGenerator()
|
cmCPackGenericGenerator::cmCPackGenericGenerator()
|
||||||
{
|
{
|
||||||
this->GeneratorVerbose = false;
|
this->GeneratorVerbose = false;
|
||||||
this->MakefileMap = 0;
|
this->Makefile = 0;
|
||||||
this->Logger = 0;
|
this->Logger = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
cmCPackGenericGenerator::~cmCPackGenericGenerator()
|
cmCPackGenericGenerator::~cmCPackGenericGenerator()
|
||||||
{
|
{
|
||||||
this->MakefileMap = 0;
|
this->Makefile = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
|
@ -392,7 +392,7 @@ int cmCPackGenericGenerator::InstallProjectViaInstallScript(
|
||||||
tempInstallDirectory);
|
tempInstallDirectory);
|
||||||
this->SetOptionIfNotSet("CMAKE_CURRENT_SOURCE_DIR",
|
this->SetOptionIfNotSet("CMAKE_CURRENT_SOURCE_DIR",
|
||||||
tempInstallDirectory);
|
tempInstallDirectory);
|
||||||
int res = this->MakefileMap->ReadListFile(0, installScript.c_str());
|
int res = this->Makefile->ReadListFile(0, installScript.c_str());
|
||||||
if ( cmSystemTools::GetErrorOccuredFlag() || !res )
|
if ( cmSystemTools::GetErrorOccuredFlag() || !res )
|
||||||
{
|
{
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -454,7 +454,7 @@ int cmCPackGenericGenerator::InstallProjectViaInstallCMakeProjects(
|
||||||
|
|
||||||
const char* buildConfig = this->GetOption("CPACK_BUILD_CONFIG");
|
const char* buildConfig = this->GetOption("CPACK_BUILD_CONFIG");
|
||||||
cmGlobalGenerator* globalGenerator
|
cmGlobalGenerator* globalGenerator
|
||||||
= this->MakefileMap->GetCMakeInstance()->CreateGlobalGenerator(
|
= this->Makefile->GetCMakeInstance()->CreateGlobalGenerator(
|
||||||
cmakeGenerator);
|
cmakeGenerator);
|
||||||
// set the global flag for unix style paths on cmSystemTools as
|
// set the global flag for unix style paths on cmSystemTools as
|
||||||
// soon as the generator is set. This allows gmake to be used
|
// soon as the generator is set. This allows gmake to be used
|
||||||
|
@ -464,9 +464,9 @@ int cmCPackGenericGenerator::InstallProjectViaInstallCMakeProjects(
|
||||||
// Does this generator require pre-install?
|
// Does this generator require pre-install?
|
||||||
if ( globalGenerator->GetPreinstallTargetName() )
|
if ( globalGenerator->GetPreinstallTargetName() )
|
||||||
{
|
{
|
||||||
globalGenerator->FindMakeProgram(this->MakefileMap);
|
globalGenerator->FindMakeProgram(this->Makefile);
|
||||||
const char* cmakeMakeProgram
|
const char* cmakeMakeProgram
|
||||||
= this->MakefileMap->GetDefinition("CMAKE_MAKE_PROGRAM");
|
= this->Makefile->GetDefinition("CMAKE_MAKE_PROGRAM");
|
||||||
std::string buildCommand
|
std::string buildCommand
|
||||||
= globalGenerator->GenerateBuildCommand(cmakeMakeProgram,
|
= globalGenerator->GenerateBuildCommand(cmakeMakeProgram,
|
||||||
installProjectName.c_str(), 0,
|
installProjectName.c_str(), 0,
|
||||||
|
@ -554,7 +554,7 @@ int cmCPackGenericGenerator::InstallProjectViaInstallCMakeProjects(
|
||||||
void cmCPackGenericGenerator::SetOptionIfNotSet(const char* op,
|
void cmCPackGenericGenerator::SetOptionIfNotSet(const char* op,
|
||||||
const char* value)
|
const char* value)
|
||||||
{
|
{
|
||||||
const char* def = this->MakefileMap->GetDefinition(op);
|
const char* def = this->Makefile->GetDefinition(op);
|
||||||
if ( def && *def )
|
if ( def && *def )
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
|
@ -571,12 +571,12 @@ void cmCPackGenericGenerator::SetOption(const char* op, const char* value)
|
||||||
}
|
}
|
||||||
if ( !value )
|
if ( !value )
|
||||||
{
|
{
|
||||||
this->MakefileMap->RemoveDefinition(op);
|
this->Makefile->RemoveDefinition(op);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
cmCPackLogger(cmCPackLog::LOG_DEBUG, this->GetNameOfClass()
|
cmCPackLogger(cmCPackLog::LOG_DEBUG, this->GetNameOfClass()
|
||||||
<< "::SetOption(" << op << ", " << value << ")" << std::endl);
|
<< "::SetOption(" << op << ", " << value << ")" << std::endl);
|
||||||
this->MakefileMap->AddDefinition(op, value);
|
this->Makefile->AddDefinition(op, value);
|
||||||
}
|
}
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
|
@ -680,7 +680,7 @@ int cmCPackGenericGenerator::ProcessGenerator()
|
||||||
int cmCPackGenericGenerator::Initialize(const char* name, cmMakefile* mf,
|
int cmCPackGenericGenerator::Initialize(const char* name, cmMakefile* mf,
|
||||||
const char* argv0)
|
const char* argv0)
|
||||||
{
|
{
|
||||||
this->MakefileMap = mf;
|
this->Makefile = mf;
|
||||||
this->Name = name;
|
this->Name = name;
|
||||||
if ( !this->FindRunningCMake(argv0) )
|
if ( !this->FindRunningCMake(argv0) )
|
||||||
{
|
{
|
||||||
|
@ -700,7 +700,7 @@ int cmCPackGenericGenerator::InitializeInternal()
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
const char* cmCPackGenericGenerator::GetOption(const char* op)
|
const char* cmCPackGenericGenerator::GetOption(const char* op)
|
||||||
{
|
{
|
||||||
return this->MakefileMap->GetDefinition(op);
|
return this->Makefile->GetDefinition(op);
|
||||||
}
|
}
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
|
@ -913,7 +913,7 @@ std::string cmCPackGenericGenerator::FindTemplate(const char* name)
|
||||||
{
|
{
|
||||||
cmCPackLogger(cmCPackLog::LOG_DEBUG, "Look for template: "
|
cmCPackLogger(cmCPackLog::LOG_DEBUG, "Look for template: "
|
||||||
<< (name ? name : "(NULL)") << std::endl);
|
<< (name ? name : "(NULL)") << std::endl);
|
||||||
std::string ffile = this->MakefileMap->GetModulesFile(name);
|
std::string ffile = this->Makefile->GetModulesFile(name);
|
||||||
cmCPackLogger(cmCPackLog::LOG_DEBUG, "Found template: "
|
cmCPackLogger(cmCPackLog::LOG_DEBUG, "Found template: "
|
||||||
<< ffile.c_str() << std::endl);
|
<< ffile.c_str() << std::endl);
|
||||||
return ffile;
|
return ffile;
|
||||||
|
@ -923,7 +923,7 @@ std::string cmCPackGenericGenerator::FindTemplate(const char* name)
|
||||||
bool cmCPackGenericGenerator::ConfigureString(const std::string& inString,
|
bool cmCPackGenericGenerator::ConfigureString(const std::string& inString,
|
||||||
std::string& outString)
|
std::string& outString)
|
||||||
{
|
{
|
||||||
this->MakefileMap->ConfigureString(inString,
|
this->Makefile->ConfigureString(inString,
|
||||||
outString, true, false);
|
outString, true, false);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -932,7 +932,7 @@ bool cmCPackGenericGenerator::ConfigureString(const std::string& inString,
|
||||||
bool cmCPackGenericGenerator::ConfigureFile(const char* inName,
|
bool cmCPackGenericGenerator::ConfigureFile(const char* inName,
|
||||||
const char* outName, bool copyOnly /* = false */)
|
const char* outName, bool copyOnly /* = false */)
|
||||||
{
|
{
|
||||||
return this->MakefileMap->ConfigureFile(inName, outName,
|
return this->Makefile->ConfigureFile(inName, outName,
|
||||||
copyOnly, true, false) == 1;
|
copyOnly, true, false) == 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -130,8 +130,7 @@ protected:
|
||||||
|
|
||||||
cmCPackLog* Logger;
|
cmCPackLog* Logger;
|
||||||
|
|
||||||
private:
|
cmMakefile* Makefile;
|
||||||
cmMakefile* MakefileMap;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -243,6 +243,25 @@ int main (int argc, char *argv[])
|
||||||
|
|
||||||
if ( parsed && !help )
|
if ( parsed && !help )
|
||||||
{
|
{
|
||||||
|
// find out which system cpack is running on, so it can setup the search
|
||||||
|
// paths, so FIND_XXX() commands can be used in scripts
|
||||||
|
cminst.AddCMakePaths(argv[0]);
|
||||||
|
std::string systemFile = globalMF->GetModulesFile("CMakeDetermineSystem.cmake");
|
||||||
|
if (!globalMF->ReadListFile(0, systemFile.c_str()))
|
||||||
|
{
|
||||||
|
cmCPack_Log(&log, cmCPackLog::LOG_ERROR,
|
||||||
|
"Error reading CMakeDetermineSystem.cmake" << std::endl);
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
systemFile = globalMF->GetModulesFile("CMakeSystemSpecificInformation.cmake");
|
||||||
|
if (!globalMF->ReadListFile(0, systemFile.c_str()))
|
||||||
|
{
|
||||||
|
cmCPack_Log(&log, cmCPackLog::LOG_ERROR,
|
||||||
|
"Error reading CMakeSystemSpecificInformation.cmake" << std::endl);
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
if ( cmSystemTools::FileExists(cpackConfigFile.c_str()) )
|
if ( cmSystemTools::FileExists(cpackConfigFile.c_str()) )
|
||||||
{
|
{
|
||||||
cpackConfigFile =
|
cpackConfigFile =
|
||||||
|
@ -327,94 +346,92 @@ int main (int argc, char *argv[])
|
||||||
const char* gen = it->c_str();
|
const char* gen = it->c_str();
|
||||||
cmMakefile newMF(*globalMF);
|
cmMakefile newMF(*globalMF);
|
||||||
cmMakefile* mf = &newMF;
|
cmMakefile* mf = &newMF;
|
||||||
|
cmCPack_Log(&log, cmCPackLog::LOG_VERBOSE,
|
||||||
|
"Specified generator: " << gen << std::endl);
|
||||||
|
if ( parsed && !mf->GetDefinition("CPACK_PACKAGE_NAME") )
|
||||||
{
|
{
|
||||||
cmCPack_Log(&log, cmCPackLog::LOG_VERBOSE,
|
cmCPack_Log(&log, cmCPackLog::LOG_ERROR,
|
||||||
"Specified generator: " << gen << std::endl);
|
"CPack project name not specified" << std::endl);
|
||||||
if ( parsed && !mf->GetDefinition("CPACK_PACKAGE_NAME") )
|
parsed = 0;
|
||||||
|
}
|
||||||
|
if ( parsed && !(mf->GetDefinition("CPACK_PACKAGE_VERSION")
|
||||||
|
|| mf->GetDefinition("CPACK_PACKAGE_VERSION_MAJOR") &&
|
||||||
|
mf->GetDefinition("CPACK_PACKAGE_VERSION_MINOR")
|
||||||
|
&& mf->GetDefinition("CPACK_PACKAGE_VERSION_PATCH")) )
|
||||||
|
{
|
||||||
|
cmCPack_Log(&log, cmCPackLog::LOG_ERROR,
|
||||||
|
"CPack project version not specified" << std::endl
|
||||||
|
<< "Specify CPACK_PACKAGE_VERSION, or "
|
||||||
|
"CPACK_PACKAGE_VERSION_MAJOR, "
|
||||||
|
"CPACK_PACKAGE_VERSION_MINOR, and CPACK_PACKAGE_VERSION_PATCH."
|
||||||
|
<< std::endl);
|
||||||
|
parsed = 0;
|
||||||
|
}
|
||||||
|
if ( parsed )
|
||||||
|
{
|
||||||
|
cpackGenerator = generators.NewGenerator(gen);
|
||||||
|
if ( !cpackGenerator )
|
||||||
{
|
{
|
||||||
cmCPack_Log(&log, cmCPackLog::LOG_ERROR,
|
cmCPack_Log(&log, cmCPackLog::LOG_ERROR,
|
||||||
"CPack project name not specified" << std::endl);
|
"Cannot initialize CPack generator: "
|
||||||
|
<< generator.c_str() << std::endl);
|
||||||
parsed = 0;
|
parsed = 0;
|
||||||
}
|
}
|
||||||
if ( parsed && !(mf->GetDefinition("CPACK_PACKAGE_VERSION")
|
if ( parsed && !cpackGenerator->Initialize(gen, mf, argv[0]) )
|
||||||
|| mf->GetDefinition("CPACK_PACKAGE_VERSION_MAJOR") &&
|
|
||||||
mf->GetDefinition("CPACK_PACKAGE_VERSION_MINOR")
|
|
||||||
&& mf->GetDefinition("CPACK_PACKAGE_VERSION_PATCH")) )
|
|
||||||
{
|
{
|
||||||
cmCPack_Log(&log, cmCPackLog::LOG_ERROR,
|
cmCPack_Log(&log, cmCPackLog::LOG_ERROR,
|
||||||
"CPack project version not specified" << std::endl
|
"Cannot initialize the generator" << std::endl);
|
||||||
<< "Specify CPACK_PACKAGE_VERSION, or "
|
parsed = 0;
|
||||||
"CPACK_PACKAGE_VERSION_MAJOR, "
|
}
|
||||||
"CPACK_PACKAGE_VERSION_MINOR, and CPACK_PACKAGE_VERSION_PATCH."
|
|
||||||
|
if ( !mf->GetDefinition("CPACK_INSTALL_COMMANDS") &&
|
||||||
|
!mf->GetDefinition("CPACK_INSTALLED_DIRECTORIES") &&
|
||||||
|
!mf->GetDefinition("CPACK_INSTALL_CMAKE_PROJECTS") )
|
||||||
|
{
|
||||||
|
cmCPack_Log(&log, cmCPackLog::LOG_ERROR,
|
||||||
|
"Please specify build tree of the project that uses CMake "
|
||||||
|
"using CPACK_INSTALL_CMAKE_PROJECTS, specify "
|
||||||
|
"CPACK_INSTALL_COMMANDS, or specify "
|
||||||
|
"CPACK_INSTALLED_DIRECTORIES."
|
||||||
<< std::endl);
|
<< std::endl);
|
||||||
parsed = 0;
|
parsed = 0;
|
||||||
}
|
}
|
||||||
if ( parsed )
|
if ( parsed )
|
||||||
{
|
{
|
||||||
cpackGenerator = generators.NewGenerator(gen);
|
|
||||||
if ( !cpackGenerator )
|
|
||||||
{
|
|
||||||
cmCPack_Log(&log, cmCPackLog::LOG_ERROR,
|
|
||||||
"Cannot initialize CPack generator: "
|
|
||||||
<< generator.c_str() << std::endl);
|
|
||||||
parsed = 0;
|
|
||||||
}
|
|
||||||
if ( parsed && !cpackGenerator->Initialize(gen, mf, argv[0]) )
|
|
||||||
{
|
|
||||||
cmCPack_Log(&log, cmCPackLog::LOG_ERROR,
|
|
||||||
"Cannot initialize the generator" << std::endl);
|
|
||||||
parsed = 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
if ( !mf->GetDefinition("CPACK_INSTALL_COMMANDS") &&
|
|
||||||
!mf->GetDefinition("CPACK_INSTALLED_DIRECTORIES") &&
|
|
||||||
!mf->GetDefinition("CPACK_INSTALL_CMAKE_PROJECTS") )
|
|
||||||
{
|
|
||||||
cmCPack_Log(&log, cmCPackLog::LOG_ERROR,
|
|
||||||
"Please specify build tree of the project that uses CMake "
|
|
||||||
"using CPACK_INSTALL_CMAKE_PROJECTS, specify "
|
|
||||||
"CPACK_INSTALL_COMMANDS, or specify "
|
|
||||||
"CPACK_INSTALLED_DIRECTORIES."
|
|
||||||
<< std::endl);
|
|
||||||
parsed = 0;
|
|
||||||
}
|
|
||||||
if ( parsed )
|
|
||||||
{
|
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
std::string comspec = "cmw9xcom.exe";
|
std::string comspec = "cmw9xcom.exe";
|
||||||
cmSystemTools::SetWindows9xComspecSubstitute(comspec.c_str());
|
cmSystemTools::SetWindows9xComspecSubstitute(comspec.c_str());
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
const char* projName = mf->GetDefinition("CPACK_PACKAGE_NAME");
|
const char* projName = mf->GetDefinition("CPACK_PACKAGE_NAME");
|
||||||
cmCPack_Log(&log, cmCPackLog::LOG_VERBOSE, "Use generator: "
|
cmCPack_Log(&log, cmCPackLog::LOG_VERBOSE, "Use generator: "
|
||||||
<< cpackGenerator->GetNameOfClass() << std::endl);
|
<< cpackGenerator->GetNameOfClass() << std::endl);
|
||||||
cmCPack_Log(&log, cmCPackLog::LOG_VERBOSE, "For project: "
|
cmCPack_Log(&log, cmCPackLog::LOG_VERBOSE, "For project: "
|
||||||
<< projName << std::endl);
|
<< projName << std::endl);
|
||||||
|
|
||||||
const char* projVersion =
|
const char* projVersion =
|
||||||
mf->GetDefinition("CPACK_PACKAGE_VERSION");
|
mf->GetDefinition("CPACK_PACKAGE_VERSION");
|
||||||
if ( !projVersion )
|
if ( !projVersion )
|
||||||
{
|
{
|
||||||
const char* projVersionMajor
|
const char* projVersionMajor
|
||||||
= mf->GetDefinition("CPACK_PACKAGE_VERSION_MAJOR");
|
= mf->GetDefinition("CPACK_PACKAGE_VERSION_MAJOR");
|
||||||
const char* projVersionMinor
|
const char* projVersionMinor
|
||||||
= mf->GetDefinition("CPACK_PACKAGE_VERSION_MINOR");
|
= mf->GetDefinition("CPACK_PACKAGE_VERSION_MINOR");
|
||||||
const char* projVersionPatch
|
const char* projVersionPatch
|
||||||
= mf->GetDefinition("CPACK_PACKAGE_VERSION_PATCH");
|
= mf->GetDefinition("CPACK_PACKAGE_VERSION_PATCH");
|
||||||
cmOStringStream ostr;
|
cmOStringStream ostr;
|
||||||
ostr << projVersionMajor << "." << projVersionMinor << "."
|
ostr << projVersionMajor << "." << projVersionMinor << "."
|
||||||
<< projVersionPatch;
|
<< projVersionPatch;
|
||||||
mf->AddDefinition("CPACK_PACKAGE_VERSION",
|
mf->AddDefinition("CPACK_PACKAGE_VERSION",
|
||||||
ostr.str().c_str());
|
ostr.str().c_str());
|
||||||
}
|
}
|
||||||
|
|
||||||
int res = cpackGenerator->ProcessGenerator();
|
int res = cpackGenerator->ProcessGenerator();
|
||||||
if ( !res )
|
if ( !res )
|
||||||
{
|
{
|
||||||
cmCPack_Log(&log, cmCPackLog::LOG_ERROR,
|
cmCPack_Log(&log, cmCPackLog::LOG_ERROR,
|
||||||
"Error when generating package: " << projName << std::endl);
|
"Error when generating package: " << projName << std::endl);
|
||||||
return 1;
|
return 1;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue