From a12448c19ba732eaf9b5b2907bf25318f9f97ce8 Mon Sep 17 00:00:00 2001 From: Ken Martin Date: Tue, 15 May 2001 13:14:13 -0400 Subject: [PATCH] added output directory support --- Source/DLLHeader.dsptemplate | 5 +++-- Source/EXEHeader.dsptemplate | 6 +++--- Source/EXEWinHeader.dsptemplate | 6 +++--- Source/cmDSPMakefile.cxx | 16 ++++++++++++++++ Source/cmDSPWriter.cxx | 16 ++++++++++++++++ Source/staticLibHeader.dsptemplate | 6 +++--- 6 files changed, 44 insertions(+), 11 deletions(-) diff --git a/Source/DLLHeader.dsptemplate b/Source/DLLHeader.dsptemplate index 23387c18e..0c88beb13 100644 --- a/Source/DLLHeader.dsptemplate +++ b/Source/DLLHeader.dsptemplate @@ -52,7 +52,7 @@ RSC=rc.exe # PROP BASE Target_Dir "" # PROP Use_MFC 0 # PROP Use_Debug_Libraries 0 -# PROP Output_Dir "Release" +# PROP Output_Dir "OUTPUT_LIBRARY_PATHRelease" # PROP Intermediate_Dir "Release" # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" @@ -79,7 +79,7 @@ LINK32=link.exe # PROP BASE Target_Dir "" # PROP Use_MFC 0 # PROP Use_Debug_Libraries 1 -# PROP Output_Dir "Debug" +# PROP Output_Dir "OUTPUT_LIBRARY_PATHDebug" # PROP Intermediate_Dir "Debug" # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" @@ -104,3 +104,4 @@ LINK32=link.exe # Name "OUTPUT_LIBNAME - Win32 Release" # Name "OUTPUT_LIBNAME - Win32 Debug" + diff --git a/Source/EXEHeader.dsptemplate b/Source/EXEHeader.dsptemplate index dd23f8bdc..12adbcae9 100644 --- a/Source/EXEHeader.dsptemplate +++ b/Source/EXEHeader.dsptemplate @@ -51,7 +51,7 @@ RSC=rc.exe # PROP BASE Target_Dir "" # PROP Use_MFC 0 # PROP Use_Debug_Libraries 0 -# PROP Output_Dir "Release" +# PROP Output_Dir "OUTPUT_EXECUTABLE_PATHRelease" # PROP Intermediate_Dir "Release" # PROP Target_Dir "" # ADD BASE CPP /nologo /W3 /GR /GX /Zm1000 /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /FD /c @@ -76,7 +76,7 @@ CM_MULTILINE_LIBRARIES # PROP BASE Target_Dir "" # PROP Use_MFC 0 # PROP Use_Debug_Libraries 1 -# PROP Output_Dir "Debug" +# PROP Output_Dir "OUTPUT_EXECUTABLE_PATHDebug" # PROP Intermediate_Dir "Debug" # PROP Target_Dir "" # ADD BASE CPP /W3 /GR /Zm1000 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /FD /GZ /c @@ -102,7 +102,7 @@ CM_MULTILINE_LIBRARIES # PROP BASE Target_Dir "" # PROP Use_MFC 0 # PROP Use_Debug_Libraries 0 -# PROP Output_Dir "ReleaseMinSize" +# PROP Output_Dir "OUTPUT_EXECUTABLE_PATHReleaseMinSize" # PROP Intermediate_Dir "ReleaseMinSize" # PROP Target_Dir "" # ADD BASE CPP /nologo /MD /W3 /GR /GX /Zm1000 /O1 /Gs /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /FD /c diff --git a/Source/EXEWinHeader.dsptemplate b/Source/EXEWinHeader.dsptemplate index b226cb56f..b7bdfb57f 100644 --- a/Source/EXEWinHeader.dsptemplate +++ b/Source/EXEWinHeader.dsptemplate @@ -51,7 +51,7 @@ RSC=rc.exe # PROP BASE Target_Dir "" # PROP Use_MFC 0 # PROP Use_Debug_Libraries 0 -# PROP Output_Dir "Release" +# PROP Output_Dir "OUTPUT_EXECUTABLE_PATHRelease" # PROP Intermediate_Dir "Release" # PROP Target_Dir "" # ADD BASE CPP /nologo /W3 /GR /GX /Zm1000 /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /FD /c @@ -78,7 +78,7 @@ CM_MULTILINE_LIBRARIES # PROP BASE Target_Dir "" # PROP Use_MFC 0 # PROP Use_Debug_Libraries 1 -# PROP Output_Dir "Debug" +# PROP Output_Dir "OUTPUT_EXECUTABLE_PATHDebug" # PROP Intermediate_Dir "Debug" # PROP Target_Dir "" # ADD BASE CPP /W3 /GR /Zm1000 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /FD /GZ /c @@ -100,7 +100,7 @@ CM_MULTILINE_LIBRARIES !ELSEIF "$(CFG)" == "OUTPUT_LIBNAME - Win32 Release MinSize" # PROP BASE Use_MFC 0 # PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "ReleaseMinSize" +# PROP BASE Output_Dir "OUTPUT_EXECUTABLE_PATHReleaseMinSize" # PROP BASE Intermediate_Dir "ReleaseMinSize" # PROP BASE Target_Dir "" # PROP Use_MFC 0 diff --git a/Source/cmDSPMakefile.cxx b/Source/cmDSPMakefile.cxx index 005527678..e3600efd9 100644 --- a/Source/cmDSPMakefile.cxx +++ b/Source/cmDSPMakefile.cxx @@ -446,6 +446,18 @@ void cmDSPMakefile::WriteDSPHeader(std::ostream& fout, const char *libName, std::string libMultiLineDebugOptions; std::string libMultiLineOptimizedOptions; + // suppoirt override in output directory + std::string libPath = ""; + if (m_Makefile->GetDefinition("LIBRARY_OUTPUT_PATH")) + { + libPath = m_Makefile->GetDefinition("LIBRARY_OUTPUT_PATH"); + } + std::string exePath = ""; + if (m_Makefile->GetDefinition("EXECUTABLE_OUTPUT_PATH")) + { + exePath = m_Makefile->GetDefinition("EXECUTABLE_OUTPUT_PATH"); + } + std::vector::iterator i; std::vector& libdirs = m_Makefile->GetLinkDirectories(); for(i = libdirs.begin(); i != libdirs.end(); ++i) @@ -540,6 +552,10 @@ void cmDSPMakefile::WriteDSPHeader(std::ostream& fout, const char *libName, cmSystemTools::ReplaceString(line, "BUILD_INCLUDES", m_IncludeOptions.c_str()); cmSystemTools::ReplaceString(line, "OUTPUT_LIBNAME",libName); + cmSystemTools::ReplaceString(line, "OUTPUT_LIBRARY_PATH", + exePath.c_str()); + cmSystemTools::ReplaceString(line, "OUTPUT_EXECUTABLE_PATH", + exePath.c_str()); cmSystemTools::ReplaceString(line, "EXTRA_DEFINES", m_Makefile->GetDefineFlags()); diff --git a/Source/cmDSPWriter.cxx b/Source/cmDSPWriter.cxx index 005527678..e3600efd9 100644 --- a/Source/cmDSPWriter.cxx +++ b/Source/cmDSPWriter.cxx @@ -446,6 +446,18 @@ void cmDSPMakefile::WriteDSPHeader(std::ostream& fout, const char *libName, std::string libMultiLineDebugOptions; std::string libMultiLineOptimizedOptions; + // suppoirt override in output directory + std::string libPath = ""; + if (m_Makefile->GetDefinition("LIBRARY_OUTPUT_PATH")) + { + libPath = m_Makefile->GetDefinition("LIBRARY_OUTPUT_PATH"); + } + std::string exePath = ""; + if (m_Makefile->GetDefinition("EXECUTABLE_OUTPUT_PATH")) + { + exePath = m_Makefile->GetDefinition("EXECUTABLE_OUTPUT_PATH"); + } + std::vector::iterator i; std::vector& libdirs = m_Makefile->GetLinkDirectories(); for(i = libdirs.begin(); i != libdirs.end(); ++i) @@ -540,6 +552,10 @@ void cmDSPMakefile::WriteDSPHeader(std::ostream& fout, const char *libName, cmSystemTools::ReplaceString(line, "BUILD_INCLUDES", m_IncludeOptions.c_str()); cmSystemTools::ReplaceString(line, "OUTPUT_LIBNAME",libName); + cmSystemTools::ReplaceString(line, "OUTPUT_LIBRARY_PATH", + exePath.c_str()); + cmSystemTools::ReplaceString(line, "OUTPUT_EXECUTABLE_PATH", + exePath.c_str()); cmSystemTools::ReplaceString(line, "EXTRA_DEFINES", m_Makefile->GetDefineFlags()); diff --git a/Source/staticLibHeader.dsptemplate b/Source/staticLibHeader.dsptemplate index 20610cec6..f6e153b60 100644 --- a/Source/staticLibHeader.dsptemplate +++ b/Source/staticLibHeader.dsptemplate @@ -48,7 +48,7 @@ RSC=rc.exe # PROP BASE Target_Dir "" # PROP Use_MFC 0 # PROP Use_Debug_Libraries 0 -# PROP Output_Dir "Release" +# PROP Output_Dir "OUTPUT_LIBRARY_PATHRelease" # PROP Intermediate_Dir "Release" # PROP Target_Dir "" # ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /FD /c @@ -71,7 +71,7 @@ LIB32=link.exe -lib # PROP BASE Target_Dir "" # PROP Use_MFC 0 # PROP Use_Debug_Libraries 1 -# PROP Output_Dir "Debug" +# PROP Output_Dir "OUTPUT_LIBRARY_PATHDebug" # PROP Intermediate_Dir "Debug" # PROP Target_Dir "" # ADD BASE CPP /nologo /W3 /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_LIB" /FD /GZ /c @@ -92,7 +92,7 @@ LIB32=link.exe -lib # PROP BASE Target_Dir "" # PROP Use_MFC 0 # PROP Use_Debug_Libraries 0 -# PROP Output_Dir "ReleaseMinSize" +# PROP Output_Dir "OUTPUT_LIBRARY_PATHReleaseMinSize" # PROP Intermediate_Dir "ReleaseMinSize" # PROP Ignore_Export_Lib 0 # PROP Target_Dir ""