[Cmake] CMAKE_ROOT

John Biddiscombe jbiddiscombe at skippingmouse.co.uk
Wed May 30 11:06:51 EDT 2001


>How are you trying to run it?   I assume you are not running the GUI..

I've got my own GUI and all I do is this

     if (makefile) delete makefile;
     makefile = new cmMakefile();
     //
     if (pg) delete pg;
     pg = new cmBCBMakefile(NULL); * * * * * * LOOK HERE !!!!
     //
     makefile->SetMakefileGenerator(pg);
     makefile->SetHomeDirectory(e_vtkdir->Text.c_str());
     makefile->SetStartDirectory(e_vtkdir->Text.c_str());
     makefile->SetStartOutputDirectory(e_output->Text.c_str());
     makefile->SetHomeOutputDirectory(e_output->Text.c_str());
     //
     makefile->MakeStartDirectoriesCurrent();
     cmCacheManager::GetInstance()->LoadCache(makefile);
     makefile->ReadListFile(e_makelists->Text.c_str());
     makefile->GenerateMakefile();
     this->FillCacheGUIFromCacheManager();

I just get endless errors when doing
makefile->ReadListFile(e_makelists->Text.c_str());
I've added CMAKE_ROOT to my cache, but the real problem is that it seems it 
never gets expanded out to its value, the error says
can't find....$(CMAKE_ROOT)/modules/opengl.cmake
which means it never converts CMAKE_ROOT into a path.

If I look at MSProject generator, which does this

void cmMSProjectGenerator::ComputeSystemInfo()
{
   // now load the settings
   std::string fpath =
     cmCacheManager::GetInstance()->GetCacheValue("CMAKE_ROOT");
   fpath += "/Templates/CMakeWindowsSystemConfig.cmake";
   m_Makefile->ReadListFile(NULL,fpath.c_str());
}

it just crashes with access violation on the GetCacheValue stuff

any help gratefully received.

JB





More information about the CMake mailing list