Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
CMake
CMake
Commits
41e12704
Commit
41e12704
authored
Apr 26, 2001
by
Ken Martin
Browse files
support for debug and opt libraries
parent
888e47dd
Changes
16
Hide whitespace changes
Inline
Side-by-side
Source/DLLHeader.dsptemplate
View file @
41e12704
...
...
@@ -68,7 +68,7 @@ BSC32=bscmake.exe
# ADD BSC32 /nologo
LINK32=link.exe
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386
# ADD LINK32 CM_LIBRARIES kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386
# ADD LINK32
CM_OPTIMIZED_LIBRARIES
CM_LIBRARIES kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386
!ELSEIF "$(CFG)" == "OUTPUT_LIBNAME - Win32 Debug"
...
...
@@ -95,7 +95,7 @@ BSC32=bscmake.exe
# ADD BSC32 /nologo
LINK32=link.exe
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /pdbtype:sept
# ADD LINK32 CM_LIBRARIES kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /pdbtype:sept
# ADD LINK32
CM_DEBUG_LIBRARIES
CM_LIBRARIES kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /pdbtype:sept
!ENDIF
...
...
Source/EXEHeader.dsptemplate
View file @
41e12704
...
...
@@ -63,7 +63,7 @@ BSC32=bscmake.exe
# ADD BSC32 /nologo
LINK32=link.exe
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 /IGNORE:4089
# ADD LINK32 CM_LIBRARIES kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 /IGNORE:4089
# ADD LINK32
CM_OPTIMIZED_LIBRARIES
CM_LIBRARIES kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 /IGNORE:4089
!ELSEIF "$(CFG)" == "OUTPUT_LIBNAME - Win32 Debug"
...
...
@@ -88,7 +88,7 @@ BSC32=bscmake.exe
# ADD BSC32 /nologo
LINK32=link.exe
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept /IGNORE:4089
# ADD LINK32 CM_LIBRARIES kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept /IGNORE:4089
# ADD LINK32
CM_DEBUG_LIBRARIES
CM_LIBRARIES kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept /IGNORE:4089
!ELSEIF "$(CFG)" == "OUTPUT_LIBNAME - Win32 Release MinSize"
# PROP BASE Use_MFC 0
...
...
@@ -110,7 +110,7 @@ BSC32=bscmake.exe
# ADD BSC32 /nologo
LINK32=link.exe
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 /IGNORE:4089
# ADD LINK32 CM_LIBRARIES kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 /IGNORE:4089
# ADD LINK32
CM_OPTIMIZED_LIBRARIES
CM_LIBRARIES kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 /IGNORE:4089
!ENDIF
...
...
Source/MFCDialog/CMakeSetup.rc
View file @
41e12704
...
...
@@ -91,7 +91,7 @@ EXSTYLE WS_EX_APPWINDOW
CAPTION "CMakeSetupDialog"
FONT 8, "MS Sans Serif"
BEGIN
DEFPUSHBUTTON "Close",IDOK,31
9,39
,50,14
DEFPUSHBUTTON "Close",IDOK,
2
31
,206
,50,14
EDITTEXT IDC_WhereSource,129,4,135,13,ES_AUTOHSCROLL
PUSHBUTTON "Browse...",IDC_BUTTON2,269,5,43,13
LTEXT "Where is the source code:",IDC_STATIC,39,6,86,9
...
...
@@ -99,11 +99,13 @@ BEGIN
PUSHBUTTON "Browse...",IDC_BUTTON3,268,25,43,13
LTEXT "Where do you want to build the binaries:",IDC_STATIC,1,
27,128,9
PUSHBUTTON "Build Project Files",IDC_BuildProjects,
6,39
,67,15
GROUPBOX "Cache Values",IDC_STATIC,
2,67,370,156
LISTBOX IDC_LIST2,1
3,84
,344,122,LBS_OWNERDRAWVARIABLE |
PUSHBUTTON "Build Project Files",IDC_BuildProjects,
81,205
,67,15
GROUPBOX "Cache Values",IDC_STATIC,
9,43,356,141
LISTBOX IDC_LIST2,1
5,55
,344,122,LBS_OWNERDRAWVARIABLE |
LBS_HASSTRINGS | LBS_NOINTEGRALHEIGHT | WS_VSCROLL |
WS_TABSTOP
CTEXT "Right click on cache entries for additional options",
IDC_STATIC,19,190,333,11
END
...
...
@@ -165,11 +167,6 @@ BEGIN
TOPMARGIN, 7
BOTTOMMARGIN, 48
END
IDD_CMakeSetupDialog_DIALOG, DIALOG
BEGIN
BOTTOMMARGIN, 215
END
END
#endif // APSTUDIO_INVOKED
...
...
Source/MFCDialog/resource.h
View file @
41e12704
...
...
@@ -13,6 +13,7 @@
#define IDC_BUTTON3 1004
#define IDC_BuildProjects 1006
#define IDC_LIST2 1007
#define IDC_LIST3 1010
// Next default values for new objects
//
...
...
@@ -20,7 +21,7 @@
#ifndef APSTUDIO_READONLY_SYMBOLS
#define _APS_NEXT_RESOURCE_VALUE 131
#define _APS_NEXT_COMMAND_VALUE 32771
#define _APS_NEXT_CONTROL_VALUE 10
08
#define _APS_NEXT_CONTROL_VALUE 10
11
#define _APS_NEXT_SYMED_VALUE 101
#endif
#endif
Source/cmDSPMakefile.cxx
View file @
41e12704
...
...
@@ -53,10 +53,8 @@ void cmDSPMakefile::OutputDSPFile()
}
// Create the DSP or set of DSP's for libraries and executables
const
char
*
cacheValue
=
cmCacheManager
::
GetInstance
()
->
GetCacheValue
(
"BUILD_SHARED_LIBS"
);
m_LibraryBuildType
=
STATIC_LIBRARY
;
if
(
cache
Value
&&
strcmp
(
cacheValue
,
"0
"
))
if
(
c
mC
ache
Manager
::
GetInstance
()
->
IsOn
(
"BUILD_SHARED_LIBS
"
))
{
m_LibraryBuildType
=
DLL
;
}
...
...
@@ -69,30 +67,6 @@ void cmDSPMakefile::OutputDSPFile()
for
(
cmTargets
::
iterator
l
=
tgts
.
begin
();
l
!=
tgts
.
end
();
l
++
)
{
std
::
string
libOptions
;
std
::
vector
<
std
::
string
>&
libdirs
=
m_Makefile
->
GetLinkDirectories
();
for
(
i
=
libdirs
.
begin
();
i
!=
libdirs
.
end
();
++
i
)
{
libOptions
+=
" /LIBPATH:
\"
"
;
libOptions
+=
*
i
;
libOptions
+=
"/$(OUTDIR)
\"
"
;
libOptions
+=
" /LIBPATH:
\"
"
;
libOptions
+=
*
i
;
libOptions
+=
"
\"
"
;
}
std
::
vector
<
std
::
string
>&
libs
=
m_Makefile
->
GetLinkLibraries
();
for
(
i
=
libs
.
begin
();
i
!=
libs
.
end
();
++
i
)
{
// add libraries to executables and dlls (but never include
// a library in a library, bad recursion)
if
(
!
l
->
second
.
IsALibrary
()
||
(
m_LibraryBuildType
==
DLL
&&
l
->
first
.
c_str
()
!=
*
i
))
{
libOptions
+=
" "
;
libOptions
+=
*
i
;
libOptions
+=
".lib "
;
}
}
if
(
l
->
second
.
IsALibrary
())
{
this
->
SetBuildType
(
m_LibraryBuildType
,
l
->
first
.
c_str
());
...
...
@@ -101,13 +75,11 @@ void cmDSPMakefile::OutputDSPFile()
{
this
->
SetBuildType
(
EXECUTABLE
,
l
->
first
.
c_str
());
}
libOptions
+=
"/STACK:10000000 "
;
this
->
CreateSingleDSP
(
l
->
first
.
c_str
(),
l
->
second
,
libOptions
);
this
->
CreateSingleDSP
(
l
->
first
.
c_str
(),
l
->
second
);
}
}
void
cmDSPMakefile
::
CreateSingleDSP
(
const
char
*
lname
,
cmTarget
&
target
,
const
std
::
string
&
libOptions
)
void
cmDSPMakefile
::
CreateSingleDSP
(
const
char
*
lname
,
cmTarget
&
target
)
{
std
::
string
fname
;
fname
=
m_Makefile
->
GetStartOutputDirectory
();
...
...
@@ -121,7 +93,7 @@ void cmDSPMakefile::CreateSingleDSP(const char *lname, cmTarget &target,
{
cmSystemTools
::
Error
(
"Error Writing "
,
fname
.
c_str
());
}
this
->
WriteDSPFile
(
fout
,
lname
,
target
,
libOptions
);
this
->
WriteDSPFile
(
fout
,
lname
,
target
);
}
void
cmDSPMakefile
::
WriteDSPBuildRule
(
std
::
ostream
&
fout
)
...
...
@@ -189,11 +161,10 @@ void cmDSPMakefile::AddDSPBuildRule(cmSourceGroup& sourceGroup)
void
cmDSPMakefile
::
WriteDSPFile
(
std
::
ostream
&
fout
,
const
char
*
libName
,
cmTarget
&
target
,
const
std
::
string
&
libOptions
)
cmTarget
&
target
)
{
// Write the DSP file's header.
this
->
WriteDSPHeader
(
fout
,
libName
,
libOptions
);
this
->
WriteDSPHeader
(
fout
,
libName
,
target
);
// We may be modifying the source groups temporarily, so make a copy.
std
::
vector
<
cmSourceGroup
>
sourceGroups
=
m_Makefile
->
GetSourceGroups
();
...
...
@@ -405,8 +376,55 @@ void cmDSPMakefile::SetBuildType(BuildType b, const char *libName)
}
void
cmDSPMakefile
::
WriteDSPHeader
(
std
::
ostream
&
fout
,
const
char
*
libName
,
const
std
::
string
&
libOptions
)
const
cmTarget
&
target
)
{
// determine the link directories
std
::
string
libOptions
;
std
::
string
libDebugOptions
;
std
::
string
libOptimizedOptions
;
std
::
vector
<
std
::
string
>::
iterator
i
;
std
::
vector
<
std
::
string
>&
libdirs
=
m_Makefile
->
GetLinkDirectories
();
for
(
i
=
libdirs
.
begin
();
i
!=
libdirs
.
end
();
++
i
)
{
libOptions
+=
" /LIBPATH:
\"
"
;
libOptions
+=
*
i
;
libOptions
+=
"/$(OUTDIR)
\"
"
;
libOptions
+=
" /LIBPATH:
\"
"
;
libOptions
+=
*
i
;
libOptions
+=
"
\"
"
;
}
// find link libraries
cmMakefile
::
LinkLibraries
&
libs
=
m_Makefile
->
GetLinkLibraries
();
cmMakefile
::
LinkLibraries
::
const_iterator
j
;
for
(
j
=
libs
.
begin
();
j
!=
libs
.
end
();
++
j
)
{
// add libraries to executables and dlls (but never include
// a library in a library, bad recursion)
if
(
!
target
.
IsALibrary
()
||
(
m_LibraryBuildType
==
DLL
&&
libName
!=
j
->
first
))
{
if
(
j
->
second
==
cmMakefile
::
GENERAL
)
{
libOptions
+=
" "
;
libOptions
+=
j
->
first
;
libOptions
+=
".lib "
;
}
if
(
j
->
second
==
cmMakefile
::
DEBUG
)
{
libDebugOptions
+=
" "
;
libDebugOptions
+=
j
->
first
;
libDebugOptions
+=
".lib "
;
}
if
(
j
->
second
==
cmMakefile
::
OPTIMIZED
)
{
libOptimizedOptions
+=
" "
;
libOptimizedOptions
+=
j
->
first
;
libOptimizedOptions
+=
".lib "
;
}
}
}
libOptions
+=
"/STACK:10000000 "
;
std
::
ifstream
fin
(
m_DSPHeaderTemplate
.
c_str
());
if
(
!
fin
)
{
...
...
@@ -420,6 +438,10 @@ void cmDSPMakefile::WriteDSPHeader(std::ostream& fout, const char *libName,
std
::
string
line
=
buffer
;
cmSystemTools
::
ReplaceString
(
line
,
"CM_LIBRARIES"
,
libOptions
.
c_str
());
cmSystemTools
::
ReplaceString
(
line
,
"CM_DEBUG_LIBRARIES"
,
libDebugOptions
.
c_str
());
cmSystemTools
::
ReplaceString
(
line
,
"CM_OPTIMIZED_LIBRARIES"
,
libOptimizedOptions
.
c_str
());
cmSystemTools
::
ReplaceString
(
line
,
"BUILD_INCLUDES"
,
m_IncludeOptions
.
c_str
());
cmSystemTools
::
ReplaceString
(
line
,
"OUTPUT_LIBNAME"
,
libName
);
...
...
Source/cmDSPMakefile.h
View file @
41e12704
...
...
@@ -67,16 +67,15 @@ private:
std
::
string
m_DSPFooterTemplate
;
std
::
vector
<
std
::
string
>
m_CreatedProjectNames
;
void
CreateSingleDSP
(
const
char
*
lname
,
cmTarget
&
tgt
,
const
std
::
string
&
libs
);
void
CreateSingleDSP
(
const
char
*
lname
,
cmTarget
&
tgt
);
void
WriteDSPFile
(
std
::
ostream
&
fout
,
const
char
*
libName
,
cmTarget
&
tgt
,
const
std
::
string
&
libs
);
cmTarget
&
tgt
);
void
WriteDSPBeginGroup
(
std
::
ostream
&
fout
,
const
char
*
group
,
const
char
*
filter
);
void
WriteDSPEndGroup
(
std
::
ostream
&
fout
);
void
WriteDSPHeader
(
std
::
ostream
&
fout
,
const
char
*
libName
,
const
std
::
string
&
libs
);
const
cmTarget
&
tgt
);
void
WriteDSPBuildRule
(
std
::
ostream
&
fout
,
const
char
*
);
void
WriteDSPBuildRule
(
std
::
ostream
&
fout
);
void
WriteDSPFooter
(
std
::
ostream
&
fout
);
...
...
Source/cmDSPWriter.cxx
View file @
41e12704
...
...
@@ -53,10 +53,8 @@ void cmDSPMakefile::OutputDSPFile()
}
// Create the DSP or set of DSP's for libraries and executables
const
char
*
cacheValue
=
cmCacheManager
::
GetInstance
()
->
GetCacheValue
(
"BUILD_SHARED_LIBS"
);
m_LibraryBuildType
=
STATIC_LIBRARY
;
if
(
cache
Value
&&
strcmp
(
cacheValue
,
"0
"
))
if
(
c
mC
ache
Manager
::
GetInstance
()
->
IsOn
(
"BUILD_SHARED_LIBS
"
))
{
m_LibraryBuildType
=
DLL
;
}
...
...
@@ -69,30 +67,6 @@ void cmDSPMakefile::OutputDSPFile()
for
(
cmTargets
::
iterator
l
=
tgts
.
begin
();
l
!=
tgts
.
end
();
l
++
)
{
std
::
string
libOptions
;
std
::
vector
<
std
::
string
>&
libdirs
=
m_Makefile
->
GetLinkDirectories
();
for
(
i
=
libdirs
.
begin
();
i
!=
libdirs
.
end
();
++
i
)
{
libOptions
+=
" /LIBPATH:
\"
"
;
libOptions
+=
*
i
;
libOptions
+=
"/$(OUTDIR)
\"
"
;
libOptions
+=
" /LIBPATH:
\"
"
;
libOptions
+=
*
i
;
libOptions
+=
"
\"
"
;
}
std
::
vector
<
std
::
string
>&
libs
=
m_Makefile
->
GetLinkLibraries
();
for
(
i
=
libs
.
begin
();
i
!=
libs
.
end
();
++
i
)
{
// add libraries to executables and dlls (but never include
// a library in a library, bad recursion)
if
(
!
l
->
second
.
IsALibrary
()
||
(
m_LibraryBuildType
==
DLL
&&
l
->
first
.
c_str
()
!=
*
i
))
{
libOptions
+=
" "
;
libOptions
+=
*
i
;
libOptions
+=
".lib "
;
}
}
if
(
l
->
second
.
IsALibrary
())
{
this
->
SetBuildType
(
m_LibraryBuildType
,
l
->
first
.
c_str
());
...
...
@@ -101,13 +75,11 @@ void cmDSPMakefile::OutputDSPFile()
{
this
->
SetBuildType
(
EXECUTABLE
,
l
->
first
.
c_str
());
}
libOptions
+=
"/STACK:10000000 "
;
this
->
CreateSingleDSP
(
l
->
first
.
c_str
(),
l
->
second
,
libOptions
);
this
->
CreateSingleDSP
(
l
->
first
.
c_str
(),
l
->
second
);
}
}
void
cmDSPMakefile
::
CreateSingleDSP
(
const
char
*
lname
,
cmTarget
&
target
,
const
std
::
string
&
libOptions
)
void
cmDSPMakefile
::
CreateSingleDSP
(
const
char
*
lname
,
cmTarget
&
target
)
{
std
::
string
fname
;
fname
=
m_Makefile
->
GetStartOutputDirectory
();
...
...
@@ -121,7 +93,7 @@ void cmDSPMakefile::CreateSingleDSP(const char *lname, cmTarget &target,
{
cmSystemTools
::
Error
(
"Error Writing "
,
fname
.
c_str
());
}
this
->
WriteDSPFile
(
fout
,
lname
,
target
,
libOptions
);
this
->
WriteDSPFile
(
fout
,
lname
,
target
);
}
void
cmDSPMakefile
::
WriteDSPBuildRule
(
std
::
ostream
&
fout
)
...
...
@@ -189,11 +161,10 @@ void cmDSPMakefile::AddDSPBuildRule(cmSourceGroup& sourceGroup)
void
cmDSPMakefile
::
WriteDSPFile
(
std
::
ostream
&
fout
,
const
char
*
libName
,
cmTarget
&
target
,
const
std
::
string
&
libOptions
)
cmTarget
&
target
)
{
// Write the DSP file's header.
this
->
WriteDSPHeader
(
fout
,
libName
,
libOptions
);
this
->
WriteDSPHeader
(
fout
,
libName
,
target
);
// We may be modifying the source groups temporarily, so make a copy.
std
::
vector
<
cmSourceGroup
>
sourceGroups
=
m_Makefile
->
GetSourceGroups
();
...
...
@@ -405,8 +376,55 @@ void cmDSPMakefile::SetBuildType(BuildType b, const char *libName)
}
void
cmDSPMakefile
::
WriteDSPHeader
(
std
::
ostream
&
fout
,
const
char
*
libName
,
const
std
::
string
&
libOptions
)
const
cmTarget
&
target
)
{
// determine the link directories
std
::
string
libOptions
;
std
::
string
libDebugOptions
;
std
::
string
libOptimizedOptions
;
std
::
vector
<
std
::
string
>::
iterator
i
;
std
::
vector
<
std
::
string
>&
libdirs
=
m_Makefile
->
GetLinkDirectories
();
for
(
i
=
libdirs
.
begin
();
i
!=
libdirs
.
end
();
++
i
)
{
libOptions
+=
" /LIBPATH:
\"
"
;
libOptions
+=
*
i
;
libOptions
+=
"/$(OUTDIR)
\"
"
;
libOptions
+=
" /LIBPATH:
\"
"
;
libOptions
+=
*
i
;
libOptions
+=
"
\"
"
;
}
// find link libraries
cmMakefile
::
LinkLibraries
&
libs
=
m_Makefile
->
GetLinkLibraries
();
cmMakefile
::
LinkLibraries
::
const_iterator
j
;
for
(
j
=
libs
.
begin
();
j
!=
libs
.
end
();
++
j
)
{
// add libraries to executables and dlls (but never include
// a library in a library, bad recursion)
if
(
!
target
.
IsALibrary
()
||
(
m_LibraryBuildType
==
DLL
&&
libName
!=
j
->
first
))
{
if
(
j
->
second
==
cmMakefile
::
GENERAL
)
{
libOptions
+=
" "
;
libOptions
+=
j
->
first
;
libOptions
+=
".lib "
;
}
if
(
j
->
second
==
cmMakefile
::
DEBUG
)
{
libDebugOptions
+=
" "
;
libDebugOptions
+=
j
->
first
;
libDebugOptions
+=
".lib "
;
}
if
(
j
->
second
==
cmMakefile
::
OPTIMIZED
)
{
libOptimizedOptions
+=
" "
;
libOptimizedOptions
+=
j
->
first
;
libOptimizedOptions
+=
".lib "
;
}
}
}
libOptions
+=
"/STACK:10000000 "
;
std
::
ifstream
fin
(
m_DSPHeaderTemplate
.
c_str
());
if
(
!
fin
)
{
...
...
@@ -420,6 +438,10 @@ void cmDSPMakefile::WriteDSPHeader(std::ostream& fout, const char *libName,
std
::
string
line
=
buffer
;
cmSystemTools
::
ReplaceString
(
line
,
"CM_LIBRARIES"
,
libOptions
.
c_str
());
cmSystemTools
::
ReplaceString
(
line
,
"CM_DEBUG_LIBRARIES"
,
libDebugOptions
.
c_str
());
cmSystemTools
::
ReplaceString
(
line
,
"CM_OPTIMIZED_LIBRARIES"
,
libOptimizedOptions
.
c_str
());
cmSystemTools
::
ReplaceString
(
line
,
"BUILD_INCLUDES"
,
m_IncludeOptions
.
c_str
());
cmSystemTools
::
ReplaceString
(
line
,
"OUTPUT_LIBNAME"
,
libName
);
...
...
Source/cmDSPWriter.h
View file @
41e12704
...
...
@@ -67,16 +67,15 @@ private:
std
::
string
m_DSPFooterTemplate
;
std
::
vector
<
std
::
string
>
m_CreatedProjectNames
;
void
CreateSingleDSP
(
const
char
*
lname
,
cmTarget
&
tgt
,
const
std
::
string
&
libs
);
void
CreateSingleDSP
(
const
char
*
lname
,
cmTarget
&
tgt
);
void
WriteDSPFile
(
std
::
ostream
&
fout
,
const
char
*
libName
,
cmTarget
&
tgt
,
const
std
::
string
&
libs
);
cmTarget
&
tgt
);
void
WriteDSPBeginGroup
(
std
::
ostream
&
fout
,
const
char
*
group
,
const
char
*
filter
);
void
WriteDSPEndGroup
(
std
::
ostream
&
fout
);
void
WriteDSPHeader
(
std
::
ostream
&
fout
,
const
char
*
libName
,
const
std
::
string
&
libs
);
const
cmTarget
&
tgt
);
void
WriteDSPBuildRule
(
std
::
ostream
&
fout
,
const
char
*
);
void
WriteDSPBuildRule
(
std
::
ostream
&
fout
);
void
WriteDSPFooter
(
std
::
ostream
&
fout
);
...
...
Source/cmDSWMakefile.cxx
View file @
41e12704
...
...
@@ -126,23 +126,24 @@ void cmDSWMakefile::WriteProject(std::ostream& fout,
fout
<<
"{{{
\n
"
;
// insert Begin Project Dependency Project_Dep_Name project stuff here
std
::
vector
<
std
::
string
>::
iterator
i
,
end
;
i
=
project
->
GetMakefile
()
->
GetLinkLibraries
().
begin
();
end
=
project
->
GetMakefile
()
->
GetLinkLibraries
().
end
();
for
(;
i
!=
end
;
++
i
)
cmMakefile
::
LinkLibraries
::
const_
iterator
j
,
j
end
;
j
=
project
->
GetMakefile
()
->
GetLinkLibraries
().
begin
();
j
end
=
project
->
GetMakefile
()
->
GetLinkLibraries
().
end
();
for
(;
j
!=
j
end
;
++
j
)
{
if
(
*
i
!=
dspname
)
if
(
j
->
first
!=
dspname
)
{
if
(
!
l
.
IsALibrary
()
||
project
->
GetLibraryBuildType
()
==
cmDSPMakefile
::
DLL
)
{
fout
<<
"Begin Project Dependency
\n
"
;
fout
<<
"Project_Dep_Name "
<<
*
i
<<
"
\n
"
;
fout
<<
"Project_Dep_Name "
<<
j
->
first
<<
"
\n
"
;
fout
<<
"End Project Dependency
\n
"
;
}
}
}
std
::
vector
<
std
::
string
>::
iterator
i
,
end
;
// write utility dependencies.
i
=
project
->
GetMakefile
()
->
GetUtilities
().
begin
();
end
=
project
->
GetMakefile
()
->
GetUtilities
().
end
();
...
...
Source/cmDSWWriter.cxx
View file @
41e12704
...
...
@@ -126,23 +126,24 @@ void cmDSWMakefile::WriteProject(std::ostream& fout,
fout
<<
"{{{
\n
"
;
// insert Begin Project Dependency Project_Dep_Name project stuff here
std
::
vector
<
std
::
string
>::
iterator
i
,
end
;
i
=
project
->
GetMakefile
()
->
GetLinkLibraries
().
begin
();
end
=
project
->
GetMakefile
()
->
GetLinkLibraries
().
end
();
for
(;
i
!=
end
;
++
i
)
cmMakefile
::
LinkLibraries
::
const_
iterator
j
,
j
end
;
j
=
project
->
GetMakefile
()
->
GetLinkLibraries
().
begin
();
j
end
=
project
->
GetMakefile
()
->
GetLinkLibraries
().
end
();
for
(;
j
!=
j
end
;
++
j
)
{
if
(
*
i
!=
dspname
)
if
(
j
->
first
!=
dspname
)
{
if
(
!
l
.
IsALibrary
()
||
project
->
GetLibraryBuildType
()
==
cmDSPMakefile
::
DLL
)
{
fout
<<
"Begin Project Dependency
\n
"
;
fout
<<
"Project_Dep_Name "
<<
*
i
<<
"
\n
"
;
fout
<<
"Project_Dep_Name "
<<
j
->
first
<<
"
\n
"
;
fout
<<
"End Project Dependency
\n
"
;
}
}
}
std
::
vector
<
std
::
string
>::
iterator
i
,
end
;
// write utility dependencies.
i
=
project
->
GetMakefile
()
->
GetUtilities
().
begin
();
end
=
project
->
GetMakefile
()
->
GetUtilities
().
end
();
...
...
Source/cmLinkLibrariesCommand.cxx
View file @
41e12704
...
...
@@ -23,10 +23,27 @@ bool cmLinkLibrariesCommand::Invoke(std::vector<std::string>& args)
this
->
SetError
(
"called with incorrect number of arguments"
);
return
false
;
}
// add libraries, nothe that there is an optional prefix
// of debug and optimized than can be used
for
(
std
::
vector
<
std
::
string
>::
iterator
i
=
args
.
begin
();
i
!=
args
.
end
();
++
i
)
{
m_Makefile
->
AddLinkLibrary
((
*
i
).
c_str
());
if
(
*
i
==
"debug"
)
{
++
i
;
m_Makefile
->
AddLinkLibrary
(
i
->
c_str
(),
cmMakefile
::
DEBUG
);
}
else
if
(
*
i
==
"optimized"
)
{
++
i
;
m_Makefile
->
AddLinkLibrary
(
i
->
c_str
(),
cmMakefile
::
OPTIMIZED
);
}
else
{
m_Makefile
->
AddLinkLibrary
(
i
->
c_str
());
}
}
return
true
;
}
...
...
Source/cmLinkLibrariesCommand.h
View file @
41e12704
...
...
@@ -70,11 +70,14 @@ public:
virtual
const
char
*
GetFullDocumentation
()
{
return
"LINK_LIBRARIES(library1 library2)
\n
"
"LINK_LIBRARIES(library1
<debug | optimized>
library2
...
)
\n
"
"Specify a list of libraries to be linked into
\n
"
"executables or shared objects. This command is passed
\n
"
"down to all other commands. The library name should be
\n
"
"the same as the name used in the LIBRARY(library) command."
;
"the same as the name used in the LIBRARY(library) command.
\n
"
"The debug and optimized strings may be used to indicate that
\n
"
"the next library listed is to be used only for that specific
\n
"
"type of build"
;
}
cmTypeMacro
(
cmLinkLibrariesCommand
,
cmCommand
);
...
...
Source/cmMakefile.cxx
View file @
41e12704
...
...
@@ -127,7 +127,6 @@ void cmMakefile::Print() const
this
->
PrintStringVector
(
"m_MakeVerbatim "
,
m_MakeVerbatim
);
this
->
PrintStringVector
(
"m_IncludeDirectories;"
,
m_IncludeDirectories
);
this
->
PrintStringVector
(
"m_LinkDirectories"
,
m_LinkDirectories
);
this
->
PrintStringVector
(
"m_LinkLibraries"
,
m_LinkLibraries
);
this
->
PrintStringVector
(
"m_Utilities"
,
m_Utilities
);
this
->
PrintStringVector
(
"m_UtilityDirectories"
,
m_UtilityDirectories
);
}
...
...
@@ -335,9 +334,15 @@ void cmMakefile::AddUtilityDirectory(const char* dir)
m_UtilityDirectories
.
push_back
(
dir
);
}
void
cmMakefile
::
AddLinkLibrary
(
const
char
*
lib
,
LinkLibraryType
llt
)
{
m_LinkLibraries
.
push_back
(
std
::
pair
<
std
::
string
,
LinkLibraryType
>
(
lib
,
llt
));
}
void
cmMakefile
::
AddLinkLibrary
(
const
char
*
lib
)
{
m_
LinkLibrar
ies
.
push_back
(
lib
);
this
->
Add
LinkLibrar
y
(
lib
,
GENERAL
);
}
void
cmMakefile
::
AddLinkDirectory
(
const
char
*
dir
)
...
...
@@ -483,11 +488,12 @@ void cmMakefile::ExpandVariables()
{
this
->
ExpandVariablesInString
(
*
j
);
}
begin
=
m_LinkLibraries
.
begin
();
end
=
m_LinkLibraries
.
end
();
for
(
j
=
begin
;
j
!=
end
;
++
j
)
LinkLibraries
::
iterator
j2
,
end2
;
j2
=
m_LinkLibraries
.
begin
();
end2
=
m_LinkLibraries
.
end
();
for
(;
j2
!=
end2
;
++
j2
)
{
this
->
ExpandVariablesInString
(
*
j
);
this
->
ExpandVariablesInString
(
j
2
->
first
);
}
}
...
...
Source/cmMakefile.h
View file @
41e12704
...
...
@@ -118,10 +118,21 @@ public:
*/
void
AddUtilityDirectory
(
const
char
*
);
/**
* Get a list of link libraries in the build.
*/
enum
LinkLibraryType
{
GENERAL
,
DEBUG
,
OPTIMIZED
};
typedef
std
::
vector
<
std
::
pair
<
std
::
string
,
LinkLibraryType
>
>
LinkLibraries
;
LinkLibraries
&
GetLinkLibraries
()
{
return
m_LinkLibraries
;
}
/**