ERR: Fix visual studio install

This commit is contained in:
Andy Cedilnik 2004-06-28 16:39:51 -04:00
parent f9b43b9212
commit ed0999c9d1
4 changed files with 33 additions and 9 deletions

View File

@ -249,6 +249,8 @@ bool cmFileCommand::HandleInstallCommand(
std::string destination = ""; std::string destination = "";
std::string stype = "FILES"; std::string stype = "FILES";
const char* build_type = m_Makefile->GetDefinition("BUILD_TYPE"); const char* build_type = m_Makefile->GetDefinition("BUILD_TYPE");
const char* debug_postfix
= m_Makefile->GetDefinition("CMAKE_DEBUG_POSTFIX");
const char* destdir = cmSystemTools::GetEnv("DESTDIR"); const char* destdir = cmSystemTools::GetEnv("DESTDIR");
std::string extra_dir = ""; std::string extra_dir = "";
@ -451,6 +453,10 @@ bool cmFileCommand::HandleInstallCommand(
case cmTarget::MODULE_LIBRARY: case cmTarget::MODULE_LIBRARY:
case cmTarget::STATIC_LIBRARY: case cmTarget::STATIC_LIBRARY:
case cmTarget::SHARED_LIBRARY: case cmTarget::SHARED_LIBRARY:
if ( debug )
{
fname = fnamewe + debug_postfix + ext;
}
{ {
// Handle shared library versioning // Handle shared library versioning
const char* lib_version = 0; const char* lib_version = 0;
@ -506,11 +512,15 @@ bool cmFileCommand::HandleInstallCommand(
} }
} }
cmOStringStream str; cmOStringStream str;
str << cmSystemTools::GetFilenamePath(ctarget) str << cmSystemTools::GetFilenamePath(ctarget) << "/";
<< "/" << extra_dir << "/" if ( extra_dir.size() > 0 )
<< fname; {
str << extra_dir << "/";
}
str << fname;
ctarget = str.str(); ctarget = str.str();
} }
break;
case cmTarget::EXECUTABLE: case cmTarget::EXECUTABLE:
if ( extra_dir.size() > 0 ) if ( extra_dir.size() > 0 )
{ {

View File

@ -482,14 +482,18 @@ int cmGlobalGenerator::TryCompile(const char *, const char *bindir,
} }
int retVal; int retVal;
int timeout = cmGlobalGenerator::s_TryCompileTimeout; int timeout = cmGlobalGenerator::s_TryCompileTimeout;
bool hideconsole = cmSystemTools::GetRunCommandHideConsole();
cmSystemTools::SetRunCommandHideConsole(true);
if (!cmSystemTools::RunSingleCommand(makeCommand.c_str(), output, if (!cmSystemTools::RunSingleCommand(makeCommand.c_str(), output,
&retVal, 0, false, timeout)) &retVal, 0, false, timeout))
{ {
cmSystemTools::SetRunCommandHideConsole(hideconsole);
cmSystemTools::Error("Generator: execution of make failed."); cmSystemTools::Error("Generator: execution of make failed.");
// return to the original directory // return to the original directory
cmSystemTools::ChangeDirectory(cwd.c_str()); cmSystemTools::ChangeDirectory(cwd.c_str());
return 1; return 1;
} }
cmSystemTools::SetRunCommandHideConsole(hideconsole);
// The SGI MipsPro 7.3 compiler does not return an error code when // The SGI MipsPro 7.3 compiler does not return an error code when
// the source has a #error in it! This is a work-around for such // the source has a #error in it! This is a work-around for such

View File

@ -17,11 +17,16 @@ IF(CMAKE_GENERATOR MATCHES "^Visual Studio")
SET(EXTRA_INSTALL_FLAGS -DBUILD_TYPE=${build_type}) SET(EXTRA_INSTALL_FLAGS -DBUILD_TYPE=${build_type})
ENDIF(MAKEPROGRAM MATCHES "- ${build_type}") ENDIF(MAKEPROGRAM MATCHES "- ${build_type}")
ENDFOREACH(build_type) ENDFOREACH(build_type)
IF(NOT EXTRA_INSTALL_FLAGS) IF(NOT ${EXTRA_INSTALL_FLAGS})
IF(BUILD_TYPE) IF(BUILD_TYPE)
SET(EXTRA_INSTALL_FLAGS -DBUILD_TYPE=${BUILD_TYPE}) SET(EXTRA_INSTALL_FLAGS -DBUILD_TYPE=${BUILD_TYPE})
ENDIF(BUILD_TYPE) ENDIF(BUILD_TYPE)
ENDIF(NOT EXTRA_INSTALL_FLAGS) ENDIF(NOT ${EXTRA_INSTALL_FLAGS})
IF(NOT DEFINED EXTRA_INSTALL_FLAGS)
IF(NOT "$ENV{SIMPLE_INSTALL_BUILD_TYPE}" MATCHES "^$")
SET(EXTRA_INSTALL_FLAGS -DBUILD_TYPE=$ENV{SIMPLE_INSTALL_BUILD_TYPE})
ENDIF(NOT "$ENV{SIMPLE_INSTALL_BUILD_TYPE}" MATCHES "^$")
ENDIF(NOT DEFINED EXTRA_INSTALL_FLAGS)
ENDIF(CMAKE_GENERATOR MATCHES "^Visual Studio") ENDIF(CMAKE_GENERATOR MATCHES "^Visual Studio")
MESSAGE("Extra install: ${EXTRA_INSTALL_FLAGS}") MESSAGE("Extra install: ${EXTRA_INSTALL_FLAGS}")
@ -71,7 +76,7 @@ ELSE(STAGE2)
ADD_DEPENDENCIES(SimpleInstall test3) ADD_DEPENDENCIES(SimpleInstall test3)
ADD_DEPENDENCIES(test2 test3) ADD_DEPENDENCIES(test2 test3)
ADD_DEPENDENCIES(test4 test3) ADD_DEPENDENCIES(test4 test2)
INSTALL_TARGETS(/bin SimpleInstall) INSTALL_TARGETS(/bin SimpleInstall)
INSTALL_TARGETS(/lib test1 test2 test3 test4) INSTALL_TARGETS(/lib test1 test2 test3 test4)

View File

@ -17,11 +17,16 @@ IF(CMAKE_GENERATOR MATCHES "^Visual Studio")
SET(EXTRA_INSTALL_FLAGS -DBUILD_TYPE=${build_type}) SET(EXTRA_INSTALL_FLAGS -DBUILD_TYPE=${build_type})
ENDIF(MAKEPROGRAM MATCHES "- ${build_type}") ENDIF(MAKEPROGRAM MATCHES "- ${build_type}")
ENDFOREACH(build_type) ENDFOREACH(build_type)
IF(NOT EXTRA_INSTALL_FLAGS) IF(NOT ${EXTRA_INSTALL_FLAGS})
IF(BUILD_TYPE) IF(BUILD_TYPE)
SET(EXTRA_INSTALL_FLAGS -DBUILD_TYPE=${BUILD_TYPE}) SET(EXTRA_INSTALL_FLAGS -DBUILD_TYPE=${BUILD_TYPE})
ENDIF(BUILD_TYPE) ENDIF(BUILD_TYPE)
ENDIF(NOT EXTRA_INSTALL_FLAGS) ENDIF(NOT ${EXTRA_INSTALL_FLAGS})
IF(NOT DEFINED EXTRA_INSTALL_FLAGS)
IF(NOT "$ENV{SIMPLE_INSTALL_BUILD_TYPE}" MATCHES "^$")
SET(EXTRA_INSTALL_FLAGS -DBUILD_TYPE=$ENV{SIMPLE_INSTALL_BUILD_TYPE})
ENDIF(NOT "$ENV{SIMPLE_INSTALL_BUILD_TYPE}" MATCHES "^$")
ENDIF(NOT DEFINED EXTRA_INSTALL_FLAGS)
ENDIF(CMAKE_GENERATOR MATCHES "^Visual Studio") ENDIF(CMAKE_GENERATOR MATCHES "^Visual Studio")
MESSAGE("Extra install: ${EXTRA_INSTALL_FLAGS}") MESSAGE("Extra install: ${EXTRA_INSTALL_FLAGS}")
@ -71,7 +76,7 @@ ELSE(STAGE2)
ADD_DEPENDENCIES(SimpleInstall test3) ADD_DEPENDENCIES(SimpleInstall test3)
ADD_DEPENDENCIES(test2 test3) ADD_DEPENDENCIES(test2 test3)
ADD_DEPENDENCIES(test4 test3) ADD_DEPENDENCIES(test4 test2)
INSTALL_TARGETS(/bin SimpleInstall) INSTALL_TARGETS(/bin SimpleInstall)
INSTALL_TARGETS(/lib test1 test2 test3 test4) INSTALL_TARGETS(/lib test1 test2 test3 test4)