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
47c53e86
Commit
47c53e86
authored
Nov 13, 2007
by
Clinton Stimpson
Browse files
ENH: support specifying build or source directory at command line.
parent
073b1095
Changes
2
Hide whitespace changes
Inline
Side-by-side
Source/QtDialog/CMakeSetup.cxx
View file @
47c53e86
...
...
@@ -16,6 +16,8 @@
=========================================================================*/
#include "QCMake.h" // include to disable MS warnings
#include <QApplication>
#include <QFileInfo>
#include <QDir>
#include "CMakeSetupDialog.h"
...
...
@@ -26,11 +28,26 @@ int main(int argc, char** argv)
app
.
setOrganizationName
(
"Kitware"
);
app
.
setWindowIcon
(
QIcon
(
":/Icons/CMakeSetup.png"
));
// TODO handle CMake args
CMakeSetupDialog
dialog
;
dialog
.
setWindowTitle
(
"CMakeSetup"
);
dialog
.
show
();
// for now: args support specifying build and/or source directory
QStringList
args
=
app
.
arguments
();
if
(
args
.
count
()
==
2
)
{
QFileInfo
buildFileInfo
(
args
[
1
],
"CMakeCache.txt"
);
QFileInfo
srcFileInfo
(
args
[
1
],
"CMakeLists.txt"
);
if
(
buildFileInfo
.
exists
())
{
dialog
.
setBinaryDirectory
(
buildFileInfo
.
absolutePath
());
}
else
if
(
srcFileInfo
.
exists
())
{
dialog
.
setSourceDirectory
(
srcFileInfo
.
absolutePath
());
dialog
.
setBinaryDirectory
(
QDir
::
currentPath
());
}
}
return
app
.
exec
();
}
...
...
Source/QtDialog/CMakeSetupDialog.cxx
View file @
47c53e86
...
...
@@ -113,6 +113,10 @@ CMakeSetupDialog::CMakeSetupDialog()
this
,
SLOT
(
doHelp
()));
this
->
setAcceptDrops
(
true
);
// get the saved binary directories
QStringList
buildPaths
=
this
->
loadBuildPaths
();
this
->
BinaryDirectory
->
addItems
(
buildPaths
);
// start the cmake worker thread
this
->
CMakeThread
=
new
QCMakeThread
(
this
);
...
...
@@ -191,11 +195,6 @@ void CMakeSetupDialog::initialize()
QObject
::
connect
(
this
->
AddEntry
,
SIGNAL
(
clicked
(
bool
)),
this
,
SLOT
(
addCacheEntry
()));
// get the saved binary directories
QStringList
buildPaths
=
this
->
loadBuildPaths
();
this
->
BinaryDirectory
->
blockSignals
(
true
);
this
->
BinaryDirectory
->
addItems
(
buildPaths
);
this
->
BinaryDirectory
->
blockSignals
(
false
);
if
(
!
this
->
SourceDirectory
->
text
().
isEmpty
()
||
!
this
->
BinaryDirectory
->
lineEdit
()
->
text
().
isEmpty
())
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment