summaryrefslogtreecommitdiffstats
path: root/Source/FLTKDialog
diff options
context:
space:
mode:
authorLuis Ibanez <luis.ibanez@kitware.com>2001-06-11 05:20:22 (GMT)
committerLuis Ibanez <luis.ibanez@kitware.com>2001-06-11 05:20:22 (GMT)
commit7a9ab85304015a576a39198a444dc9ad8525f6aa (patch)
tree3b2f988dc61931eabc40d8ceaa9282a9789082c1 /Source/FLTKDialog
parent6d04ee9ec175f129baefd226436fcd9c539eafaa (diff)
downloadCMake-7a9ab85304015a576a39198a444dc9ad8525f6aa.zip
CMake-7a9ab85304015a576a39198a444dc9ad8525f6aa.tar.gz
CMake-7a9ab85304015a576a39198a444dc9ad8525f6aa.tar.bz2
ENH: CMake invokation is working.
Diffstat (limited to 'Source/FLTKDialog')
-rw-r--r--Source/FLTKDialog/CMakeSetupGUIImplementation.cxx53
-rw-r--r--Source/FLTKDialog/CMakeSetupGUIImplementation.h2
2 files changed, 53 insertions, 2 deletions
diff --git a/Source/FLTKDialog/CMakeSetupGUIImplementation.cxx b/Source/FLTKDialog/CMakeSetupGUIImplementation.cxx
index 64d2ce4..c07298a 100644
--- a/Source/FLTKDialog/CMakeSetupGUIImplementation.cxx
+++ b/Source/FLTKDialog/CMakeSetupGUIImplementation.cxx
@@ -8,6 +8,8 @@
#include "../cmMakefile.h"
#include <iostream>
#include "FLTKPropertyList.h"
+#include "Fl/fl_draw.H"
+#include "../cmake.h"
@@ -17,6 +19,12 @@
CMakeSetupGUIImplementation
::CMakeSetupGUIImplementation()
{
+ m_BuildPathChanged = false;
+ char fname[1024];
+ //::GetModuleFileName(NULL,fname,1023);
+ m_PathToExecutable = cmSystemTools::GetProgramPath(fname).c_str();
+ m_PathToExecutable += "/cmake.exe";
+ std::cout << "Path to executable = " << m_PathToExecutable << std::endl;
}
@@ -139,7 +147,11 @@ CMakeSetupGUIImplementation
if( VerifyBinaryPath( path ) )
{
- m_WhereBuild = path;
+ if( m_WhereBuild != path )
+ {
+ m_BuildPathChanged = true;
+ m_WhereBuild = path;
+ }
binaryPathTextInput->value( path );
}
@@ -224,7 +236,44 @@ CMakeSetupGUIImplementation
SaveCacheFromGUI();
- fl_message("Building project files ... please wait");
+ // set the wait cursor
+ fl_cursor(FL_CURSOR_WAIT,FL_WHITE,FL_BLACK);
+ // get all the info from the dialog
+ // this->UpdateData();
+ if(!m_BuildPathChanged)
+ {
+ // if the build path has not changed save the
+ // current GUI values to the cache
+ this->SaveCacheFromGUI();
+ }
+ // Make sure we are working from the cache on disk
+ this->LoadCacheFromDiskToGUI();
+ // create a cmake object
+ cmake make;
+ // create the arguments for the cmake object
+ std::vector<std::string> args;
+ args.push_back( m_PathToExecutable.c_str() );
+ std::string arg;
+ arg = "-H";
+ arg += m_WhereSource;
+ args.push_back(arg);
+ arg = "-B";
+ arg += m_WhereBuild;
+ args.push_back(arg);
+ // run the generate process
+ if(make.Generate(args) != 0)
+ {
+ cmSystemTools::Error(
+ "Error in generation process, project files may be invalid");
+ }
+ // update the GUI with any new values in the caused by the
+ // generation process
+ this->LoadCacheFromDiskToGUI();
+ // path is up-to-date now
+ m_BuildPathChanged = false;
+ // put the cursor back
+ fl_cursor(FL_CURSOR_DEFAULT,FL_WHITE,FL_BLACK);
+ fl_message("Done !");
}
diff --git a/Source/FLTKDialog/CMakeSetupGUIImplementation.h b/Source/FLTKDialog/CMakeSetupGUIImplementation.h
index 870f052..d0f8021 100644
--- a/Source/FLTKDialog/CMakeSetupGUIImplementation.h
+++ b/Source/FLTKDialog/CMakeSetupGUIImplementation.h
@@ -39,6 +39,8 @@ private:
fltk::PropertyList m_CacheEntriesList;
std::string m_WhereBuild;
std::string m_WhereSource;
+ std::string m_PathToExecutable;
+ bool m_BuildPathChanged;
};