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
73f04d14
Commit
73f04d14
authored
Apr 24, 2001
by
Ken Martin
Browse files
many fixes and cleanup and features
parent
b5746484
Changes
36
Hide whitespace changes
Inline
Side-by-side
Source/CMakeLib.dsp
View file @
73f04d14
...
...
@@ -89,10 +89,6 @@ SOURCE=.\cmCacheManager.cxx
# End Source File
# Begin Source File
SOURCE=.\cmClassFile.cxx
# End Source File
# Begin Source File
SOURCE=.\cmCommands.cxx
# End Source File
# Begin Source File
...
...
@@ -129,288 +125,152 @@ SOURCE=.\cmRegularExpression.cxx
# End Source File
# Begin Source File
SOURCE=.\cmSourceFile.cxx
# End Source File
# Begin Source File
SOURCE=.\cmSourceGroup.cxx
# End Source File
# Begin Source File
SOURCE=.\cmSystemTools.cxx
# End Source File
# Begin Source File
SOURCE=.\cmTarget.cxx
# End Source File
# End Group
# Begin Group "Header Files"
# PROP Default_Filter "h;hpp;hxx;hm;inl"
# Begin Source File
SOURCE=..\cmAbstractFilesCommand.h
# End Source File
# Begin Source File
SOURCE=.\cmAbstractFilesCommand.h
# End Source File
# Begin Source File
SOURCE=..\cmAddTargetCommand.h
# End Source File
# Begin Source File
SOURCE=.\cmAddTargetCommand.h
# End Source File
# Begin Source File
SOURCE=..\cmAuxSourceDirectoryCommand.h
# End Source File
# Begin Source File
SOURCE=.\cmAuxSourceDirectoryCommand.h
# End Source File
# Begin Source File
SOURCE=..\cmCacheManager.h
# End Source File
# Begin Source File
SOURCE=.\cmCacheManager.h
# End Source File
# Begin Source File
SOURCE=..\cmClassFile.h
# End Source File
# Begin Source File
SOURCE=.\cmClassFile.h
# End Source File
# Begin Source File
SOURCE=..\cmCommand.h
# End Source File
# Begin Source File
SOURCE=.\cmCommand.h
# End Source File
# Begin Source File
SOURCE=..\cmDirectory.h
# End Source File
# Begin Source File
SOURCE=.\cmDirectory.h
# End Source File
# Begin Source File
SOURCE=..\cmDSPMakefile.h
# End Source File
# Begin Source File
SOURCE=.\cmDSPMakefile.h
# End Source File
# Begin Source File
SOURCE=..\cmDSWMakefile.h
# End Source File
# Begin Source File
SOURCE=.\cmDSWMakefile.h
# End Source File
# Begin Source File
SOURCE=..\cmExecutablesCommand.h
# End Source File
# Begin Source File
SOURCE=.\cmExecutablesCommand.h
# End Source File
# Begin Source File
SOURCE=..\cmFindIncludeCommand.h
# End Source File
# Begin Source File
SOURCE=.\cmFindIncludeCommand.h
# End Source File
# Begin Source File
SOURCE=..\cmFindLibraryCommand.h
# End Source File
# Begin Source File
SOURCE=.\cmFindLibraryCommand.h
# End Source File
# Begin Source File
SOURCE=..\cmFindProgramCommand.h
# End Source File
# Begin Source File
SOURCE=.\cmFindProgramCommand.h
# End Source File
# Begin Source File
SOURCE=..\cmIncludeDirectoryCommand.h
# End Source File
# Begin Source File
SOURCE=.\cmIncludeDirectoryCommand.h
# End Source File
# Begin Source File
SOURCE=..\cmLibraryCommand.h
# End Source File
# Begin Source File
SOURCE=.\cmLibraryCommand.h
# End Source File
# Begin Source File
SOURCE=..\cmLinkDirectoriesCommand.h
# End Source File
# Begin Source File
SOURCE=.\cmLinkDirectoriesCommand.h
# End Source File
# Begin Source File
SOURCE=..\cmLinkLibrariesCommand.h
# End Source File
# Begin Source File
SOURCE=.\cmLinkLibrariesCommand.h
# End Source File
# Begin Source File
SOURCE=..\cmMakeDepend.h
# End Source File
# Begin Source File
SOURCE=.\cmMakeDepend.h
# End Source File
# Begin Source File
SOURCE=..\cmMakefile.h
# End Source File
# Begin Source File
SOURCE=.\cmMakefile.h
# End Source File
# Begin Source File
SOURCE=..\cmMakefileGenerator.h
# End Source File
# Begin Source File
SOURCE=.\cmMakefileGenerator.h
# End Source File
# Begin Source File
SOURCE=..\cmMSProjectGenerator.h
# End Source File
# Begin Source File
SOURCE=.\cmMSProjectGenerator.h
# End Source File
# Begin Source File
SOURCE=..\cmProjectCommand.h
# End Source File
# Begin Source File
SOURCE=.\cmProjectCommand.h
# End Source File
# Begin Source File
SOURCE=..\cmRegularExpression.h
# End Source File
# Begin Source File
SOURCE=.\cmRegularExpression.h
# End Source File
# Begin Source File
SOURCE=..\cmSourceFilesCommand.h
# End Source File
# Begin Source File
SOURCE=.\cmSourceFilesCommand.h
# End Source File
# Begin Source File
SOURCE=..\cmSourceFilesRequireCommand.h
# End Source File
# Begin Source File
SOURCE=.\cmSourceFilesRequireCommand.h
# End Source File
# Begin Source File
SOURCE=..\cmStandardIncludes.h
# End Source File
# Begin Source File
SOURCE=.\cmStandardIncludes.h
# End Source File
# Begin Source File
SOURCE=..\cmSubdirCommand.h
# End Source File
# Begin Source File
SOURCE=.\cmSubdirCommand.h
# End Source File
# Begin Source File
SOURCE=..\cmSystemTools.h
# End Source File
# Begin Source File
SOURCE=.\cmSystemTools.h
# End Source File
# Begin Source File
SOURCE=..\cmTestsCommand.h
# End Source File
# Begin Source File
SOURCE=.\cmTestsCommand.h
# End Source File
# Begin Source File
SOURCE=..\cmUnixDefinesCommand.h
# End Source File
# Begin Source File
SOURCE=.\cmUnixDefinesCommand.h
# End Source File
# Begin Source File
SOURCE=..\cmUnixLibrariesCommand.h
# End Source File
# Begin Source File
SOURCE=.\cmUnixLibrariesCommand.h
# End Source File
# Begin Source File
SOURCE=..\cmUnixMakefileGenerator.h
# End Source File
# Begin Source File
SOURCE=.\cmUnixMakefileGenerator.h
# End Source File
# Begin Source File
SOURCE=..\cmWin32DefinesCommand.h
# End Source File
# Begin Source File
SOURCE=.\cmWin32DefinesCommand.h
# End Source File
# Begin Source File
SOURCE=..\cmWin32LibrariesCommand.h
# End Source File
# Begin Source File
SOURCE=.\cmWin32LibrariesCommand.h
# End Source File
# End Group
# End Target
# End Project
Source/MFCDialog/CMakeSetupDialog.cpp
View file @
73f04d14
...
...
@@ -289,7 +289,7 @@ bool CMakeSetupDialog::Browse(CString &result, const char *title)
LPITEMIDLIST
pidl
=
SHBrowseForFolder
(
&
bi
);
bool
bSuccess
=
(
bool
)
SHGetPathFromIDList
(
pidl
,
szPathName
);
bool
bSuccess
=
(
SHGetPathFromIDList
(
pidl
,
szPathName
)
?
true
:
false
)
;
if
(
bSuccess
)
{
result
=
szPathName
;
...
...
@@ -406,17 +406,17 @@ void CMakeSetupDialog::OnBuildProjects()
// copy from the cache manager to the cache edit list box
void
CMakeSetupDialog
::
FillCacheEditorFromCacheManager
()
{
cmCacheManager
::
CacheEntryMap
cache
=
const
cmCacheManager
::
CacheEntryMap
&
cache
=
cmCacheManager
::
GetInstance
()
->
GetCacheMap
();
for
(
cmCacheManager
::
CacheEntryMap
::
iterator
i
=
cache
.
begin
();
for
(
cmCacheManager
::
CacheEntryMap
::
const_
iterator
i
=
cache
.
begin
();
i
!=
cache
.
end
();
++
i
)
{
const
char
*
key
=
i
->
first
.
c_str
();
cmCacheManager
::
CacheEntry
&
value
=
i
->
second
;
const
cmCacheManager
::
CacheEntry
&
value
=
i
->
second
;
switch
(
value
.
m_Type
)
{
case
cmCacheManager
::
BOOL
:
if
(
cmCacheManager
::
GetInstance
()
->
IsOn
(
value
.
m_Value
.
c_str
()
))
if
(
cmCacheManager
::
GetInstance
()
->
IsOn
(
key
))
{
m_CacheEntriesList
.
AddProperty
(
key
,
"ON"
,
...
...
@@ -451,7 +451,6 @@ void CMakeSetupDialog::FillCacheEditorFromCacheManager()
// copy from the list box to the cache manager
void
CMakeSetupDialog
::
FillCacheManagerFromCacheEditor
()
{
cmCacheManager
::
CacheEntryMap
cache
=
cmCacheManager
::
GetInstance
()
->
GetCacheMap
();
std
::
set
<
CPropertyItem
*>
items
=
m_CacheEntriesList
.
GetItems
();
for
(
std
::
set
<
CPropertyItem
*>::
iterator
i
=
items
.
begin
();
...
...
@@ -465,9 +464,12 @@ void CMakeSetupDialog::FillCacheManagerFromCacheEditor()
}
else
{
cmCacheManager
::
CacheEntryMap
::
iterator
p
=
cache
.
find
((
const
char
*
)
item
->
m_propName
);
(
*
p
).
second
.
m_Value
=
item
->
m_curValue
;
cmCacheManager
::
CacheEntry
*
entry
=
cmCacheManager
::
GetInstance
()
->
GetCacheEntry
((
const
char
*
)
item
->
m_propName
);
if
(
entry
)
{
entry
->
m_Value
=
item
->
m_curValue
;
}
}
}
}
...
...
Source/Makefile.in
View file @
73f04d14
...
...
@@ -17,11 +17,12 @@ cmMakeDepend.o \
cmMakefile.o
\
cmMakefileGenerator.o
\
cmRegularExpression.o
\
cm
Class
File.o
\
cm
Source
File.o
\
cmSystemTools.o
\
cmDirectory.o
\
cmUnixMakefileGenerator.o
\
cmCommands.o
\
cmTarget.o
\
cmCustomCommand.o
\
cmCacheManager.o
\
cmSourceGroup.o
...
...
@@ -35,11 +36,12 @@ cmMakefile.o : $(DEPENDS)
cmMakefileGenerator.o
:
$(DEPENDS)
cmAuxSourceDirectoryCommand.o
:
$(DEPENDS)
cmRegularExpression.o
:
$(DEPENDS)
cm
Class
File.o
:
$(DEPENDS)
cm
Source
File.o
:
$(DEPENDS)
cmDirectory.o
:
$(DEPENDS)
cmCustomCommand.o
:
$(DEPENDS)
cmUnixMakefileGenerator.o
:
$(DEPENDS)
cmCommands.o
:
$(DEPENDS)
cmTarget.o
:
$(DEPENDS)
cmCacheManager.o
:
$(DEPENDS)
cmSourceGroup.o
:
$(DEPENDS)
...
...
Source/cmAbstractFilesCommand.cxx
View file @
73f04d14
...
...
@@ -23,19 +23,19 @@ bool cmAbstractFilesCommand::Invoke(std::vector<std::string>& args)
this
->
SetError
(
"called with incorrect number of arguments"
);
return
false
;
}
cmMakefile
::
Class
Map
&
Classes
=
m_Makefile
->
Get
Class
es
();
cmMakefile
::
Source
Map
&
Classes
=
m_Makefile
->
Get
Sourc
es
();
for
(
std
::
vector
<
std
::
string
>::
iterator
j
=
args
.
begin
();
j
!=
args
.
end
();
++
j
)
{
for
(
cmMakefile
::
Class
Map
::
iterator
l
=
Classes
.
begin
();
for
(
cmMakefile
::
Source
Map
::
iterator
l
=
Classes
.
begin
();
l
!=
Classes
.
end
();
l
++
)
{
for
(
std
::
vector
<
cm
Class
File
>::
iterator
i
=
l
->
second
.
begin
();
for
(
std
::
vector
<
cm
Source
File
>::
iterator
i
=
l
->
second
.
begin
();
i
!=
l
->
second
.
end
();
i
++
)
{
if
(
i
->
m_Class
Name
==
(
*
j
))
if
(
i
->
GetSource
Name
()
==
(
*
j
))
{
i
->
m_
AbstractClass
=
true
;
i
->
SetIsAn
AbstractClass
(
true
)
;
}
}
}
...
...
Source/cmAuxSourceDirectoryCommand.cxx
View file @
73f04d14
...
...
@@ -49,10 +49,10 @@ bool cmAuxSourceDirectoryCommand::Invoke(std::vector<std::string>& args)
fullname
+=
file
;
// add the file as a class file so
// depends can be done
cm
Class
File
cmfile
;
cm
Source
File
cmfile
;
cmfile
.
SetName
(
fullname
.
c_str
(),
m_Makefile
->
GetCurrentDirectory
());
cmfile
.
m_
AbstractClass
=
false
;
m_Makefile
->
Add
Class
(
cmfile
,
args
[
1
].
c_str
());
cmfile
.
SetIsAn
AbstractClass
(
false
)
;
m_Makefile
->
Add
Source
(
cmfile
,
args
[
1
].
c_str
());
}
}
}
...
...
Source/cmCablePackageCommand.cxx
View file @
73f04d14
...
...
@@ -128,11 +128,11 @@ void cmCablePackageCommand::FinalPass()
// Add a rule to build the generated package.
std
::
string
fileName
=
"Cxx/"
+
m_PackageName
+
"_cxx"
;
std
::
string
filePath
=
m_Makefile
->
GetStartOutputDirectory
();
cm
Class
File
file
;
file
.
m_
AbstractClass
=
false
;
file
.
m_
HeaderFileOnly
=
false
;
cm
Source
File
file
;
file
.
SetIsAn
AbstractClass
(
false
)
;
file
.
SetIsA
HeaderFileOnly
(
false
)
;
file
.
SetName
(
fileName
.
c_str
(),
filePath
.
c_str
(),
"cxx"
,
false
);
m_Makefile
->
Add
Class
(
file
,
m_PackageName
.
c_str
());
m_Makefile
->
Add
Source
(
file
,
m_PackageName
.
c_str
());
}
...
...
Source/cmCableSourceFilesCommand.cxx
View file @
73f04d14
...
...
@@ -24,8 +24,8 @@ void cmCableSourceFilesCommand::FinalPass()
std
::
string
fileName
=
"Cxx/"
;
fileName
+=
cablePackage
->
GetPackageName
();
fileName
+=
"_cxx"
;
cm
Class
File
*
ci
=
m_Makefile
->
Get
Class
(
cablePackage
->
GetPackageName
(),
fileName
.
c_str
());
cm
Source
File
*
ci
=
m_Makefile
->
Get
Source
(
cablePackage
->
GetPackageName
(),
fileName
.
c_str
());
if
(
ci
==
0
)
{
return
;
}
...
...
@@ -36,7 +36,7 @@ void cmCableSourceFilesCommand::FinalPass()
f
!=
m_Entries
.
end
();
++
f
)
{
std
::
string
header
=
*
f
+
".h"
;
ci
->
m_
Depends
.
push_back
(
header
);
ci
->
Get
Depends
()
.
push_back
(
header
);
}
}
...
...
Source/cmCacheManager.cxx
View file @
73f04d14
...
...
@@ -96,7 +96,7 @@ bool cmCacheManager::LoadCache(cmMakefile* mf)
return
true
;
}
bool
cmCacheManager
::
SaveCache
(
cmMakefile
*
mf
)
bool
cmCacheManager
::
SaveCache
(
cmMakefile
*
mf
)
const
{
std
::
string
cacheFile
=
mf
->
GetHomeOutputDirectory
();
cacheFile
+=
"/CMakeCache.txt"
;
...
...
@@ -119,7 +119,7 @@ bool cmCacheManager::SaveCache(cmMakefile* mf)
<<
"# TYPE is a hint to GUI's for the type of VALUE, DO NOT EDIT TYPE!.
\n
"
<<
"# VALUE is the current value for the KEY.
\n\n
"
;
for
(
std
::
map
<
std
::
string
,
CacheEntry
>::
iterator
i
=
m_Cache
.
begin
();
for
(
std
::
map
<
std
::
string
,
CacheEntry
>::
const_
iterator
i
=
m_Cache
.
begin
();
i
!=
m_Cache
.
end
();
++
i
)
{
CacheEntryType
t
=
(
*
i
).
second
.
m_Type
;
...
...
@@ -151,34 +151,43 @@ void cmCacheManager::AddCacheEntry(const char* key,
m_Cache
[
key
]
=
e
;
}
c
onst
char
*
cmCacheManager
::
GetCache
Value
(
const
char
*
key
)
c
mCacheManager
::
CacheEntry
*
cmCacheManager
::
GetCache
Entry
(
const
char
*
key
)
{
if
(
m_Cache
.
count
(
key
))
{
return
m_Cache
[
key
].
m_Value
.
c_str
();
return
&
(
m_Cache
.
find
(
key
)
->
second
);
}
return
0
;
}
const
char
*
cmCacheManager
::
GetCacheValue
(
const
char
*
key
)
const
{
if
(
m_Cache
.
count
(
key
))
{
return
m_Cache
.
find
(
key
)
->
second
.
m_Value
.
c_str
();
}
return
0
;
}
bool
cmCacheManager
::
IsOn
(
const
char
*
key
)
bool
cmCacheManager
::
IsOn
(
const
char
*
key
)
const
{
if
(
!
m_Cache
.
count
(
key
))
{
return
false
;
}
std
::
string
&
v
=
m_Cache
[
key
]
.
m_Value
;
const
std
::
string
&
v
=
m_Cache
.
find
(
key
)
->
second
.
m_Value
;
return
(
v
==
"ON"
||
v
==
"on"
||
v
==
"1"
||
v
==
"true"
||
v
==
"yev"
||
v
==
"TRUE"
||
v
==
"True"
||
v
==
"y"
||
v
==
"Y"
);
}
void
cmCacheManager
::
PrintCache
(
std
::
ostream
&
out
)
void
cmCacheManager
::
PrintCache
(
std
::
ostream
&
out
)
const
{
out
<<
"================================================="
<<
std
::
endl
;
out
<<
"CMakeCache Contents:"
<<
std
::
endl
;
for
(
std
::
map
<
std
::
string
,
CacheEntry
>::
iterator
i
=
m_Cache
.
begin
();
for
(
std
::
map
<
std
::
string
,
CacheEntry
>::
const_
iterator
i
=
m_Cache
.
begin
();
i
!=
m_Cache
.
end
();
++
i
)
{
out
<<
(
*
i
).
first
.
c_str
()
<<
" = "
<<
(
*
i
).
second
.
m_Value
.
c_str
()
<<
std
::
endl
;
...
...
Source/cmCacheManager.h
View file @
73f04d14
...
...
@@ -35,8 +35,8 @@ public:
std
::
string
m_Value
;
CacheEntryType
m_Type
;
};
typedef
std
::
map
<
std
::
string
,
CacheEntry
>
CacheEntryMap
;
public:
typedef
std
::
map
<
std
::
string
,
CacheEntry
>
CacheEntryMap
;
/**
* Types for the cache entries. These are useful as
* hints for a cache editor program. Path should bring
...
...
@@ -53,7 +53,7 @@ public:
bool
LoadCache
(
cmMakefile
*
);
//! Save cache for given makefile. Saves to ouput home CMakeCache.txt
bool
SaveCache
(
cmMakefile
*
);
bool
SaveCache
(
cmMakefile
*
)
const
;
//! Add an entry into the cache
void
AddCacheEntry
(
const
char
*
key
,
const
char
*
value
,
CacheEntryType
type
);
...
...
@@ -64,18 +64,22 @@ public:
//! Remove an entry from the cache
void
RemoveCacheEntry
(
const
char
*
key
);
//! Print the cache to a stream
CacheEntry
*
GetCacheEntry
(
const
char
*
key
);
//! Get a value from the cache given a key
const
char
*
GetCacheValue
(
const
char
*
key
);
const
char
*
GetCacheValue
(
const
char
*
key
)
const
;
//! Test a boolean cache entry to see if it is true or false, returns false
// if no entry.
bool
IsOn
(
const
char
*
);
bool
IsOn
(
const
char
*
)
const
;
//! Print the cache to a stream
void
PrintCache
(
std
::
ostream
&
);
void
PrintCache
(
std
::
ostream
&
)
const
;
//! Get the cache map ivar.
CacheEntryMap
GetCacheMap
()
{
return
m_Cache
;
}
const
CacheEntryMap
&
GetCacheMap
()
const
{
return
m_Cache
;
}
private:
static
cmCacheManager
*
s_Instance
;
CacheEntryMap
m_Cache
;
...
...
Source/cmCommands.cxx
View file @
73f04d14
...
...
@@ -38,7 +38,8 @@
#include
"cmCableInstantiateClassCommand.cxx"
#include
"cmFindFileCommand.cxx"
#include
"cmWrapExcludeFilesCommand.cxx"
#include
"cmWrapTclCommand.cxx"
#include
"cmVTKWrapPythonCommand.cxx"
#include
"cmVTKWrapTclCommand.cxx"
#include
"cmBuildSharedLibrariesCommand.cxx"
#include
"cmUtilitySourceCommand.cxx"
#include
"cmIncludeRegularExpressionCommand.cxx"
...
...
@@ -83,7 +84,8 @@ void GetPredefinedCommands(std::list<cmCommand*>& commands)
commands
.
push_back
(
new
cmCableInstantiateClassCommand
);
commands
.
push_back
(
new
cmFindFileCommand
);
commands
.
push_back
(
new
cmWrapExcludeFilesCommand
);
commands
.
push_back
(
new
cmWrapTclCommand
);
commands
.
push_back
(
new
cmVTKWrapPythonCommand
);
commands
.
push_back
(
new
cmVTKWrapTclCommand
);
commands
.
push_back
(
new
cmBuildSharedLibrariesCommand
);
commands
.
push_back
(
new
cmUtilitySourceCommand
);
commands
.
push_back
(
new
cmIncludeRegularExpressionCommand
);
...
...
Source/cmDSPMakefile.cxx
View file @
73f04d14
...
...
@@ -87,8 +87,8 @@ void cmDSPMakefile::OutputDSPFile()
m_CreatedProjectNames
.
clear
();
// build any targets
const
cmTargets
&
tgts
=
m_Makefile
->
GetTargets
();
for
(
cmTargets
::
const_
iterator
l
=
tgts
.
begin
();
cmTargets
&
tgts
=
m_Makefile
->
GetTargets
();
for
(
cmTargets
::
iterator
l
=
tgts
.
begin
();
l
!=
tgts
.
end
();
l
++
)
{
if
(
l
->
second
.
IsALibrary
())
...
...
@@ -103,8 +103,7 @@ void cmDSPMakefile::OutputDSPFile()
}
}
void
cmDSPMakefile
::
CreateSingleDSP
(
const
char
*
lname
,
const
cmTarget
&
target
)
void
cmDSPMakefile
::
CreateSingleDSP
(
const
char
*
lname
,
cmTarget
&
target
)
{
std
::
string
fname
;
fname
=
m_Makefile
->
GetStartOutputDirectory
();
...
...
@@ -186,7 +185,7 @@ void cmDSPMakefile::AddDSPBuildRule(cmSourceGroup& sourceGroup)
void
cmDSPMakefile
::
WriteDSPFile
(
std
::
ostream
&
fout
,
const
char
*
libName
,
const
cmTarget
&
target
)
cmTarget
&
target
)
{
// Write the DSP file's header.
this
->